Archive for August, 2008

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 on 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-0.9.9.9-20-osxNow hit 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 ./installEnter your administrator password to perform the install.

Hamachi should now be installed, and you can initialize it for the first time by typing:
hamachi-initThis will generate public and private encryption keys in your Home folder, under “.hamachi/” (the inital . character makes the folder hidden from regular Finder views).

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 startFollowed 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 SomeNetworkReplacing “SomeNetwork” with the destination network name.

Most likely, though, you’ll need to create your own network:
hamachi create MyNetworkReplacing “MyNetwork” with a unique network name. If your desired network name does not already exist, you’ll be prompted to create a password for it — type carefully!

Now you should have a virtual network in place and can go online:
hamachi go-online MyNetworkAgain, replace MyNetwork with the network name you’ve joined or created.

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:
hamachi -h

Coda 1.5 Released

The folks 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. As if it couldn’t get any better, the update is 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!

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 point out the source.

Also, as it happens, I haven’t changed my billing information since my last order, so I’m not sure why it suddenly disappeared — some suggest iTunes is doing something odd with databases behind the scenes, but I’m just glad I can order prints again!

I hope this post will help out others who run into this problem, too.

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 serveradmin@yourdomain.com. For example, if your site were example.com, you would connect as follows:

ssh serveradmin@example.com@example.com

The domain “example.com” 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 example.com 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:

logout

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://serveradmin@example.com@example.com/home/1234/data/repos/tests /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 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/example.com/html/wp-content/themes

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 “pico” or “nano” to edit the post-commit script:

pico post-commit

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

svn update /home/1234/domains/example.com/html/wp-content/themes/tests

Exit pico, saving changes, with Control-X, Y, Enter.

Finally, log out of MediaTemple again:

logout

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:

Recommended

 
Obama '08