ISC DHCPD status report generator

After setting up my apartment’s OpenBSD based network, I decided it would be handy to have a simple report generator to describe active DHCPD leases. I also wanted to brush up on Perl a bit. This Perl script is the natural result of such circumstances.

Run dhcpd-report.pl to generate a plaintext or HTML report of current leases in the DHCPD lease database and reservations in dhcpd.conf. In my usage, I have the script set to run once every five minutes in a cron job, sending output to an HTML file in a web server document root. (On OpenBSD, httpd runs in a chroot jail; if I were to run this script as CGI it wouldn’t have direct access to the DHCPD configuration files.) Thus the script can be used to give you a reasonably up to date web page displaying your network’s DHCP clients.

By default, the program looks for dhcpd.leases and dhcpd.conf in /var/db/ and /etc/, respectively, which are these files’ locations in OpenBSD 4.1. If needed, you can change where the script looks for these files by modifying a pair of constants near the top of the main program …

Read more…

Pale blue dot

I just found an excellent video mash-up of Carl Sagan’s narration of part of his book Pale Blue Dot, inspired by the famous Voyager 1 photograph of the Earth from halfway across our solar system:

Courtesy palebluefilms.com.

Exporting AddressBook birthdays to Remind

I always thought I was a bit of an oddball for choosing the ancient scheduler Remind as my favorite OS X calendar software. But as it turns out, I’m not quite as alone as I had assumed. I guess OS X is a bigger draw to Unix geeks than I realized.

So I’ve decided to publish a tool that I wrote a few months back, a simple little Objective-C command line application that reads the birthdays of all your OS X AddressBook contacts and outputs them in .reminders format.

The source code bundle is here. After installation, see the manpage remind_birthdays(1) for documentation.

You can also view the source code repository on Github.

halfdim

It seems to be a commonly experienced problem with the Intel rendition of OS X 10.4 that some power management settings, such as the halfdim pmset parameter (a.k.a., “automatically reduce the brightness of the display before display sleep”) may be reset when the system boots. Since I started dual-booting Vista my reboots have increased from about once a week to a few times a day, so I decided to tackle this annoying little bug with a StartupItem.

Here’s how to do it. First, make a directory named PMSetManager in /Library/StartupItems. Create two files in this new directory, StartupParameters.plist and PMSetManager, with the specified contents.

/Library/StartupItems/PMSetManager/StartupParameters.plist:

{
Description = "PMSetManager";
OrderPreference = "Late";
Provides = ("PMSetManager");
Message =
{
start = "Starting pmset manager";
stop = "Stopping pmset manager";
};
}

/Library/StartupItems/PMSetManager/PMSetManager:

#!/bin/sh
# pmset manager
#
# Resets the 'halfdim' pmset parameter to false
# on reboot, in order to counteract what appears
# to be a bug on OS X 10.4.
. /etc/rc.common
StartService ()
{
if [ "${PMSETMANAGER:=-NO-}" = "-YES-" ]
then
ConsoleMessage "Starting pmset manager"
pmset -a halfdim 0
fi
}
StopService ()
{
ConsoleMessage "Stopping pmset manager"
}
RestartService ()
{
StopService
StartService
}
RunService "$1"

(The pmset command in this script can do more than …

Read more…

Vista

The University’s software licensing program proudly furnishes UF engineering students with Microsoft’s latest-and-greatest (with the notable exception of cash cow Microsoft Office). As of Wednesday, latest-and-greatest meant Windows Vista Business Edition*, so I decided to download it and, with the help of Boot Camp, give it a run on my iMac. Here are my notes and impressions, in no particular order:

  • It’s faster than I expected. It takes almost twice as long as OS X to boot, but programs (subjectively) seem to start more quickly.
  • The new user interface is nice. I still prefer Exposé to Flip3D, but things such as real-time previews of taskbar items and a hardware-accelerated UI make this the first version of Windows that I actually feel comfortable while using.
  • User Account Control is a mess. Some operations, such as touching a file in C:\Program Files\, require you to confirm your intent twice – once for UAC, and once again for what appears to be some manifestation of Windows Security Center. Talk about the left hand not knowing what the right is doing.
  • AutoPlay finally asks for your confirmation before automatically executing whatever program or virus might be on that CD you just …

Read more…

Bill Amend is my hero

Thank you, Mr. Amend, for giving the dangers of electronic voting machines some much-needed press. The more people who are informed about such a frightening threat to our democratic process, the better.

In an attempt to convince a complacently skeptical public of just how much a problem that direct-recording electronic voting machines pose, Jon Stokes of Ars Technica has written a guide, How to steal an election by hacking the vote, which illustrates just how easy it is to hijack an election conducted entirely over electronic media.

If nothing else, watch this video by the security researchers at Princeton University’s Center for IT Policy, wherein researchers demonstrate how to load a malicious payload onto a Diebold voting machine in under one minute. Come election day, this payload, a computer virus which spreads to other machines through normal memory card exchange, silently skews the vote toward its preferred candidate; these alterations are made untraceable by the fact that these voting machines provide users with no voter-verifiable paper trail. Such a virus could even delete itself once the election has concluded, leaving behind no evidence within the machine itself.

In concluding his article, Mr. Stokes sums up the problem nicely:

  • Bits …

Read more…

Pagination