Yet Another Mac OS X Location Changer

I was going about my business, as you do, having used the LocationChanger script and launchd agent to automatically switch my Mac between my home and non-home network locations. Of course, I decided I could do it a little better, and got to work.

Here is the result: AutoLocation.

I learned a few new things while cooking this up, including how to actually deal with arrays in bash, a nifty thing called process substitution (which resulted in my favorite line in the whole script), and a great way to return arbitrary values into variables from functions.

I really like it when I learn new things on the way to solving a problem for myself. It’s the best way to learn something.

Advertisements
Yet Another Mac OS X Location Changer

Using SuperDuper! for FileVault2 System Volumes

Since my first Mac (an Aluminum PowerBook G4), I had relied upon SuperDuper! as my backup method for my Mac notebooks. It’s a wonderful tool, and faithfully replicates an entire volume, including making it bootable, for a worst-case drive failure scenario. I’ve used it for migrating my system to a new disk when doing disk upgrades, transferring an image to a new/replacement notebook, and just plain backups.

I’ve long since switched to using CrashPlan for my backups. CrashPlan has worked wonderfully, and saved my bacon a number of times. I use it on every computer I own. Crashplan isn’t, however, an ideal solution for migrating data to a new drive when upgrading your hard disk, simply because it’s rather slow to restore a lot of data over the network.

So, back to SuperDuper! I go, as I’m planning to add an SSD to my current MacBook Pro, and re-instate the “build a DR boot volume on an external drive” policy at home. The wrinkle is that since the upgrade to OS X Lion, both my wife’s and my notebooks are using FileVault2 for full-disk encryption. Given the sheer amount of personal information on these computers, it’s the only sane thing to do, especially when the notebooks are bound to iCloud, with Find My Mac enabled. (This gives you remote-wipe capability on your notebook, which is very useful if it’s lost/stolen.) Unfortunately, there’s no clear way to use SuperDuper! with a clean hard drive and end up with an encrypted volume that duplicates the original.

At least, not directly within SuperDuper.

All is not lost, though, as there is a way to do it, and get a fully encrypted, bootable duplicate of your FileVault2-encrypted OS volume!

In short, the procedure is:

  • Install OS X Lion to your destination hard drive
  • Activate FileVault2 on the new install
  • Reboot to your normal startup disk
  • Use SuperDuper! to “Smart Update” the destination
  • Boot from the destination (SuperDuper! target) disk again
  • Open System Preferences -> Security, and click on the FileVault tab.
  • Click the button to enable users to unlock the volume, and enable any additional accounts (if you have the users there to type in their passwords.)
  • Reboot to your normal startup disk again
  • Pat yourself on the back! You did it!

I’ve tested the procedure on my old MacBook Pro, from which I’m preparing to remove the SSD to transplant it into my new MacBook Pro. It works, it boots from either volume, and they’re both encrypted (granted, with different recovery keys, as one would expect). I’ll post a followup in about a week complete with screenshots of the whole process when I migrate my OS volume to the SSD in my new MacBook Pro.

Stay tuned!

Using SuperDuper! for FileVault2 System Volumes

Dear Adobe Reader Safari Plugin: Die.

If you’re anything like me, you have a strong dislike for all the stupidity that surrounds the Adobe Reader (formerly known as Acrobat Reader.)

I won’t go into the details here (though this guy can explain it in great detail), but because I very occasionally need features of Adobe Reader, I still keep it installed on my Mac, while I use Preview for all my other PDF needs. I’ve gone so far as to install the Firefox PDF Plugin for Mac for when I use Firefox, just to avoid Adobe Reader. And, really, there’s no point in Adobe Reader for most cases where you just want to be able to view or print PDF files. Doubly so, since Mac OS X lets you print any document to a PDF file as a default feature of the OS.

There are, though, edge cases where having Adobe Reader installed and available are useful. So I have it installed, but I refuse to use their web plugin. Adobe doesn’t care, though, and will periodically, sometimes randomly, and sometimes even without my consent, re-install the plugin. Even though I’ve told it not to. Adobe Updater, I’m looking at you, here.

Sadly, my solution is heavy-handed. I created a launchd task that will forcibly remove the Adobe Reader plugin from /Library/Internet Plugins whenever it’s created. It’s fast, efficient, and works.

And, as soon as I can figure out the new wordpress theme, I’ll post it here in a legible form

UPDATE: Thanks to Lynne and Chad on Twitter for suggesting the Preserve Code Formatting plugin!

And now, the Launchd config. Save this as:
"/Library/LaunchDaemons/org.unnerving.RemoveAdobeReaderPlugin.plist"


Label
org.unnering.RemoveAdobeReaderPlugin
ProgramArguments

rm
-rf
/Library/Internet Plug-Ins/AdobePDFViewer.plugin

QueueDirectories

/Library/Internet Plug-Ins/AdobePDFViewer.plugin

WatchPaths

Dear Adobe Reader Safari Plugin: Die.

Oh… Safari was already awesome.

So, yeah, this is probably old news to everyone else, but I’m late to the party, as usual. I finally tripped over two menu options in the History menu of Safari that I had not previously noticed.

The first is “Reopen Last Closed Window.” This is very useful.

The second is “Reopen All Windows From Last Session.” This takes care of my biggest concern regarding session restore.

So I guess maybe a “Reopen Last Closed Tab” option might be about all I could add to that to be truly complete.

I do still look with great envy at Firefox’s extensions system, particularly for Adblock Plus, FlashBlock and NoScript.

Oh… Safari was already awesome.

Safari: You’re Awesome, But You Could Be More Awesome

It’s been about a week and a half since Apple release the last batch of updates for OS X, including the latest version of Safari. In the interests of keeping up to date with security updates, I went ahead and updated. I did my research first, though, and uninstalled Saft before the attempt (there were some who had problems with InputManagers installed during the upgrade.)

I was happy to discover, this evening, that Saft had been updated to support the latest version of Safari. Despite my general revulsion for running InputManager-based hacks (let alone other system behavior modification software, like Haxies, that hook in even deeper to the system), Saft offers a subset of functionality that I simply don’t like doing without. A couple of the features, I feel, really should be integrated into Safari proper.

Continue reading “Safari: You’re Awesome, But You Could Be More Awesome”

Safari: You’re Awesome, But You Could Be More Awesome

Spotlight “All Images” search leaves no stone unturned

It may not be a good thing, depending on what you try to hide on your computer. 🙂

Spotlight search in CoverFlow mode

After seeing it reported elsewhere that Spotlight’s “All Images” search on Leopard really does serve up every image on the system, I decided to give it a try myself and see what turned up. Sure enough, every single piece of spam I’ve received in the last week that included an in-line image (as a MIME attachment) ended up contributing to the show.

In this screenshot, you can clearly see all the images from the spam messages. The on of the woman in the hammock is actually from a spam message, if you can believe that. No idea who she is, but whatever email message that image was sent in got filed as spam.

Spotlight “All Images” search leaves no stone unturned

Leopard firewalling

A quickie for those that want to actually get their hands dirty with OS X’s ipfw firewall: WaterRoof seems to be the tool for configuring an ipfw firewall, setting a startup script for it, etc. for Leopard. One of the nice things is that it comes with a few rules sets that make getting the basic firewall quite simple.

I’ve simply turned off the Leopard “Firewall” for now, and reverted to the tried-and-true ipfw firewall instead.

Leopard firewalling