Hobby code

These are projects I worked on for free, in my spare time.

AOL Instant Messenger in TOC

I used some old documentation and some reverse engineering to create a PHP-based AOL instant messenger script for the original TOC protocol. When I showed it to Andrew Heebner (formerly of evilwalrus.com), he added some TOC2 (a revision of the original TOC protocol) functionality and lots of documentation. He called it TAC and we agreed on making it available on the internet under the Artistic License. It was created for beta versions of PHP5.

I also made some of the original TOC1-only script available, as a PHP4 class named AOL_TOC, which is copyrighted by me. It requires PEAR and it's only been tried with PEAR < 1.4.0.

AttachmentSize
TAC.zip70.44 KB
AOL_TOC.zip13.16 KB

Kernel.org network utilization graph copy

This is a PHP implementation of the old network utilization bar on kernel.org. It measures outgoing bandwidth on a /proc based operating system, like Linux.

Change configuration information in daemon.php. Then you might want to move daemon.php to a different directory because it must run all the time to poll the network services. Everything else should work fine if you have GD installed with PHP. Invoke daemon.php like this:

php -q daemon.php &

Be sure to run daemon.php as a user that has permission to write to the netload.inc file.

AttachmentSize
phpnetbar.zip3.19 KB

Lame-O-Nickometer

I made this one night in ##php on Freenode because Philip kept looking up peoples' IRC nicks on a Perl script for a lameness score. Many of the people had especially lame nicks like _-|Sc0rPi0n|-_. I figured why let Perl do all the work when PHP can, so I made the PHP Lame-o-Nickometer.

Also implemented as a Drupal module.

AttachmentSize
nickometer.zip2.9 KB

PHP CPU bar for /proc systems

This is a /proc based CPU utilization script. It is based off the phpcpubar script found on Freshmeat, but I didn't like that it had to use an external C program to get the CPU stats, so I did it in PHP. It doesn't do an instant measure. It's an average over time. There's not really much documentation.

AttachmentSize
phpcpubar.zip1.56 KB

Student housing network access control

This was meant to be a signup form using a command-line program called arping and a ISC dhcpd.leases file on an OpenBSD 3.2 server for authenticating students' computers by MAC address in campus/student housing. Priorities changed and the signup form was postponed indefinitely.

Arping is a program that works with ARP packets on a network to identify the MAC address of an IP. Right now the script essentially parses the dhcpd.leases file to get a MAC address to compare to the arping results. Both would have to match to authenticate the user and put them in the system to have their Cisco switch port activated.

AttachmentSize
arping.zip3.6 KB

Unclog

When the Code Red and Nimda worms were popular on the internet, trying to read my Apache logs was a frustrating process. I created a script to filter the worm attacks out of my Apache logs. When I submitted it to Freshmeat, they rejected it, because it's a small script.

AttachmentSize
unclog.zip1.96 KB

advogato_import Drupal module

I created a Drupal module to import diary entries to a Drupal 4.6.3 website. It uses Advogato's XMLRPC interface to download a specified user's diary entries to a Drupal blog, page, or story module during regular cron jobs. Trying to import over ~20 diary entries at a time can timeout during a regular cron job, even on a fast server, with a big pipe. The unlimited import setting is only intended if you run the cron.php file from a command prompt, in shell script form, rather than as a web file through the documentation recommended wget or lynx initiated cron jobs.

Using the XMLRPC interface turned out to be much easier than figuring out how to account for every little exception when trying to extract from the /person/user/diary.xml XML file. I'm licensing it under the Artistic License, which is under some debate as to whether it is compatible with Drupal's GPL licensing. In either case, non-GPL licenses are generally not welcome in Drupal as a result of some very vocal contributors.

AttachmentSize
advogato_import-4.6.3.tar.gz3.56 KB

urllist for Drupal

This module creates a callback for generating a list of URLs to be submitted to search engines like Yahoo's Submit Your Site at /q=urllist or /urllist with clean URLs. Google has a separate gsitemap module from the Google Summer of Code 2005. Right now urllist only has a basic support to list every published node and log accesses (if the administrator turns logging on).

As soon as I submitted a urllist to Yahoo, I got a hit to load it with a User Agent of "Mozilla/4.05 [en]" from 216.155.200.103. The IP is owned by Yahoo, so I thought it would be interesting to point out the initial hit doesn't appear to come from a User Agent with "Yahoo" in the name.

Potential future features are gz output, turning off certain node types in the list, and the option to override specific nodes being listed. For now, if you use this module, and want to override a specific node, you'd have to use robots.txt to make an exclusion.

Find the urllist module home on drupal.org.