Decommissioning of LFS2 Mac OS X Server after 4.5 years

After four and a half years, I am turning LFS2 off for good.

According to the “/var/log/OSInstall.custom” log, “Native install completed 2005-08-14 18:55:58 -0700,” which is just under four and a half years ago. I have finally migrated all of the data and functionality (print, file, and LDAP) from Lund File Server 2 (LFS2) to Athos. LFS2 held up surprisingly well considering it was only a 533 MHz G4 with 768 MB RAM. When I set it up, I installed three used 120 GB Western Digital hard drives. After four and a half years of running continuously, all three drives still appear operational.

ZigVersion

I prefer to do all of my Subversion work from the command line, but I realize that not all people are like me. Clarissa and I have been using a wiki to keep track of most of our shared information (including our wedding preparations), but our wiki does not work well for content like spreadsheets. Therefore, I decided to try out a Subversion repository. After some initial searching for graphical clients, I found ZigVersion. It is a simple graphical Subversion client for Mac OS X. It took a little bit to explain how it worked and how to use it to Clarissa, but now we have been sharing and editing non-wiki-friendly files for a few weeks.

PDF to PNG Conversion on Mac OS X

I had a several page scanned document stored in PDF format that I needed to convert to PNG so I could upload it to a PayPal account to resolve a limited access problem. I found several solutions for Linux that produced inadequate image files. When I switched to my Mac OS X laptop, I opened the PDF in Preview. I selected “Save As…” from the File menu, selected “PNG” from the drop down menu and set the resolution to 300 pixels per inch. I hit the Save button, and the newly created PNG opened up. The quality was adequate, and the problem was solved.

eBooks on BlackBerry

Up until recently, I have read most of my novels and books on a Palm TX handheld using TextDrive. I used PorDiBle to convert text files into PDB files that TextDrive could read.

This method worked much better when I always carried my Palm handheld with me and used it as my primary calendar and contact management device. The appeal of electronic books is that I always have it with me. Once I started using my BlackBerry to maintain everything, my Palm fell into disuse, and I no longer carried it with me. I started reading less. I needed a new solution.

I have started using Mobipocket on my BlackBerry and Stanza to convert texts. Mobipocket has a whole online store for purchasing texts, but the reader itself is free and can read non-purchased texts that I already have. Stanza can convert between plain text and the Mobipocket format. Unfortunately, Stanza is only available for Mac OS X and Windows. There are other options, but Stanza worked best.

Now I once again always carry the device with my current novel, and I can spend my free time reading instead of playing games on my BlackBerry.

BlackBerry Bold Tethering on Mac OS X

This forum post at BlackBerryForums.com has all of the details necessary to set up tethering for a BlackBerry Bold on Mac OS X.

I set up tethering quite a while ago. I then updated my Bold firmware not realizing that it would break tethering. After some digging, I found that the solution is to install the BlackBerry Bold PPPD Replacement. This solution is mentioned on the last page of the same BlackBerryForums.com post and also on this CrackBerry.com forum post.

Now tethering works correctly again, and I still have the benefits of the upgraded firmware on my Bold.

Update: BlackBerryForums.com has removed the old post for tethering on Mac OS X. This post appears to be a suitable replacement, but I have not tried these exact instructions.

OpenVPN on Mac OS X

I have been using Tunnelblick to connect to the VPN I have configured on my Linksys WRT54GL router running DD-WRT. DD-WRT provides several different tutorials for configuring OpenVPN on your router. Tunnelblick works fairly well on my laptop running Mac OS X most of the time, but every now and then I have had issues connecting. Therefore, I decided to investigate alternatives.

I decided to try some variation of what was described in this post on Tony’s Cafe. The first step was to install the TunTap driver for Mac OS X. This provides the necessary network interfaces to connect to an OpenVPN. It appears that a reboot is no longer required. For command line simplicity and for scripting purposes, you can use the following to install the TunTap driver.

cd /tmp/
curl -O http://superb-east.dl.sourceforge.net/sourceforge/tuntaposx/tuntap_20080804.tar.gz
tar xzvf tuntap_20080804.tar.gz
installer -verbose -pkg tuntap_20080804.pkg -target /
rm -Rf tuntap*

The post on Tony’s Cafe then shows the steps necessary to build OpenVPN from source. You are welcome to do this and you can check it out in the post. However, the simply way is to make use the openvpn binary inside of the Tunnelblick application package. I simply copied it out of the .app and into /usr/sbin. The following again automates the entire process for installing the openvpn binary.

cd /tmp/
curl -O http://tunnelblick.googlecode.com/files/Tunnelblick_3.0b10.dmg
hdiutil attach Tunnelblick_3.0b10.dmg
cp /Volumes/Tunnelblick/Tunnelblick.app/Contents/Resources/openvpn \
    /usr/sbin/openvpn
hdiutil detach $( df | grep Tunnelblick | awk '{print $1}' )
rm -Rf Tunnelblick*

I then created a new OpenVPN configuration file using the example provided in the referenced Tony’s Cafe post. The example I used is provided below.

client
dev tap0
# In the next line, specify the IP address and subnet mask of the tap0 device
ifconfig [IP Address] [Subnet Mask]
proto udp
remote [OpenVPN Server DNS Address] [port]
resolv-retry infinite
# Downgrade privileges after initialization (non-Windows only)
user nobody
group nobody
persist-key
persist-tun
;http-proxy-retry # retry on connection failures
;http-proxy [proxy server] [proxy port #]
mute-replay-warnings
# If using SSL Certificates, use the following 3 lines:
ca /etc/openvpn/ca.crt
cert /etc/openvpn/client.crt
key /etc/openvpn/client.key
# If using a SSL static key, use the following line:
secret “/etc/openvpn/vpn.key”
# Use the next line if utilizing LZO compression:
comp-lzo
verb 3
mute 20

I then plugged in the host to connect to, the IP address and subnet mask for my laptop to use while it is on the road, and the path to the certificates and keys stored on my machine. All that was left was to launch OpenVPN from the command line:

/usr/local/sbin/openvpn --config /path/to/openvpn.conf

I haven’t used this new method of connecting to my VPN extensively; however, so far it appears to be working well.

The Typical Vim Reaction

Every now and then I feel permitted to go on a rant. It’s unfortunate because this isn’t even a particularly good rant. Why do so many of my (instant messaging) conversations with others about Vim look like this?

Chris: do you use an IDE?
Chris: and if so which one?
Zachary: um, I generally use vim:-P
Chris: gah

Vim is a great text editor. It’s a step up from Ed which is the standard text editor. I started using Vim five years ago. That was about the time that I discovered secure shell, and I started administering servers and other computers remotely. It turns out that Vim was the best text editor over a secure shell session, and since most of my machines ran Mac OS X at the time, Emacs was a terrible option. (I’m not really sure what you call Emacs on Mac OS X. You probably shouldnt’ call it Emacs.) I limped along using very basic Vim functionality over secure shell for a while. Then I discovered a useful graphical tutorial for Vim, and it became considerably more useful.

Now I use Vim because every other text editor or word processor is slower and requires the use of a mouse. (Gah!) I write most of my documents in LaTeX using Vim. I read my email in Mutt and compose emails in Vim. I use Vim almost exclusively to edit code and configuration files on my workstations and servers which works well because it does a good job of syntax highlighting and smart indentation.

A few years ago, I wouldn’t have thought I’d be using Vim exclusively, and it was somewhat by accident that I switched, but now that I am using it, I would be unable to go back.

Install Flash on Mac OS X from the command line

My mother needed the latest version of Flash to view a web page. I decided this was a good opportunity to install the package from the command line over secure shell. She has a PowerMac G4 running Mac OS X 10.4. It turns out that the update didn’t work, but I relearned a bit about some useful command line tools for Mac OS X. I always start in the temp directory. Then I downloaded the installer and unzipped it. That’s all pretty straightforward.

cd /tmp/
curl -O http://fpdownload.macromedia.com/get/flashplayer/current/install_flash_player_osx_ub.dmg.zip
unzip install_flash_player_osx_ub.dmg.zip

Next, I used “hdiutil” to mount the disk image and then changed to that directory.

hdiutil attach Install\ Flash\ Player\ 10\ UB.dmg
cd /Volumes/Install\ Flash\ Player\ 10\ UB/

Then I used “installer” to install the package specifying the package with “-pkg Adobe\ Flash\ Player.pkg” and the target volume with “-target /”.

installer -verbose -pkg Adobe\ Flash\ Player.pkg -target /

It will run through the installation and output some information. After that, I changed back to the temp directory. I initially tried using “umount” to unmount the disk image, but that is a bad idea because it doesn’t fully unmount the image. The better approach is to use the “hdiutil” again. I find the volume to unmount by using the “df” command. Once it is unmounted, I deleted the zip file and the disk image.

cd /tmp/
hdiutil detach $(df | grep Flash | awk '{print $1}')
rm install_flash_player_osx_ub.dmg.zip
rm Install\ Flash\ Player\ 10\ UB.dmg

Most applications for Mac OS X come in disk images, and many of those have package installers. This is a quick way to install software on a remote Macintosh or a way to automate installations with scripts.