Duplicity 0.4.4 MD5 Module Error on OS X 10.5 Leopard

3 12 2007

There is an issue, if you haven’t already discovered it, in the MacPort installation for Duplicity 0.4.4, which is the current port version as of today, December 3, 2007.

I know, I know .. the current official release is 0.4.6, released November 28, 2007, according to the official site, but I’m only the messenger. Please direct your complaints to the maintainers (port info duplicity | grep Maintainers).

Anyway, very likely if you ended up here, you’re running into the following error no matter what duplicity command you run:

ImportError: No module named _md5

Apparently, the maintainers forgot to note a further port dependency, so you’re not getting all the source you need to properly run the program. Thankfully, the fix is quite easy. All you need to do is install the py25-hashlib port, and all will be swell:

sudo port install py25-hashlib

Now you know, and knowing is half the battle.




Installing MySQL Ruby bindings on OS X Leopard (with MacPorts)

24 11 2007

The upside of Leopard is that it comes pre-packaged with Ruby 1.8.6, Rails 1.2.3, and Capistrano. However, most Rails developers utilize MySQL for local development (if not also production) and a lot of us are in the habit of utilizing MacPorts to get it.

With the OS installation of Ruby and the MacPort installation of MySQL, it can be a bit of a challenge to get the correct Ruby bindings for MySQL without stomping on top of the existing Ruby installation. So, in short, here’s the answer:

sudo port install mysql5 +server
sudo env ARCHFLAGS=”-arch i386″ gem install mysql \ –with-mysql-include=/opt/local/include/mysql5/mysql \ –with-mysql-lib=/opt/local/lib/mysql5/mysql

That should be two lines up there, both starting with sudo.

Now that we’ve got the solution out of the way, I’ll go ahead and throw up the explanation for the *cough*upper*cough* 1% of you that might care. The MacPorts installation builds your MySQL setup in the /opt directory on our root disk, by default. Further, the current mysql port does not install all of the lib and include files inside of one, nice subdirectory, but rather in subdirectories of /opt/local/lib and /opt/local/include, respectively. All you’ve got to do is let your GEM installation know where to look, while forcing an i386-compatible architecture for the build.

Lovely, huh? Go forth and conquer.




Google Search with cmd-K in Safari on Leopard 10.5

24 11 2007

If you’ve got a strong Windows background and / or a lot of history with Mozilla’s FireFox browser, then at least one large annoyance you’ve likely got with Safari is the difficulty of Google Searching.  Apple was, as always, thoughtful enough to include the search box in the top corner of the application by default, but the keyboard shortcut they’ve given you is a bit rough (cmd-option-F).  I think the easiest way to think about that particular shortcut is to name it “the claw,”  as your hand uncomfortably morphs to attempt it.  And, if you’re on a laptop, forget about it.So, here’s a quick and easy solution to bring back the more familiar cmd-K Google Search option of FireFox into Apple’s Safari:

  1. Open  System Preferences,
  2. Open Keyboard & Mouse,
  3. Go to the Keyboard Shortcuts tab,
  4. Hit the plus (+) button under the list of available shortcuts,
  5. Select Safari as the Application, “Google Search…” as the Menu Title (without quotes), and hold down Command while hitting K in the Keyboard Shortcut box.

Voilà! Cmd-K searching-bliss in Apple Safari.  Enjoy.