Fun hacks, WP plugins, photography, and PKI junk. Languishing since 2008.
Archive for November, 2009
Building Services Using Automator Workflows in Snow Leopard (10.6)
Nov 19th
In Snow Leopard (Mac OS X 10.6) the Automator tool has been drastically upgraded to support the creation of service workflows. In simple terms, this means you can build automated chains of tasks that can be invoked in a context sensitive manner. Not simple enough? Using this tool, you can automate common actions you perform and the proper service will appear in the menu only when it is capable of being used. You can even assign global hotkeys (via the Keyboard preference pane) to your service. Let’s take a look at a simple service workflow so you can see how More >
Bypass Hulu Regional Restrictions in Mac OS X
Nov 16th
Hulu is a great site to find new shows and catch up on old, but due to various contracts no one outside the US can use it. This irritated some friends of mine from Canada, England, Germany, et cetera. So I decided to write up one (very reliable) way to circumvent the Hulu geolocation checks — using a VPN.1
Accessing Hulu Outside The USIn this case, we’ll be using a small VM and the open source VPN server pptpd. All the server side instructions below are applicable to both OS X and Windows, but the client setup is only specified More >
Fixing GrowlMail for Mail 4.2
Nov 9th
Lately Apple has been revving the version number (and plugin compatibility UUID) of Mail.app with every version of 10.6. This breaks bundles like GrowlMail even when they are still compatible. The easy fix (although not necessarily the best if it turns out an update is required!) is to run a few commands in Terminal to add the new UUIDs1 to the SupportedPluginCompatibilityUUID key in the Info.plist.2
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 More >
Find A Matching Certificate And Key Pair
Nov 8th
If you have a list of keys and SSL certs and don’t know which cert belongs with which key, here’s a script for you. It’s not efficient (nested for loop!), but it gets the job done quickly.1
#!/bin/bash for i in `ls *.key` do key_mod=`openssl rsa -noout -in $i -modulus` for j in `ls *.cer` do x509_mod=`openssl x509 -noout -in $j -modulus` if [ "$x509_mod" == "$key_mod" ]; then echo "$j matches $i" fi done done
- If bash allowed multidimensional or associative arrays this would be trivial to optimize. ↩
SSL VHosting On The Same IP (aka SNI)
Nov 3rd
Server Name Indication (SNI), an extension to TLS, allows browsers that support it to connect to SSL hosts that do not have dedicated IPs (much like standard http virtual hosting has worked for years). This extension, however, must be supported on both the server and client side. Microsoft has not yet chosen to support it (maybe IIS 8?), but the Apache project did with the 2.2.12 release. Recently, Ubuntu 9.10 Server became the first server distribution to ship with Apache and OpenSSL built with the appropriate flags, so if you’d like to follow along you can use a 9.10 VM.
In More >
More Useful Bash/Terminal Settings
Nov 2nd
A few more tricks to make your bash environment better. As always, add them to your ~/.profile or ~/.bash_profile to enable.
Disable the pagination of long lists when ambiguously tab completing.
bind 'set page-completions off'
Increase max returned items before being prompted. (ie, “Display all 380 possibilities? (y or n”). You can set the number to whatever you’d like.
bind 'set completion-query-items 300'
Show the list of autocompletion options after the first tab. This prevents the beep + second tab behavior.
bind 'set show-all-if-ambiguous on'
When autocompleting for cd or rmdir, list only directories as choices.
complete -d cd rmdir
Autocompletion for ssh known_hosts. Add this to your ~/.ssh/config (if the file doesn’t exist, create More >