Code Samples
The following code samples have been provided for potential employers to assess my programming capabilities before hiring me (to provide more than just a line item on a resume!). Because programming is an integral aspect of UNIX Systems Administration, these code samples should help you to determine if I am a good candidate for employment within your organization.
I believe it is essential to have a readable code style. If, whilst browsing these pages, you find that any of these samples are not readable (and you know the language or tool) then you probably should not hire me! I would appreciate an email in that case; criticism is always welcome!!
Browse the source below:
- mkrules.sh
Script which generates Linux Firewall, Traffic Control and Multicast Tunneling rules. Used for a hypothetical site gateway supporting Quality of Service applications (i.e. VOIP, Video and Data) over IPSEC tunnels. A variation of this script has been used for some clients with great success.
- shlib/
Library of Bourne Shell utility and other routines. Rather than code these over and over again I have over time amassed a collection of shell functions that I use very frequently. All code need only source a single file to bring in the capability, and subsequent utility categories are then brought in with "include" or "require" keywords. This has proven highly useful over the years.
- dirweb/
Web application that provides an interface to user and group settings stored in LDAP. Allows users to change their own spam, email, and informational settings without requiring administrative intervention. Groups can be created, modified and deleted, allowing owners to maintain distribution list memberships and make changes to access rules in the source code repository themselves.
- libdbllist/
Library that implements all the usual storage methods one would expect to find in a container API. The data structure used for storage is the doubly linked list. I use this in most of my programs that require simple in-core data storage, and have also implemented serializers to save the data to backing store.
- pcng-srs.diff
Patch to PloneCollectorNG (now defunct) to make into a "real" IT ticketing tool. Fixes bugs, adds better email support, and makes tons of local modifications to implement a "Service Request System" appropriate for a technical support and/or IT organization. I'd probably use Roundup for this nowadays.
- cvs-permfix/
Code written to run on CVS commit and tag operations which maintains POSIX ACLs. Works on any modified files and directories. Authentication can then occur via the PAM library using a hacked CVS. The combination allows LDAP group membership to control fine-grained source code access rights. Of course, everyone that used to use CVS now uses Subversion, but it's still a good code sample.
- alist2ltx.awk
Converts ASCII bulletted lists to LaTeX format. Since I am an 80-column ASCII fanatic I found this useful as part of a Make subsystem I wrote to pretty-render ASCII letters into professional looking PDFs.
- pla-dirweb.diff
Patch to make PhpLdapAdmin into a directory interface tool suitable for users. Hacks PhpLdapAdmin sufficiently to replace my dirweb tool, also found here among the code examples. The use of a pre-existing tool with a development community is almost always a better option than using one's own tool...
- check_hlt.c
Code to query a machine room thermometer via RS-232. This was used to support the Hot Little Therm device in the Netsaint (now Nagios) network monitoring tool (and uses its plugin API).
- libcommand/
Library that implements a simple command line interface for applications to use. The applications can use words or characters, and there is a simple completion mechanism. The user programs provide the callbacks implementing the application commmands.
- qmail-monitor.diff
Patch to the qmail distribution which adds a daemon to the running suite on an MTA node to transparently archive the header of all emails. This is implemented completely out-of-band with respect to the "real" mail flow. Originally implemented to satisfy a legal requirement. Probably better ways to do this now (like using Postfix).
- options.c
Option parsing library. Deals with default options, configuration files, and command line options. It's specific to a particular program I use to manage VTs.
- kayako-ldap.diff
Patch to the popular Kayako support tool to enable LDAP integration. Enables the use of LDAP to authenticate logins to the support site, through a login page which does an LDAP bind and maintains a session credential. The author has implemented his own support since this patch was written.
- gencallgraph.sh
Script to generate a call graph for a tree of shell function source files. I used this to figure out how to order the sourcing of my bourne shell initialization files, which had grown to almost 50 separate files. I have since ditched this all in favor of building a full inclusion subsystem, but it's a good example of how I write shell code...
- ticketstats.pl
Primitive SQL data extraction and report generator. Queries a database and generates reports for on an in-house trouble ticketing system used by a customer long ago.
- chpass.php
Simple web interface to change passwords. Allows users to change LDAP, NIS, or NT passwords using a single form. This was written quite a while ago...
- dialin.pl
Writes a report from NT RAS server logs. Simple report generated is a text file with various statistics on dialup and VPN users. This was used to LART users that wanted to sit idle on an 800 number dialup.