Mac OS X

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.

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!

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

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.

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.

I've already mentioned my strong desire for one of the features, session saving and restoring. Firefox has this nailed, and it's a built-in feature. I feel strongly enough about it to mention it again here. Hey, Apple, are you listening? I want full session-saving, like what Saft does now, built into Safari.

Another feature Saft gives me is (rudimentary) ad blocking. The various Firefox extensions (namely Adblock Plus) that exist give tremendous power in blocking ads on the web pages you view. I don't know that Saft will ever approach the power of something like Adblock Plus, but it does a good enough job for the moment.

Here's a question worth investigating: Is it possible to write an Adblock Plus-like Safari plug-in using the official Internet Plugins API? My understanding is that API is restricted to the content of the page, and doesn't allow for any behavior modification of Safari itself. That should be enough, right? This is something I'll have to investigate.

I'd definitely like to stop having to install InputManager-based hacks on my system, though. Safari is, in my opinion, an excellent browser, but the grass is always greener on the other side of the fence. Firefox does seem to have a mighty green lawn around their extensions garden.

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. :)

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.

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 Addendum: MySQL Community Server

Worked my way through a bit more of my system, and found another thing that's not very happy with Leopard. Turns out that the MySQL Community Server (the free one you can download from mysql.com) really doesn't work on Leopard, and it seems that it's primarily the Preference Pane, startup item, and socket locations that need tweaking. Actually, people seem to be saying you should just ditch the preference pane and the startup item entirely. Apparently during the upgrade my data disappeared, too, which is somewhat entertaining. It was all testing data, and I can easily pull it from the production sources again (or even boot my backup drive and dump it from there.)

At this point, I'm probably going to just install the macports version of mysql (and postgresql) and use that. The Mysql.com version was nice because it included the StartupItem and a nice Preference Pane to control the service, but that was, really, its only benefit.

For an idea, simply searching on Google for "mysql leopard" will give you a number of useful and relevant items.

Some thoughts on Leopard

I've spent a weekend with Mac OS X 10.5 Leopard, now, including a couple aborted attempts at installing it, and I think I can safely say I'm liking it. I tend to shy away from *.0 releases, primarily because they never have all the bugs worked out. For the most part, I'm impressed at how 10.5.0 is. Sure, there's a couple rough edges, but I expect they will be addressed in point releases over the next couple months.

By far my biggest problem was getting Leopard installed. It had been long enough since I upgraded from Panther (10.3) to Tiger (10.4), that I had forgotten all the good advice and experience. My first attempt was an in-place upgrade (choose "Upgrade" from the install types). Due to my ignorance, I had left a number of relatively "hacky" things installed before the upgrade that wouldn't work post-upgrade. Once I restored my 10.4 system and pulled out the hacks, things worked much better. And, while I'm making a point to go into some detail here about these problems, the overall experience was actually very good. (My final system, for the record, was installed with the "Archive & Install" option, not the "Upgrade" option.)

Really, my biggest complaint about the upgrade was that it took a couple hours for the install, and then several hours of Spotlight re-indexing my HD. Starting the upgrade before going to bed cured me of having to wait for it, though. I imagine a current-generation MacBook or MacBook Pro would take much less time for the install.

Things That Wouldn't Work

Saft

Saft is a "plug-in" for Safari that uses the deprecated – and now modified – InputManagers facility to do everything it does. Because of the changes in Leopard to make it more difficult for random InputManagers to be installed (think "trojans"), Saft needed to be modified so that it could still work. If you go to the Saft home page you'll see that a new version is already available, but is now a wrapper for Safari rather than a transparent plug-in. It's also $12, even if you already paid for the Tiger version.

While the cheap bastard in me is annoyed at having to pay again for the new version, I'm actually more bothered by the fact that Saft is now a wrapper that you launch instead of Safari. This simply gives more weight to my desires that Apple provide an actual plug-in API for Safari. I won't hold my breath, though. It's entirely likely that when I get annoyed enough with all the ads, pop-ups and uncontrollable web page animations, I might just buckle down and re-purchase Saft. Unless, that is, another product does the job better.

GPGMail and MailFollowup

I see these more as a single problem caused by differences in the Leopard version of mail from the Tiger version of mail. As a result, most Mail plug-ins (mailbundles) are very likely to not work. I removed them both when I realized what was crashing Mail. MailFollowup has since been updated for Leopard, and it seems to be working normally now. The GPGMail developer is working on porting the plugin to Leopard, and will hopefully have a release soon.

On a somewhat related note, the GrowlMail plugin I had been using simply doesn't work at all, and neither does the version included in the latest Growl download. More on that as I hear about it.

SideTrack

The loss of this third-party trackpad driver is really the one thing that hurts the most about the upgrade to Leopard. My machine is a 1.5GHz G4 PowerBook 15, which happens to be the generation before Apple added the two-finger scrolling to their laptops, so SideTrack was a life-saver. It didn't do two-finger scrolling or right-clicking, but it did let me define scroll areas on the trackpad edge, as well as defining actions for taps in the trackpad corners. I'm really missing my corner-taps (which I used for right-click and expose) and scrolling. The developer is working on figuring out how to get SideTrack working on Leopard, but until then I'm left waiting, and looking at other options.

Other Issues

Aside from those issues, what have I run into? Well, no show-stoppers, really, but I have found a couple problems so far that I am hoping get fixed in 10.5.1.

The Menu Bar

I groaned in pain when I first heard that the menu bar in OS X was going to be semi-translucent. While it's not as bad as I imagined, it's still quite horrible, in my opinion. The basic effect is that the menu bar takes on the shades of whatever colors are underneath it as part of your desktop background. I hate it. If I've got a blue desktop image, the menu bar is blue-ish. Right now I'm using the "Mohave" black-and-white photo that was included with Leopard, as it gives the menu bar a grayscale look. I consider it a temporary work-around.

Apple, please, do us all a favor and add an option somewhere (probably in the Desktop and Screen Saver preferences pane) that gives us the option of restoring our solid, white menu bar.

The Dock

I've always been a "Dock on the Right Edge" guy, even before I moved to Mac from Linux, so I was downright gleeful when Apple changed the look of the Dock (after public outcry over the mirrored-shelf look) when it's on a side edge of the screen. It's a little too dark, though. I suppose I'll live with it. I still can't stand the mirrored-shelf look when the dock's on the bottom, though.

I can has BlueTooth?

I haven't yet correlated it yet to exactly when or how I sleep my PowerBook, but I've noticed twice now that when I've woken it up, I've lost my BlueTooth. By "lost," I mean that it's no longer available. It's almost as if the driver module crashed when the system woke back up again. I think it's only happening when I force the PowerBook to suspend-to-disk (via Deep Sleep) and power off, which is my preferred way of sleeping the system when I know I'm not going to use it for a couple hours, or simply don't know when I'll next use it.

Nonetheless, this never happened with Tiger, so I'm going to assume it's a bug that will get quashed with 10.5.1. I can't be the only one experiencing this, but just to hedge my bets I'll have to poke around the Apple forums and see.

SpamSieve

I hate spam. You hate spam. Everybody hates spam. Thankfully, SpamSieve, which is possibly the best client-side spam filtering application I've ever used, works (mostly) fine on Leopard. For some reason, it's enjoying taking about a minute to start up on my PowerBook, which seems to be an issue the author knows about. Apparently Leopard is doing some things differently enough that it can have drastic effects on SpamSieve's performance. Thankfully, startup is the only time I get hit by this issue, so I've worked around it by having SpamSieve start up at login, and not quit when Mail quits. That way, it's already running when I need it.

Firewall

Oddly enough, the firewall in Leopard apparently doesn't use ipfw. I'm not entirely sure how it works, but as near as I can figure it's using the "sandboxing" stuff. The ipfw suite is still there, of course, and you can put any rules you want in there, but it appears to be completely seperate from the "Firewall" tab in the Security preference pane. Hopefully more knowledgeable people than I will expound upon this, soon.

What's particularly disconcerting is that when X11 is running, port 6000 is open. What's up with that? That's a security nightmare! I couldn't seem to get the Firewall to block access to X11, either (by adding X11, and selecting "Block incoming connections.)

On the bright side, at least nmap reports "access denied":

PORT     STATE SERVICE VERSION
22/tcp   open  ssh     OpenSSH 4.5 (protocol 2.0)
6000/tcp open  X11     (access denied)

Still, Apple, why exactly are you ignoring the excellent ipfw tools?

Miscellaneous

The upgrade deleted all my print queues. I suppose I should have expected this, but I still found it rude. On the bright side, managing printers feels simpler than it did in Tiger, and it was a snap to re-add all the printers I use (especially since my printer at home uses Bonjour.)

There seems to be some magic going on, likely with launchd, that causes X11 to be automatically started up when you reference the $DISPLAY environment variable in a UNIX shell. This happened both in Terminal.app and iTerm. Unexpected, but I tend to have X11 running all the time anyway, so this doesn't really change much for me, other than not having to remember to start it up myself.

I had to re-install the Cisco VPN client for work. I expected this, anyway, given that I did an "Archive & Install" upgrade, but as it turns out, work had a newer version anyway, so it was all good. I haven't actually tried connecting with it yet, though, so I'm not sure if it actually works with Leopard.

Xjournal, a somewhat popular LiveJournal blogging tool, crashes when trying to log in to LJ on Leopard. There's a fixed version available, and the developers are including the fixes in the next release. See the developer's blog and the Xjournal LiveJournal community blog for more information.

Most other apps had updates available (and easily installable) thanks to the fact that so many developers are using the Sparkle updating framework.

Some Advice

First of all, do your research on what's going to work, primarily regarding anything you've installed to enhance or extend the functionality of your Mac. Most of these will stop working, and a lot of them have already been updated for Leopard in the week since it's release. Secondly, I'm a very big proponent of the "Archive & Install" method of OS X upgrades versus the "Upgrade" method, as the "Archive & Install" more or less guarantees that you'll have a clean OS core installed. That said, I can safely say that the "Upgrade" method will work, and will likely work with very few problems, and leave with with fewer things you may need to either re-install or upgrade post-system-upgrade.

In fact, I can safely say that the issues I was having after doing an in-place upgrade (choosing "Upgrade" in the OS X Installer) were not due to OS upgrade directly, but were all related to the various apps and utilities I had installed. More correctly, the problems were in the apps and utilities, and not problems with the OS upgrade process. I can say this with some certainty because the same problems persisted after I fully restored my old system and re-tried with the "Archive & Install" option.

Just about every problem I have run in to seems to revolve around some last-minute changes in Leopard that none of the third-party developers could know about. They're catching up, though, and quickly. If you run into an application that has a problem on Leopard, check it out. You may find that the developers already know about the problem, already have a fix, or may even already have released a new version that includes the fix.

I'm a strong advocate of the "Archive & Install" upgrade method, though the "Upgrade" in-place upgrade method will certainly work just as well, especially if you want minimal post-upgrade hassle and don't have much (or anything) in the way of hack-ish functionality extensions installed. The installer is fairly solid.

I Like Cats. I Also Like Cheese.

Overall I'm pretty happy with Leopard. I'm a bit peeved at the firewall issue, which, in my eyes, is a glaring problem. All told, though, most of the issues are with applications that needed updates to work with Leopard. Given all the changes in Leopard over Tiger, I'm quite please that as many things worked without a hitch as have, and big kudos to all the developers responding so quickly where apps are encountering problems that didn't happen with the last developer seed of 10.5.

I am hoping, though that 10.5.1 doesn't take too long to come around, and carries a few fixes to remove some of these issues.

Even with everything I've outlined here, though, I'd still recommend Leopard as an upgrade over Tiger. It's still reasonably snappy on my PowerBook G4 (on par with Tiger.) Once we get past the .0 roughness, Leopard should shine even more brightly.