reverse engineered

sudo !!

sudo is a method of executing programs on a Linux/Unix machine with the permissions of a different user (usually root). sudo enabled systems generally have the root account disabled, which means it is easy to forget to elevate the privileges of root programs. sudo !! solves this by executing the previous command with root privileges. This doesn’t make much difference for short commands such as shutdown, but for longer commands, this can save a few seconds. Read more →

Rsync USB backup

Rsync is a simple tool for synchronizing two directories while minimising data transfer by only transferring the differences. I use the following script to automatically sync the files on my USB drive to my home directory on a remote server and then safely remove the drive. The files are transferred over SSH, and so the entire transfer is secure. I also use public key authentication to ensure I do not require a password to log into remotehost. Read more →

Linux NetBIOS Lookup

To enable NetBIOS name lookup in Linux, simply edit /etc/nsswitch.conf and add wins to the hosts line. Before: hosts: files dns After: hosts: files dns wins Then install the winbind package. sudo apt-get install winbind You should now be able to address other machines on your LAN by their hostnames. Before: user@host:$ ping otherhost ping: unknown host otherhost After: user@host:$ ping otherhost PING otherhost ( 56(84) bytes of data. 64 bytes from otherhost. Read more →

PHP Scripts

Below is a zip file of various PHP scripts that I had written a long time ago. I found them again recently and decided to publish them in the hope that they might be of some use to somebody. There is very little documentation throughout the code, but most are only a few lines long so they are pretty self explanatory. I’m pretty sure most are horribly inefficient. I didn’t really know much about that when writing them. Read more →