Author Archives: Paul Kehrer - Page 2

Unhide ~/Library in OS X 10.7 Lion

Lion hides the user home directory by default. You can navigate to it with cmd-shift-G easily, but if you happen to want it to be visible all the time just run this command in a Terminal.app window.

chflags nohidden ~/Library

Thanks to Matt Pennig for the command.

Mongo Monitoring Via Mongo Live In Safari 5

We’ve recently started integrating MongoDB more extensively into our systems at work and found ourselves wanting some basic monitoring during dev to see what the DB was doing. A friend suggested Mongo Live, which fit the bill but was only compatible with Chrome. Since I switch frequently between Safari and Chrome I decided to port it.

Fortunately the extension for Chrome required only minimal changes to get it working in Safari. The most significant change is that the Safari extension uses a toolbar button to activate. The fork is available on Github and supports Chrome and Safari. Hopefully someone finds it helpful!

Revocation Article

I’ve posted an article about the current state of X.509 revocation on the internet over at the Spiderlabs blog. Check out Defective By Design? – Certificate Revocation Behavior In Modern Browsers!

Using dd in OS X

Doing device level copies with dd is a reasonably common Linux task, but not something OS X users typically do. However, if you find yourself needing to write an image file1 to a microSD card or some other media then here’s a simple guide to using it.

First, you’ll want to see the device labels.

diskutil list
/dev/disk0
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *250.1 GB   disk0
   1:                        EFI                         209.7 MB   disk0s1
   2:                  Apple_HFS Macintosh HD            249.7 GB   disk0s2
/dev/disk2
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:     FDisk_partition_scheme                        *2.0 GB     disk2
   1:                 DOS_FAT_32 THUMB_DRIVE             2.0 GB     disk2s1

The output from above shows that we have a mounted 2GB USB flash drive named “THUMB_DRIVE” that has been given the identifier /dev/disk2. To write to it we need to unmount it, but ejecting it in the normal Mac way won’t work here.

diskutil unmountDisk /dev/disk2

There we go! Now we just need to write our image file.

dd if=inputfile.img of=/dev/disk2

The shell will appear to hang, but you can check disk activity to see that it’s writing. Once the command returns you’re done!

  1. Frequently these guides will talk about using Win32DiskImager on Windows

r509, Ruby CA

I’ve put a new project up on Github. r509 is a CA written in Ruby which aims to do friendly wrapping around Ruby’s baroque OpenSSL bindings. It’s still in the early stages, but check it out if you’re interested and fork if you want to help it improve!

Fixing GrowlMail in 10.6.7 (Mail 4.5)

Update: OS X Lion (10.7) users. Mail bundles have changed significantly in Mail 5.0 so the quick fix hack will not work to get GrowlMail functioning again. There will need to be some actual development work to make it compatible. Sorry!

Welcome back! We’ve been here before haven’t we? Check out my previous post on this issue if you want more background on why this occurs.

Easy Fix

Download a pre-patched GrowlMail.bundle and drop it in your ~/Library/Mail/Bundles/ directory1. If you want it available to multiple users on your system, use /Library/Mail/Bundles/.

Download GrowlMail 10.6.7 mailbundle

If you use this method you’re all set; no need to use the command line solution below.

Add New UUIDs to SupportedPluginCompatibilityUUIDs

If you have already had your plugins disabled by opening Mail.app you’ll need to look in ~/Library/Mail (or /Library/Mail if you installed globally) and move the files back to the active bundles directory. They’ll typically be in Bundles (Disabled) or something similar, so quit Mail, find them, and move them back into the proper directory.

If you have a local installation:

defaults write ~/Library/Mail/Bundles/GrowlMail.mailbundle/Contents/Info SupportedPluginCompatibilityUUIDs -array-add "1C58722D-AFBD-464E-81BB-0E05C108BE06"
defaults write ~/Library/Mail/Bundles/GrowlMail.mailbundle/Contents/Info SupportedPluginCompatibilityUUIDs -array-add "9049EF7D-5873-4F54-A447-51D722009310"

Global installation:

defaults write /Library/Mail/Bundles/GrowlMail.mailbundle/Contents/Info SupportedPluginCompatibilityUUIDs -array-add "1C58722D-AFBD-464E-81BB-0E05C108BE06"
defaults write /Library/Mail/Bundles/GrowlMail.mailbundle/Contents/Info SupportedPluginCompatibilityUUIDs -array-add "9049EF7D-5873-4F54-A447-51D722009310"
  1. ~ means your home directory if you’re unfamiliar with the syntax. You can click the home icon on your Finder sidebar if you’re still confused