Home | About Me | Photos | Writing | Research | Scratchpad | Projects

Random useful code

Sometimes I write a little script that I find rather funky...

A SpamBot trap (source code)
This little script was originally written to find and trick web robots harvesting email addresses (to give to spammers), but has since turned into an interesting database of web robots visiting my pages.

Prename (download | source code)
A little Perl script that makes renaming lots of files in one go a little easier. You just supply a regexp and the files, and it does the work.
E.g. prename s/AVI/avi/ *.AVI   will rename all files ending in .AVI to end in .avi

Canon-vid (download | source code)
A little Python script that goes through videos downloaded off Canon digital cameras (in the current working directory) and re-encodes them to divx mp3lame AVIs. Rename movies to *.AVI_R to have them rotated. Tested with the Canon Powershot A40.

Portscan (download | source code)
A little Python script that asks for an IP or hostname and a range of ports, and then scans them to see if they are open. There are lots of these around, but I rather like the user interface for mine, as it gives feedback on which port it is scanning as it goes.