Category: Tips

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.

Published on August 26, 2008

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 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/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 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/example.com/html/wp-content/themes/tests

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

Make your post-commit script executable:

chmod +x post-commit

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

Published on August 24, 2008

In my endless configuration with my computer set-up, I ran into my second major issue with Boot Camp, and managed to find a working solution worth documenting. Starting with a single Mac OS X Leopard volume, Boot Camp Assistant kept failing and reporting “not enough space left on device” while attempting to live-partition my hard drive into two partitions for OS X and Windows (newer versions of Mac OS X can partition hard drives while booted, without any formatting). However, I had over 50% of the drive’s capacity free, so there should have been lots of space left on the drive. Clearly something was amiss…

Having started out with computers as a relatively old school Mac user — one who had to backup and erase a hard drive to partition it — I was immediately suspicious of the new-ish live-partition tool. To work around that, I tried booting the Leopard DVD and running Disk Utility from the Utilities menu, then partitioning the drive using that method. Again, I was met failure, but with an ambiguous “partition error” on which Disk Utility did not elaborate. The “Verify Disk” command reported that my volume was in good shape, despite my suspicions of corruption. DiskWarrior 4 also confirmed that the volume’s directory structure was intact. With 90+ GB free on my MacBook Pro’s 160 GB disk, how could I have “not enough space” to simply slice off a 20 GB Windows partition for run-of-the-mill use?

Out of quick-fix ideas, I decided to back up my Mac OS X volume, erase the drive, partition it, restore my OS X image to the big partition, then install Windows to the new smaller partition. Without a network-ready imaging utility like Ghost or TrueImage for Mac OS X (are there any?), I had to do this a slightly more complicated way:

  1. Boot Mac OS X and connect to a network share on another computer (a networked PC, in my case).
  2. Run SuperDuper! and back up the entire contents of the drive to the other computer.
  3. When done, boot the Leopard DVD and run Disk Utility again, and erase and partition the drive into one HFS+ Journaling partition for Mac OS X and one FAT32 partition for Windows.
  4. Boot a Windows CD, and “quick format” the FAT32 partition to NTFS (since Disk Utility can’t natively create an NTFS volume), then install Windows.
  5. Install Boot Camp drivers from the Leopard DVD: The Windows volume on the Leopard DVD contains the necessary Boot Camp drivers. Nice touch, Apple!
  6. Boot from the Leopard DVD again, but run Terminal this time — there’s no point-and-click way to connect to a network share from the DVD…
  7. Typically, you’d do mount_smbfs to connect to a Windows share, but it failed with “mount_smbfs: failed to load the smb library: Unknown error: 1102″ (No luck with mount -t smbfs, either). mount_afp appears to work, though.
  8. With no way to use SMB to get at the imaged Mac OS X volume made earlier, I downloaded a trial version of Extreme-Z IP, which provides AFP file and printer sharing support for Windows. After skipping prompts about Printer Sharing and automatically importing my SMB/Windows shares, it worked beautifully.
  9. Back at the Terminal on the MacBook, mkdir /Volumes/Sharename; mount_afp afp://username:password@192.168.1.10/Sharename /Volumes/Sharename mounted Sharename from the PC onto /Volumes/Sharename on the Mac over Ethernet. (The hidden /Volumes/ folder is where all connected Mac volumes show up).
  10. Back under Disk Utility, I was almost able to Restore the disk image to the proper volume over the network as if it were a local volume, but… it was grayed out in the file picker dialog.
  11. The “Scan Image for Restore” button resulted in a failed process, but it DID add the disk image to the sidebar of Disk Utility, which enabled drag-and-drop such that I could restore it to the HFS+J volume.

After a few hours of restoring data, my MacBook Pro is back, with Mac OS X on one volume just as I left it right before the imaging, and a fresh Windows install on the other. Surely Apple never meant for Boot Camp to be this complicated, but they underestimated the extent of my tinkering and day-to-day use! I hope my documentation can help someone in a similar situation…

Resources

Published on July 15, 2008

Firefox 3 was released just yesterday, bringing a wealth of new features to be excited about. From faster launch time and better memory management to interface polish and glitz, and over 8 million downloads already, Firefox 3.0 is a gem among modern web browsers.

For those that do web development, though, the 3.0 release means another round of website compatibility testing in both the earlier release and now the current one. For the most part, this isn’t a new challenge, but Firefox can be a bit peculiar: Upon launching Firefox, it checks to see if another instance is already running, and if found, brings up a new browser window of the currently running version. So, launching Firefox 2.0 while 3.0 is running results in two 2.0 windows, and vice versa for 3.0. This effectively stops the casual user from simultaneously running both Firefox 2.0 and 3.0 side by side. As an added side effect, when you completely shut down Firefox and launch a different major version, your profile information can get skewed, resulting in sometimes strange bookmark appearance and lots of checking for updates to installed add-ons. With a little tweaking, though, Firefox 2.0 and 3.0 can be convinced to run independently, each with their own bookmarks and add-ons.

Mac OS X Instructions

Running two versions of Firefox under Mac OS X couldn’t be simpler. The freeware application MultiFirefox takes all the guesswork out of the process by automatically detecting Firefox versions in your main Applications folder and presenting you with a list from which to choose the Firefox versions you’d like to launch. Complete with self-updating (thanks to the ubiquitous Sparkle framework), MultiFirefox is the easiest way to pull off this multi-browser stunt.

Windows Instructions

If you already have Firefox (2.0 or 3.0) installed, it’s important to back up your crucial information before getting started. Navigate to C:\Documents and Settings\YourName\Application Data\Mozilla\Firefox and copy your “Profiles” folder somewhere safe.

Once backed up, download Firefox 2 and/or Firefox 3, depending on what you already have installed. Launch each installer and begin setting up Firefox, but make sure to choose Custom settings. When asked for a place to install Firefox, change the path(s) to C:\Program Files\Mozilla Firefox 3\ (or ...\Mozilla Firefox 2), instead of just “Mozilla Firefox”. In doing so, you’ll place Firefox 2 at C:\Program Files\Mozilla Firefox 2\, and Firefox 3 at C:\Program Files\Mozilla Firefox 3\. Both versions of Firefox should now be in separate folders. (If you already have one version of Firefox installed at C:\Program Files\Mozilla Firefox\, you may choose to leave that where it is and just install the other version in a separate folder, however you’ll have to make a note of which is where, and modify the following instructions accordingly.)

Create a new shortcut to Firefox 2.0 by right-mouse-button-dragging C:\Program Files\Mozilla Firefox 2\firefox.exe to your Desktop (for now), and choosing “Create Shortcuts Here”. Name the shortcut “Firefox 2″. Repeat for Firefox 3, changing “2″ to “3″ where appropriate.

You’re almost there, but now we have to tell Firefox to keep the two instances separate. Open the Properties window for the Firefox 3 shortcut, and add -ProfileManager (space key, minus sign, ProfileManager) to the end of the string of text in the Target field. Click OK, then run that same shortcut to bring up Firefox’s Profile Manager. Rename the existing “default” profile to “firefox3″, and also create a new “firefox2″ profile:

Once profiles are set, exit Firefox completely. With two profiles in place, each version of Firefox can have its own bookmarks, extensions, and other settings, without interfering with each other. Open up the properties windows for both the Firefox 2 and Firefox 3 shortcuts you made. Remove the -ProfileManager addition from the Firefox 3 shortcut Target, replacing it with -no-remote -p firefox3 (space key, minus sign, no-remote, space key, minus sign, ‘p’ key, space key, firefox3). Add the same to the Firefox 2 shortcut, again changing the 3 to a 2. Both shortcuts should now have the -no-remote option set, as well as -p followed by the designated profile that matches that Firefox’s version. In short, Firefox 3 gets the firefox3 profile, and Firefox 2 gets the firefox2 profile, seen below:

Click OK on both shortcuts to confirm the changes, and finally double-click each to run Firefox 2 and 3 at the same time!

Also, don’t miss LifeHacker’s Power User’s Guide to Firefox 3 for some excellent 3.0 tips and tricks, as well as ArsTechnica’s briefing of what’s to come in Firefox 3.1.

Update: Here’s another excellent tutorial on running Firefox 2 and 3 at the same time, including notes on the -no-remote switch and how it can make Firefox claim it’s “already running but not responding.” That firefox.exe switch appears to be a bit of a double-edged sword.

Published on June 18, 2008

When you use Adobe Photoshop day in and day out, certain things about its interface and workflow start to grate on you, like the inability to zoom while in the middle of a transform or applying Layer Effects. Much to my delight, Photoshop is also jam packed with hidden commands and modifier keys, which turned up a discovery today, shown here:

If you’re in the middle of a Transform or Layer Effects change and need to get your changes just right, you can adjust your view simply by holding the correct keys and using your mouse. On the Mac, hold Space and drag to pan around the background window. Command-Space-click on the document to zoom in, and Command-Option-Space-click to zoom out. Note that some of these key combos collide with the system-wide Spotlight commands, so you may consider remapping them in System Preferences, depending on your usage of each. Personally, I’ve moved Spotlight to Control-Space just to use these great hidden features of Photoshop.

Published on March 2, 2008