Hacks and ... Well, Hacks

Over the years I've hacked together various small bits of software that do things I want. Some of the programs (mostly the shell scripts) are my own creations, others are derivative of things written by others. The comments in the programs give credit where it's due. As time permits I'll update with the various things not yet listed.


stockWorth.pl is a perl script originally written by Jamie Zawinski. Its purpose then and now is to helpfully let you know why you should not tell your employer to get bent (or if your stock is in the tank it will helpfully ask why you're still there). It is currently used as a CGI for my home page (e.g. the page that's loaded by default when I open a browser window). It was most recently updated by Paul Telford on Nov 9, 2011. Its output looks something like this (except better formatted):
Today's AOL price is $31.65 (0.48)

Strike Total % Total Unsold Unsold Unvested Total
Price	Shares Vested Vested Vested $ $ Unsold $
------ ------ -------- -------- ------- ---------- ---------- ---------- 
$ 40.00 1,000 94.5% 945 945 $ -7,890 $ -459 $ -8,350
$ 71.41 4,000 50.0% 2,000 2,000 $ -79,520 $ -79,520 $-159,040
$ 85.00 1,000 29.6% 296 296 $ -15,791 $ -37,558 $ -53,350
$ 60.00 100 66.8% 66 26 $ -737 $ -963 $ -1,701
------ ------ -------- -------- ------- ---------- ---------- ---------- 
6,100 54.2% 3,307 3,267 $ 0 $ 0 $ 0

Your options are all worthless. Your soul has no value.
AOL's price needs to go up at least $8.36 ($40.01) to give your soul value.
Why are you still here little pawn?


sigselect is a simple shell script that selects a signature from a directory. There are much better ways of solving this problem. Sadly I'm too lazy to implement one of them.
I have a watchdog script that runs every ten minutes (via cron) to see if sigselect is running. I point my mail program to .signature.

Making TiVo Big

Once you accept that the Idiot Box is going to be a part of your life, you start to enjoy things that make the experience better. TiVo lets you do that, and TiVo also appeals to the geek in all of us. This is how I upgraded my TiVo from 35 hours of recording to to 108.

CVS Automagic Doc Tree Updates

I ended up with the task of maintaining a doc root for a group of individuals of varying technical aptitude. Some of these people need to be able to directly modify the doc root via SMB mounts, some via NFS mounts, some via FTP or HTTP publishing, and then the rest of us want to use CVS. I have this shell script run every five minutes by cron to pull any changes from CVS into the local tree. The script also lets me know (via a HTML report) what local doc root docs need to be checked back into CVS.

findCompressed NSAPI

For all the cool things the Netscape Enterprise Server does, one thing it doesn't do is allow a function to compress output on the fly. This NSAPI is a brute force hack that works around this problem by checking for compressed forms of requested files (e.g. send foobar.html.gz when foobar.html is requested).
I should point out that this is not owned by me - it's owned by my employer. Since it's included in source form as an NSAPI example with the Netscape Enterprise Server I don't think anyone will care that I've reproduced it here.


This script grabs a raw JPEG image. It extracts the image, slaps a time stamp and vanity plate (and possibly a vacation message) onto it, then saves the image at two resolutions.
This whole kludge started life as Yet Another JWZ Hack.

Expires HTTP header NSAPI

This NSAPI allows an administrator to set arbitrary Expires headers as offsets from NOW (the administrator can specify offsets in the past or the future).

Using PHP with the Sun Java System Web Server

PHP is kinda cool. For some reason most people think it doesn't work with the Web Server I work on. This annoys me. This document explains the three common ways to make PHP work with the Sun Java System Web Server | Sun ONE Web Server | iPlanet Web Server | Netscape Enterprise Server.

Disclaimer: My text. Not your text. This text sprang forth between 2001 and 2003. It is therefore copyright © 2001, 2002 and 2003 DzM. So there.