How to Run Hamachi on Leopard

A while back I detailed how to get Hamachi VPN running on Mac OS X, but times have changed, so here’s how to go about it under Leopard. Again, it’s a bit tricky, involving some Terminal work, but it’s pretty straightforward as far as command-line software goes.

Download and Install Tun/Tap

Hamachi for Mac OS X depends on some other tunneling software, a Tun/Tap kernel extension which does the low-level work. Download the latest Tun/Tap package and install it.

Download and Install Hamachi

Next, download the latest Hamachi for Mac OS X. Installation is a bit more complicated than the Tun/Tap drivers. Unzip the archive, and open up a Terminal window, and type “cd”, followed by a space. Don’t press Return just yet… Instead, drop the Hamachi folder right into the Terminal window, which will insert the path to that folder after the prefix you just typed: cd /Users/you/Downloads/hamachi- Press Return, and the Terminal’s new working directory will be the Hamachi folder — this is just a quick drag-and-drop shortcut to avoid typing out the path to a folder you already have available.

Once in the Hamachi folder, type sudo ./install. Enter your administrator password to perform the install.

Hamachi should now be installed, and you can initialize it for the first time by typing hamachi-init. This will generate public and private encryption keys in your Home folder, under .hamachi/ (the initial dot makes the folder hidden in regular Finder windows).

With both set-ups out of the way, it’s time to start using Hamachi!

Run Hamachi

Configure Tun/Tap by typing sudo ./usr/sbin/tuncfg

Start up Hamachi by typing hamachi start followed by hamachi login.

At this point, you should be connected to the Hamachi service, but without a VPN for your computers to join. If you already have a network, or plan to join a trusted friend’s network, you can easily join it by typing: hamachi join SomeNetwork.

Most likely, though, you’ll need to create your own network: hamachi create MyNetwork

Now you should have a virtual network in place and can go online hamachi go-online MyNetwork.

To see other parties on the network, run hamachi list

If other computers are online, you’re ready to connect to them with any higher-level software like iChat via Bonjour, the Finder’s “Connect to Server” command, Safari, etc.

To log out of Hamachi and shut down VPN connections, type hamachi stop

For more information about how to use Hamachi, you can view its manual by typing code>hamachi -h

How to Run Hamachi on Leopard

Coda 1.5

Coda iconThe developers at Panic have been very busy for the last several months preparing a major update for their one-window web development app (covered earlier), Coda, and have finally delivered. Coda 1.5 brings tons of new features like multi-file search, customizable books, “reverse publish”, and more, but the one that really takes the cake is full Subversion support. None of that bolted-on nonsense, either — Panic went out of their way to carefully weave Subversion into the interface, presenting commands as needed. The update is also free for registered owners.

If Coda is your primary tool for web development, and you already use Subversion, you’re most likely aware of Versions and Cornerstone, but now you can toss both of those apps and have your source code management built right into your leafy-green development environment. And, after reading how to go about setting up Subversion on MediaTemple, your Mac web development paradise should be complete, ready to start developing all those killer web apps you’ve been pondering. Check out Coda and get coding!

Coda 1.5

iPhoto Billing Information Error

While trying to order some prints from Kodak/Apple via iPhoto yesterday, I repeatedly got the pseudo-error message:

“Please review your billing information and approve it.”

After checking out my billing information twice, and still getting that error, I found the answer on an Apple Discussions thread: Make sure your credit card verification code is entered in the Account Information screen. Why iPhoto doesn’t highlight or complain about the missing required field is beyond me, but overlooking this tiny field causes problems that hardly indicate their source.

iPhoto Billing Information Error

How to Set Up Multiple Subversion Repos on MediaTemple

I’ve been busy lately with lots of side projects (including the new theme surrounding this post), and one key tool that helps keep my work organized and sane is Subversion. A while back, I discovered that my web host of choice, MediaTemple offers two ways to host Subversion repos for your own usage alongside regular web hosting: you can make use of a single Apache webserver driven Subversion repository, or configure full-blown Subversion over secure SSH tunneling. Here’s how to get the latter up and running, complete with a hosted checkout of your work that auto-updates after your commit.

Enable SSH Access

By default, SSH remoting is disabled on MediaTemple accounts, requiring you to explicitly enable it in the Server Administrator control panel section for your primary domain:

Once there, set SSH on “Enabled”, and save your changes. MediaTemple’s easy-to-use configuration tool couldn’t make this step any simpler.

Connecting and Creating a Repository

Fire up Terminal in your Applications/Utilities folder under Mac OS X, or grab the latest version PuTTY under Windows, and connect to your MediaTemple host as For example, if your site were, you would connect as follows:


The domain “” is in there twice, first because it’s part of your full username, and second to point SSH at the right server. (If your SSH client complains about not being able to connect, you can try replacing the first @ sign with its encoded version, “%25”.) Type “yes” to confirm adding to your known_hosts, if asked, then enter your administrator password to finish logging in.

Enter the following commands to switch to your “data” directory (provided by MediaTemple), and create a basic repository for your code/information:

Change directory (cd) to your data directory:
cd ../../data/

Create a “repos” directory to hold one or more repositories:
mkdir repos

Change directory to the folder you made in the previous step:
cd repos

Create a repository (replace “tests” with your desired repository name, using underscores for spaces). Letter case is important, so if you capitalize any part of the name now, you’ll have to capitalize it later when using it. The bit about “fsfs” is to use a specific Subversion database type recommended by MediaTemple — it’s the default type for newer versions of Subversion, but it’s best to put it just to be safe.

svnadmin create tests --fs-type fsfs

You can repeat this to create as many repositories as you wish inside the “repos” folder.

Log out of MediaTemple:


Checking Out Your Repository

On your local computer (not on MediaTemple), decide where you want to keep your repositories. I recommend someplace easy to get to like /workingcopies/, but a repo can go anywhere you prefer. Check out a copy of the repo you just made:

svn checkout svn+ssh:// /workingcopies/tests

Be sure to replace “1234” with your four-digit MediaTemple server ID number that can be found in your Service Activation email.

To verify everything drop a simple file into your new repository folder at /workingcopies/tests, such as test.txt, and do:

svn add test.txt followed by svn commit -m "Adding test file."

Auto-updating MediaTemple

If you have some code stored in a repository that you’d like to automatically be made available to the world, such as a WordPress theme or web application, Subversion provides various “hooks” that can be run at times like pre-commit, post-commit, etc. Subversion hooks are nothing more than scripts which you define, and get run when the applicable action occurs. Here’s how to set up an automatically updating WordPress theme repository:

Connect to MediaTemple again, using the initial ssh command at the start of this tutorial, then change directory to where you want to use this repository on your MediaTemple server:

cd ../../domains/

Check out a copy of your repository elsewhere on your server, using file:// instead of svn+ssh://

svn checkout file:///home/1234/data/repos/tests tests

Again, replace “1234” with your server ID, and also replace “tests” with your repository name (in both places). Now you have a copy of that repository on your server. Edit the hook so it gets updated automatically when you commit changes:

cd ../../data/repos/tests/hooks

Make a copy of the post-commit hook example:

cp post-commit.tmpl post-commit

Use your favorite command-line text editor the post-commit script:

nano -w post-commit

Change the entire script (below #!/bin/sh) to:

svn update /home/1234/domains/

Exit, saving changes, with Control-x, y, Enter.

Make your post-commit script executable:

chmod +x post-commit

Finally, log out of MediaTemple again:


Now, after a commit, Subversion will automatically update the repo you have checked out on your server, and your changes should be reflected almost instantly.

There’s a lot more to using Subversion, so here are some hand-picked resources to keep you going:


How to Set Up Multiple Subversion Repos on MediaTemple

MacBook Pro Insomnia

For the past several weeks, my MacBook Pro had been occasionally waking up during periods where it was expected to be in sleep mode. Even with the lid closed, it would briefly wake up, illuminate the screen and Apple logo, then fall back asleep moments later. Seemingly random, it would sometimes happen only once every other day, and other times it would happen sequentially with only seconds in between cycles. I had no idea if the issue was hardware or software, but it didn’t seem major enough to warrant an AppleCare call.

A quick trip to the Console application in the Applications > Utilities folder reported dozens of instances of “USB caused wake event (EHCI)”, which gave me some initial Google hits. The obvious answer is that a USB device was waking up the computer, however I rarely had USB hardware plugged in when the random awakenings were occurring.

As it turns out, others have had this problem before. As indicated in the previous links, Mac OS X keeps its power schedule inside /Library/Preferences/SystemConfiguration/, but this file didn’t exist for me, apparently “confusing” Mac OS X. Without it, it would exhibit the symptoms I was encountering.

Following suggestions, I opened System Preferences > Energy Saver > Schedule, where you can schedule system sleeps and wakes. By toggling on a scheduled wake, clicking OK, then disabling it, the was re-created, and left with no scheduled sleeps or wakes. So far, this has cured my MacBook Pro’s insomnia!

MacBook Pro Insomnia

Delivery Status Widget

Delivery StatusI don’t use the Dashboard in Mac OS X as much as I expected to when it was first released, but when I do, one of the few widgets I employ is Delivery Status, which keeps track of packages during shipment. Big, bold numbers display the days until delivery, and smaller text reports on various stops throughout the package’s voyage. With support for over 30 carriers, including all of the most common here in the U.S., Delivery Status conveys what you need to know at a glance, making it an ideal Dashboard widget. Also in the works is an iPhone/iPod Touch application serving the same purpose with an interface optimized for touchscreen devices.

Delivery Status Widget

How to Combine ICO Files into a Windows EXE

Lately I’ve been working with Mozilla’s XUL platform under xulrunner, and found that I needed to make a properly branded Windows application, but had no tools or knowledge on how to “glue” standard .ico icon files together, or insert them into an already-compiled .exe file. After some research and a little trial and error, I found a method that works. Assuming you have some prepared 16, 24, 32, and 48 pixel images suitable for an icon set, here’s how to go about getting them from Photoshop into a Windows application, using only free software.

Photoshop to Multiple .ico Files

The first step to branding a generic executable with your own icons is to get them out of the graphics program and into .ico format, which is the standard for Windows software icons and cursors. IcoFormat, a free Photoshop import/export plugin for handling .ico files, will easily handle the task. Once installed to your Photoshop plugins folder (and Photoshop subsequently restarted), you can save each of your icons as a .ico file using “Save As…”, and choosing ICO from the Format menu in the resulting dialog. Repeat for each icon size you wish to embed (or, if you’re ambitious, try recording a Photoshop action to automate the process).

Multiple .ico Files to One .ico File

To allow Windows to display the best size icon for the current folder view, it’s best to combine the desired .ico files into a single file. The free Icollator program will take in multiple icons and produce a single .ico file ready for embedding. You may need the Java Runtime Environment to run Icollator, if you don’t already have it. Like Icollator, JRE is also free download.

Embed the .ico File

The last step is to embed the single .ico file (containing two or more icons) into the .exe. Launch the freeware Resource Hacker utility, and Open the target .exe. Then select Action -> “Add a new Resource…”, and pick the combined .ico file you made in the previous step. Give the resource a simple name like “ICONS”, and click Add Resource. Save the changes to the .exe, and switch to Windows Explorer. You’ll notice that the .exe now has the embedded icon set, and Windows will show the correct size icon for the current view mode. Also, you’ll notice that Resource Hacker made a backup of the .exe before embedding, just for safe keeping.

Also potentially of interest: Getting application name and icon right with XULRunner from the AdBlock Plus blog

How to Combine ICO Files into a Windows EXE