The below is a simple program to add, subtract, multiply and divide integer numbers. It’s the first program I wrote in C++ as a tester and most of the basic concepts are covered so I’ll go through them here in case they’re of help to someone else! I’ll admit the explainations below are a...
Read more »
Tags: c++, calculator
Posted in c++ | No Comments »
This script uses the Unix mailx program to send a pre-scripted email to someone. It will take in an email address on the command line as an argument and send the mail to this address. Just copy and paste this into a file named mailerscript and change the file permissions to 755 and then...
Read more »
Tags: bash, mail, mailer, script, shell
Posted in linux | No Comments »
In Linux is extremely easy to change your MAC address. All you need is a couple of commands. To start off you will need to take down the interface to make the change. To do so just type the following into your terminal: $ ifconfig eth0 down Now we can get to changing the...
Read more »
Tags: eth, interface, linux, mac, networking
Posted in linux, networking | No Comments »
The basis for this particular article (and most of the info) came from one of the guys I work with, Gavin McCullagh, who I’m pretty sure knows more stuff than is good for him. It’s all pretty handy stuff, but can be irritating to get working Forwarding X Server If you want to forward...
Read more »
Tags: linux, ssh, tunnel, tunneling
Posted in linux | No Comments »
This is just a handy script I use for renaming my music collection. It got to be too much trouble having the first letter of each word capitalised, getting new music with the names all in caps, or all in lowercase…so I decided to make everything lowercase and write a script to do it...
Read more »
Tags: find, lc, lowercase, perl, rename
Posted in perl | No Comments »
NAME Csvsql – use SQL queries to access information in CSV files DESCRIPTION csvsql enables you to access a CSV file as if it were a table in a database. This means you can use SQL queries, with each ’common seperated value’ as part of a column. Traditionally in order to access specific information...
Read more »
Tags: csvsql, database, man, manual, perl
Posted in csvsql | No Comments »
About CsvSQL Csvsql is a project I started for my BSc’s final year software project. It is written in Perl and can be used to access information in csv files in the same way you would access a table in a database. This means you can use SQL queries, with each common seperated value...
Read more »
Tags: csv, csvsql, database, perl
Posted in csvsql | No Comments »
Printing A String Printing a string in Perl couldn’t be easier, you simply use the print function. If you want to print a line in Perl you simple need to write the following: print "Hello World!"; Output: Hello World! Similarly you you print a variable as follows: my $string = "Hello World!"; print $string;...
Read more »
Tags: hello world, perl, print, printing, string
Posted in perl | No Comments »
Opening a file eading from a file in Perl is pretty simple. After all, the language is pretty much built around dealing with text. The first step is to open the file, in which case you just need to use the following: open(INFILE,"< myfile.txt") or die "Can't open file: $!"; In this statement we...
Read more »
Tags: files, perl, reading
Posted in perl | No Comments »
For loop The below will print “Hello!” 10 times: for ($i = 0; $i < 10 ; $i++){ print "Hello!\n"; } Output: Hello! Foreach loop For iterating through an array it can be handy to use a foreach loop. In the example below the foreach loop will access each variables in the array and...
Read more »
Tags: arrays, for, foreach, loops, perl
Posted in perl | No Comments »