My blog has moved!

You should be automatically redirected in 6 seconds. If not, visit
http://taylor.braun-jones.com/blog/
and update your bookmarks.

Short DHCP Lease Times

If you are an Ubuntu user who has experienced WiFi disconnects from public hot spots while other Windows and Mac users around you are Web browsing worry free you're not the only one. In this particular case, however, the fix may be quite easy.

The symptoms my wife experienced were that she could connect to the USC wireless network and happily surf the internet for about an hour before being booted off and not being able to reconnect for a period of about 24-hours. Turns out, according to USC IT department, that defaut DHCP lease time in Ubuntu is shorter than that on Windows and Mac OS. This exceeded whatever arbitrary DHCP renewal rate threshold USC has configured and caused her MAC address to be blacklisted for a day. Here's the fix:

Edit /etc/dhcp3/dhclient.conf as root with the following command (Tip: Use Alt-F2):
gksu gedit /etc/dhcp3/dhclient.conf
Change the DHCP lease time by editing the following option (or adding it if it does not already exist)
option dhcp-lease-time 86399;
That sets the lease time to be 86399 seconds – one second shy of a day.

Gmail Contacts... Almost Accessible

Google has provided interfaces to most of its services through standard protocols, which is great. I can access my Google Calendar events via a private iCal address (one-way only, Google to my local client). I can access my Gmail messages through POP or IMAP. I can import my OpenDocument files to Google Docs (even keep them synchronized as I work on them with the help of OpenOffice.org2GoogleDocs extension).

One gripe I've had since the beginning of Gmail is that I cannot access my Gmail contacts from any LDAP-supported address book — until GCALDaemon. It's a daemon that, among other things, translates LDAP requests from a local client (e.g. Mozilla Thunderbird) to gmail.com HTTP requests. A bonus feature for me (though this seems to actually be the main feature of GCALDaemon) is that I get two-way synchronization with my Google Calendar now too. GCALDaemon is available for Linux, OS X, and Windows, though the developers are obviously Windows centric — the Linux release comes as a zip file (no .deb, .rpm, or even tarball) and then you are instructed to add execute permissions the the shell scrips as part of the manual installation process! It also lacks an init script, so I wrote a simple one to get the job done (Assumes you unpacked the zip file to /opt):
#! /bin/sh
# /etc/init.d/GCALDaemon
#

# Carry out specific functions when asked to by the system
case "$1" in
start)
echo "Starting GCALDaemon ..."
start-stop-daemon --start --pidfile /var/run/GCALDaemon.pid \
--chuid nobody:nogroup --background --make-pidfile \
--exec /opt/GCALDaemon/bin/standalone-start.sh
;;
stop)
echo "Stopping GCALDaemon ..."
start-stop-daemon --stop --pidfile /var/run/GCALDaemon.pid --user nobody
;;
*)
echo "Usage: /etc/init.d/blah {start|stop}"
exit 1
;;
esac
for getting up and running quickly. So why are Gmail contacts only almost accessible? Only email addresses and phone numbers seem to supported by GCALDaemon, not postal addresses.

See also:
UPDATE (2008-11-14): I discovered Zindus and have been using it for a few weeks now. It's a more elegant solution, though they still need to figure out out a better solution for syncing postal addresses. The best solution is to simply standardize the way postal addresses are stored, IMO. Currently the Thunderbird address book keeps sepearate fields for Street, City, etc., whereas Google (and many others) store addressses as one big free-form field.

FInally, A Solid DVD-to-MPEG Converter

For some reason I never came across HandBrake until reading about it by chance on diveintomark.org. It's a CLI application that makes great use of two cores. With my dual-core opteron, top reports close to 200 percent CPU utilization. I don't think I've ever seen that from a single application before. It runs on Mac OS and Windows and there is even a Mono-based GUI for Linux called RippedWire, which I have yet to try out.

Typing Heaven

For my first Father's Day (woohoo!) I received a SpaceSaver keyboard from pckeyboard.com. It's essentially an old school Model M with a few modernizations:
I've considered buying a used Model M in the past, but was put off by the amount of desk space it eats up and its lack of a Super modifier key (which is useful for all kinds of shortcuts).

The only thing I would change about the SpaceSaver -- and this is fairly minor -- would be to add volume control keys above the number pad like on the recently deprecated Apple keyboard. Another idea I have brainstormed, but haven't though through completely, is to move/add a modifier key next to the number pad, ideally around the bottom left so that you can easily run two-key shortcuts with your right hand (thumb + index/middle/ring fingers).

Debian RC Script Control

As a former Gentoo user, I had to learn the Ubuntu/Debian way to add service to a system runlevel. For my desktop, I never had to worry about it because, as usual with Ubuntu, a nice GUI is provided to manage startup services (System -> Administration -> Services). However when installing pyscrabble-server on my closet server I had to lookup the CLI tool for the job. (Note that I could have just used X11 forwarding to run the GUI tool, but that is just not nearly as cool and would have required lots of unnecessary GUI packages) It its simplest form, the comand to automatically start and stop /etc/init.d/SERVICE at startup and shutdown is simply:

sudo update-rc.d SERVICE defaults

From the man page:

If defaults is used then update-rc.d will make links to start the service in runlevels 2345 and to stop the service in runlevels 016.
For anything more complex, see the man page. Note that Debian has good bash completion support for the update-rc.d command.

If you're adding your own home-brew service, you can always just add commands to /etc/rc.local and make that file executable.