Some Bits: Nelson's weblog

MacOS software I rely on

A friend of mine is buying his first Mac, so here’s a list I made for him for essential software.

  • Chrome for web browsing with LastPass for passwords.
  • Alfred for launching apps, small actions, etc. I can’t imagine using MacOS without it.
  • iTerm2 for terminal windows.
  • Homebrew for Unix tools. It’s not awesome, but the best option.
  • Sublime Text for text editing.
  • nvALT for note taking.
  • Adium for instant messaging.
  • VLC for playing video and audio. Plex for networked serving of video.

Chrome and MacOS: create new windows

If Chrome is your default browser, then when an external app opens a link Chrome opens it in a new tab in an existing window. We can argue whether that’s the right behavior in general, but it’s absolutely wrong if you’re using Spaces and the Chrome window is in a different space. Chrome jerks your whole desktop to the left, forcing you to the Space where it happens to have a window open, completely ignoring the Mission Control preference “When switching to an application..”. It’s terrible.

Fortunately there’s a fix. Long story short: you set your MacOS browser to a little program that tells Chrome to open a new window. Tabs still work like normal in Chrome, but external links now always create windows and, as a side effect, avoid the horrible Space switching.

That little program is in AppleScript, an ancient, opaque language. (Compiled scripts? Really?) Here’s the nut:

on open location theURL
  tell application "/Applications/Google Chrome.app"
    make new window
      activate
	set URL of active tab of first window to theURL
  end tell
end open location

It’s a bit promiscuous with the windows if you’re used to the new tab behavior. The ideal thing may be to re-use an existing window if one is visible in the space, otherwise open a new Window. It’s a bit of a mystery why Chrome lacks a new window preference.

As seen on StackExchange

iMac power usage

My fancy new iMac is really power efficient. It averages about 70 watts when I’m using it; that’s about like a lightbulb. Impressive, considering it’s a 27″ LCD monitor. It’s less than half my old Windows desktop and about the same as my stupid idle A/V rack. Assuming I put the iMac to sleep half the day, that works out to 25kWH or $9 a month.

The iMac is basically a laptop bolted to a giant LCD monitor, with efficient mobile CPU and GPU keeping heat and power down. The biggest constant power draw is the LCD backlight; the automatic dimming helps quite a bit. Here’s some numbers (top end 27″ iMac: 3.4GHz i7 quad CPU and AMD 6970M GPU).

  • 60-100W ordinary usage (depends on room light)
  • 60-150W going from dimmest LCD to brightest
  • 130-150W playing Starcraft / Team Fortress
  • 210W maxing out CPUS + GPU with Bitcoin
  • 50W monitor dimmed
  • 35W monitor off, computer still on
  • 1W sleep mode
Spinning up the hard drive adds about 5W. Maxing out a single CPU adds about 10W. The screen is most amazing to me: between 25-115W just for the display, depending on brightness. Weirdly, adding a second monitor via the display port adds 25W to the iMac’s power usage, even when the screen is asleep.

As efficient as the iMac is, it’s still worth the trouble to let it automatically sleep when you’re not using it. I’ve yet to have a Windows desktop where sleep mode actually worked; totally solid on the Mac, of course.

Fixing “No bootable device” on Lion / Boot Camp

I just had an unwelcome scare on my new Mac, when I rebooted it took awhile and ended in a black screen saying “No bootable device -- insert boot disk and press any key”. Yikes! I’d set up a Boot Camp partition earlier but hadn’t installed Windows to it; apparently that broke things. I’m not the only one to have this problem, and thanks to this blog post I was able to fix it.

The fix was rebooting while holding down Cmd-Option-P-R. That resets the PRAM (aka NVRAM or BIOS settings). After that the system booted fine. It doesn’t look like anything else important is in the PRAM, although I’ve probably screwed up the Boot Camp boot chain.

Macs have a bunch of magic keys at startup. I’d have thought holding down Option for Startup Manager would have been the right fix, but it didn’t seem to do anything. Apple’s support entry on this problem is unhelpful (step 1: Start up to MacOS. Um, that’s the problem). I wish Boot Camp were more transparent; there’s a bunch of conflicting and confusing information about how the Apple boot chain works.

Migrating Macs

Apple’s Setup Assistant and it’s little brother Migration Assistant are total miracles. They make it easy to set up a new Mac by copying various settings, applications, and data from another Mac. Such a valuable feature; saves users literally days setting up a new computer. I don’t think Microsoft’s ever gotten this right. I have to think Apple’s sold a lot more new computers to users who know the upgrade will go easily.

I like my Air so much I went out and bought an iMac. I needed a monitor anyway; why not pay a bit extra to have a computer bolted onto it? So easy to set up. Plug in my Time Machine backup drive, say “import everything”, and I’m done. All the sensible settings were carried over. All my apps. All my weird stuff, like the Canon printer drivers and my personal Homebrew install and the odd hacks that use undocumented APIs. The only thing that didn’t just work on the new machine was Xcode; it was all there but for some reason my PATH didn’t pick it up.

I realize Macs have been able to do this trick for awhile, but it still seems like a miracle. The new App Store should make it even easier by streamlining licensing. If I understand right, if you buy an app on the App Store once you get the right to install it forever on any of your machines. I hope I have that right; that’s how the iOS store works and it’s how all my Mac apps so far have worked. That’s a pretty user friendly policy, also easy to understand. I wonder how it works in offices?

Time Machine vs. large files

Apple’s magic Time Machine backup system works great. But it has one flaw: it’s inefficient with large files which change frequently. It makes a whole new copy of the file each time, there’s no diff mechanism. My Time Machine backups are 300 MB every hour despite me actually changing very little. The Time Tracker app helped me figure out what’s going on.

Chrome stores your web history in one giant file per month: 100 MB in two weeks for me! That file is constantly changing. Arguably history should be backed up, it’s valuable user data, but I’d rather not if it’s this inefficient. Unfortunately there’s no easy way to exclude just the history database; the filename changes every month and the directory it is in has other useful stuff.

My entire Dropbox repository is being backed up whether I change anything or not. I’m not the first to see this problem but it’s not clear what’s going on. (My guess: v1.1.40 and Lion.) My solution was to simply stop backing up Dropbox (why bother?). A related issue is Dropbox maintains databases in .dropbox that can also get unwieldy.

Under the hood Time Machine is pretty simple; it’s mostly doing the same hard link trick that rsnapshot uses with some help finding changed files from the filesystem. The GUI and easy setup is the magic, the sort of product Apple is uniquely good at building.

First impressions of the Mac

After years of using Windows and trolling my Apple-loving friends I finally bought a Mac. I love it. I last used MacOS five year ago (and before then, in 1993), so I’m coming to Lion with fresh eyes. This blog post is long for me and comes in three parts: the good parts of the Mac, the bad parts, and a list of software I find useful.

The good

Emigre has an underappreciated slogan: “Design is a Good Idea”. Apple gets design. The MacOS UI is good, generally obvious. The supporting documentation is excellent. Text and graphic rendering is beautiful: not blurry, it looks like paper on a high quality LCD. The hardware is a marvel, years ahead of what any Windows manufacturer can turn out. Of course I knew Apple had good design, but I’m still surprised how much I regularly appreciate it.

The other nice surprise is how handy it is to have Unix at hand. For years I’ve worked with two machines: Windows in front of me shelling in to Linux boxes for real work. It never really worked fluidly. With the Mac I can edit Python code and run it sensibly right on the same machine without weird filename collisions, network file system oddities, or Cygwin atrocities. I can augment my system with shell scripts. I can use most good old Unix software. I’m surprised how much this affects my daily work.

One pleasure of learning MacOS is finding all the grace notes. Preview and Quick Look are both lovely ways to just look at a file’s contents. There’s a real builtin dictionary with a handy Wikipedia client. There are buttons on the keyboard that pause my music or turn the volume up and they actually work. System sleep restores reliably. Windows claims to do most of these things but they never seem to work right.

MacOS also has some surprisingly sophisticated stuff. Time Machine is a terrific backup tool. The new Lion document model is brilliant; finally I don’t have to press some stupid “save” button. There’s automatic typo correction which makes me look smarter without being annoying. And Apple has figured out how to build systems around SSDs, a significant speed upgrade.

One other pleasant thing about the Mac ecosystem is the third party application market. Macs have a long tradition of solid, well designed software that is not free. I love that the three most popular text editors for MacOS all cost $40+. It’s great that Skitch, Alfred, and Reeder are beautiful apps that charge enough to support the developer’s lifestyle. The jury is still out on the Mac App Store, but given the success of the iOS market I’m optimistic we’ll see more independent developers making a living making beautiful apps.

The bad

As much as I admire the Mac, when something doesn’t work quite right the sharp corner sticks out. Here’s some of the things that have bugged me in my first couple of weeks with MacOS.

Installing software is poorly managed. Download a .pkg file, mount it as a virtual drive, then drag the app to the Application folder, then unmount the package. How awkward! Some stuff comes with an installer script, but then there’s no standard uninstaller. Mac fanboys say “just drag the app out” but that only works for self-contained apps, not printer drivers or packet sniffers or anything that installs in several places at once. I’m amazed this doesn’t cause more problems.

There are too many keyboard shortcuts. The Home and End keys are broken. And there are way too many modifier keys: do we really need four? Windows generally gets by with two. (Hilarious example: Ctrl-Shift-Q is “play macro” in SublimeText. Cmd-Shift-Q is “force quit”. Ask me how I know.)

There are too many preferences to customize display. Why do I have a choice of two graphical animations for minimizing windows to the Dock? Can’t Apple pick one? Third party apps can be really bad, with 50+ display preferences. Good designers picks one good design, they don’t leave it up to individual users to cobble together their own. This opinion may be controversial.

The split between applications and windows is confusing. Some apps like Preview stay running even with no windows open, others like Font Book close when you close the last window. Lion has decided it’s OK to quit applications automatically if there are no windows. Chrome has a special hack to stop you quitting accidentally, there’s also a general solution. It’s just strange. I do like having a unified application menu bar, though.

iTunes is a fucking disaster. The UI works like the poorly managed work of summer interns and ignores the standard MacOS UI conventions. And it hangs when importing music; is it really single threaded?! The database is a joke, poorly managing data and regularly corrupting itself. The sync model with iOS devices is confusing and broken. iTunes is the gateway to Apple’s flagship consumer devices, it’s astonishing it’s been this bad for so long. Fire is the only way to be sure.

Software

One of the fun things about getting a new computer is finding and installing all sorts of software on it. Here’s the stuff I’ve found particularly useful.

Chrome, the web browser. The best browser choice and since most of us spend 90% of our time in a web browser it’s worth picking the right one. Chrome benefits greatly from AdBlock and a hyperlink underline fix.

Alfred, a fantastic search UI and app launcher. It’s a replacement for the Spotlight UI (and the abandoned QuickSilver). I use it some 30 times a day already and have only started to learn what all it can do.

Growl, a desktop notifier. This little UI shim belongs as part of MacOS, it’s amazing it’s not integrated yet. Fortunately a lot of third party software supports it.

MenuMeters, a system monitor. Handy for tracking bandwidth and CPU usage. Apparently animating in the menu bar is a no-no these days but I find it useful.

Dropbox and Cyberduck for accessing remote files. Dropbox is a marvel, particularly good for sharing files with your iPad. I’m not wild about Cyberduck but it does a decent job with SFTP and is free. If I did a lot more of this kind of file sharing I’d look into Transmit.

Adium, a multi-protocol instant messenger. Now that iChat supports several protocols it’s less necessary, but it’s nice that Adium does IRC too.

Twitter, an interface for Twitter. I like having it open instead of visiting the site a couple of times a day.

Reeder, an interface for Google Reader. I love the iPad app and so far am liking the Mac app as well. Google’s web interface is good too but the native app feels cleaner and faster.

Skitch, a screenshot tool. Makes life easier when taking a lot of screenshots and the integrated web upload is handy.

Sublime Text 2, a text editor. I’m still evaluating this, the other contenders are TextMate, BBEdit, and TextWrangler. I like Sublime because it’s simple, just a text editor and not an IDE-wannabe. Also it’s under active development; I’m not about to drop $60 on a text editor that hasn’t even bothered to work right on Lion.

iTerm2, a terminal emulator. I don’t really know why this is so much better than Terminal but everyone else seems to love it, so I use it instead.

Homebrew, a Unix package manager. Makes it relatively easy to download and compile the random Unix programs MacOS is missing. Alternatives are MacPorts and Fink, the experts I trust all say Homebrew is better. I sure miss Apt and the robust Debian software library.

There may be discussion on Google+

Stats on MacOS as a gaming platform

Some interesting stats on MacOS and gaming, from Valve’s Steam hardware survey. The population is self-selecting but somewhat representative of the gamer community. Steam has been available on the Mac since May 2010.
  • 5% of Steam installs run MacOS.
  • 48% of Macs are MacBookPros. 31% are iMacs.
  • The most common GPU (24%) is the NVidia 9400M. Or not: the MacBook Pro contained both a 9400M and a 9600M GT and Valve may not report that accurately. This benchmark database says the 9400M is dog slow but the 9600M is somewhat reasonable for low-end games.
  • 29% of Mac users have 512MB of VRAM or more (compare 86% of Windows users)
  • 74% of Mac users have 4GB of RAM or more (compare 52% of Windows users)
What does this mean? 5% is a tiny minority of desktop computer gamers. And very few of those 5% have serious gamer graphics capabilities. Given that, it’s hard to see how it’s cost effective for mainstream games to support the Mac. No surprise, honestly, but there’s some data to back up the assumption.

I’m loving my new Mac but I’m coming to the conclusion MacOS is not suitable for an omnivorous gamer. Blizzard and Valve have both committed to the Mac but most PC games never make it over and the few that do are often low quality ports that come out months late. And graphics libraries are a mess. Of course DirectX is a non-starter, but even OpenGL and OpenCL support are years behind.