Monday, December 8, 2008

MenuMeters & Text

Lots of OS X geeks I know use Menu Meters to monitor the goings on for their machines. But here's a nuance that remembered last week, watching one of my colleagues give a presentation. I can't remember exactly where I heard (overheard?) this, but apparently it's quite relatively expensive to paint letters and numbers on the task area of the menu bar as opposed to graphics. Not sure why, and it may just be a rumor, but in any case, I tend to keep the graphical version of the CPU meters up, not the numeric one, just in case.

Wednesday, November 19, 2008

Open in Terminal (4 Ways)

One of the cool little helpers I talk about in The Productive Programmer is "Command Prompt Here" or "Bash Here": little context menu items for Windows that allow you to select a folder in Explorer, right click, and open a command prompt (or bash shell, if you are using Cygwin) at that location. Someone recently asked me if you can do this on the Mac, and it turns out you can, in a surprisingly large number of ways.

The first way leverages Automator to create a little script that makes an Automator plug-in for Finder. This trick appears here. The cool thing about this tip is the stuff it teaches about building Finder extension via Automator, which is a pretty cool subject unto itself. However, the bad thing about the final solution proffered by this tip is the location where the context menu appears: 2 levels down in the right-click menu, under Automator. Too much clicking.

Not being satisfied with the above, I found an alternative, which creates a toolbar icon at the top of Finder that opens the current selected folder (or the folder of the currently selected file) when you click on it. This trick appears here. The only downside of this version is the number of windows it spawns: one per request, instead of opening new tabs (it was created before Terminal supported tabs in Leopard). So, not to be outdone, the author describes the steps to upgrade it to tabbed terminal in Leopard here. One gotcha exists in his instructions: he says to replace the original script with the one found on this page, but I assumed you could do that with a text editor. It turns out that you need to use the script editor that launches when you double-click the main.scpt file. Otherwise, it works like a charm.

The reason I haven't pursued this before on the Mac? I generally use PathFinder, which includes not only a context menu for "Open in Terminal", it also has an embedded Terminal, which opens in the current folder. Highly recommended, but it you don't want to spend the money, you can get the same effect by harvesting the links in this entry.

Tuesday, August 19, 2008

The New Backup Strategy

Before Leopard, I had a specific backup strategy for both my volatile content (things like source code, documents, etc) and my entire hard drive, which was a snapshot backup. The volatile documents solution was Subversion, kept on a remote, universally accessible machine. The snapshot backup was handled by SuperDuper, which backs up your entire drive in a bootable state, essentially creating a complete snapshot of your hard drive. A couple of problems reared up because of this setup.
  1. I had to handle the "package" files (the ones created by Apple iWork, like Keynote and Numbers) files specially, because Subversion didn't like the way the applications managed the contents. Basically, I had to zip/unzip them for version control. This wasn't terrible (I automated the process to a large degree), but still a little annoying.
  2. My Subversion repository was huge, because I had my entire Documents folder in it. However, most of the documents were there just so that I could have a backup, not because I wanted to version them. The only files I really versioned where the source files and related content.
The advent of Leopard and Time Machine changed my strategy. First, I separated out the Documents stuff for which I really only wanted backups and let Time Machine handle them. I put all my versionable files (like source files) in a new, much smaller Subversion repository. And, even though I have Time Machine, I still use SuperDuper to create backups. The reason I use both:
  • I want the hourly, behind the scenes backup provided by Time Machine.
  • I want to be able to browse backwards in time to look at previous versions of those files, and the Time Machine UI is gorgeous for that.
  • Time Machine alone isn't sufficient. To restore from Time Machine, you have to boot your machine from a startup disk, then restore the backup. Yuck! I still like SuperDuper's snapshot approach, which I've proven to myself works flawlessly (see Don't Crack Open Your Mac for the story).
  • SuperDuper and Time Machine can share the same drive, so I have a single 500 GB drive that has all my backups on it.
  • It's now easier to replicate the source code in more places (IOW, more machines) because it's much smaller.
  • You can tell Time Machine to only backup certain directories (or, more specifically, exclude directories you don't want backed up). Because I only use Time Machine for my Documents folder, it takes only a little space.
  • Because SuperDuper creates a bootable drive image, and my external drive is FireWire, I can boot another MacBook Pro with the external drive. Yes, it's slow, but if the worst happened while on the road, and I've got to present at a conference, as long as I can borrow/steal another machine, I can boot into my machine from backup and do my presentation.
I've been using this approach for a while, and it works nicely. I leave the external hard drive hooked up all the time, and start a snapshot backup at bedtime every night. SuperDuper has a nice option that will sleep the computer when it's finished it's work. So far, this it working out really well. I haven't had to restore the whole drive from SuperDuper yet on this machine (but I know that works -- I've done it on other machines), and I have used Time Machine to grab a file that accidentally got deleted.

Monday, August 11, 2008

Keyboard Zoom

This is a re-blog from Jack Dempsey, setting up a keyboard shortcut to Zoom.

This works well because almost all Mac applications include the Zoom menu item on the Window menu.

Thanks, Jack.

Thursday, August 7, 2008

Quick Blank

This was left by Emilio as a comment to the Quick Sleep entry from before, but I'm afraid not enough people read the comments so I'm promoting it to full-blown entry.

The keychord CTRL-SHIFT-EJECT instantly blanks the screen, without invoking the screen saver. It's just instant blank. Note that it will not lock the screen if you have passwords turned on for the screen saver, it just makes the screen blank. Still, pretty cool.

Saturday, August 2, 2008

Keynote Mode for Keynote

Several people have asked me how to turn on Keynote mode in Keynote. Keynote mode is where the presenter sees a different view from the audience. In Keynote, you can set up a mode that allows you to see the current slide, the upcoming slide, the time of day, the elapsed time from when you showed the first slide, and the "ready to progress" bar (a red/green bar at the top of the screen that lets you know that all the transitions have completed successfully). To get Keynote mode to work, you must set a particular set of options in Keynote preferences, and getting the combination is just rigth is tricky (especially if you aren't connected to a projector). To show the magic combination, here are the settings I use. First up, the Preferences dialog that controls what you (the presenter) sees:



The other settings appear on the the Slideshow Preferences dialog, shown here:



This is the dialog that controls Keynote's projection options. The important options here are the Allow Epose, Dashboard, and others to use screen, which allows you to see the mouse cursor and interact with the screen even when slides are showing, and the Present on secondary display, which uses the projector (i.e., the external monitor) to show the slides.


There are a couple of caveats to using Keynote mode. First, you must un-mirror your display (found on Display Preferences, under System Prefereces). I usually use the option in Display Options to place them on my menu bar, so that I have easy access to the Display Prefereces. When you un-mirror your display, it is exactly the same as using an external monitor. That means that you can't really do code demos and such unless you want to look over your shoulder. That's why most of my slides how have source code embedded on the slide, so that I can use Keynote mode.

Wednesday, July 23, 2008

Quick Sleep

Here's a quickie, but I showed this to Venkat, and it made his day, so chances are good that others don't know about this handy keyboard shortcut. I used to always rely on my PowerBook to go to sleep successfully when I close the lid. But every once in a blue moon, something doesn't work right, and I open my laptop bag to a red-hot laptop. I suspect that it's latch related (and several other folks have suggested that this was the case). Now, I've taken to putting my machine to sleep before closing the lid. There are of course a variety of ways to do that; my recent common one was to hit the power button, which gives you the shut-down options dialog, and sleep is one of them. That's what Venkat's been doing.

But I recently ran across a better combination: Apple-Alt-Eject provides instant sleep (the Eject key is the one that ejects CD's, just above the delete key). One keyboard chord, and I have a sleeping laptop. I love it when I can cut a 2-step process down to a single keychord!

Thursday, July 3, 2008

Mmmmmmmm...Fresh Apps

One of my ThoughtWorks colleagues turned me on to this one. Most Mac OS X applications check for updates on startup (so many, in fact, that I'm surprised when I let something that doesn't do this get out of date). But each application has to do this on their own. That's where AppFresh fits. From the site:


AppFresh helps you to keep all applications, widgets, preference panes and application plugins installed on your Mac up to date. All from one place, easy to use and fully integrated into Mac OS X. AppFresh works by checking the excellent osx.iusethis.com for new versions and lets you download and install available updates easily.


Not only does it find the applications you need to update (which they mostly do themselves...mostly), AppFresh also handles the chore of downloading the DMG file, extracting it, mounting it, installing the application, and unmounting. No muss, no fuss. You just tell it to update an application and Voila...it's updated.

Saturday, June 28, 2008

Pimp my shell


When I switched over to Ruby development, I said goodbye to Eclipse and IDEA. I was never one to shy away from a terminal so the transition back to a text editor (I tend to use TextMate and ViM) and iTerm was an easy one.



At ThoughtWorks I worked on one client project at a time, and maybe one or two open source ones. Now at Relevance there are weeks when I work on four client projects and a half dozen open source projects (thanks to open source Fridays). To make things more difficult, I've got a mix of Subversion and Git projects.



To ease the transition back and forth between projects I:



None of these was especially difficult but each of them has improved my shell environment. Thanks to Alan Cooper and Edward Tufte, I am beginning to understand that good usability doesn't necessarily require difficult technical solutions. Indeed, coming up with each idea and a seamless UI for it was harder than implementing it.



The features described above came down to making my shell environment:


  • Tell me about my current context.

  • Adjust based on the context.




I think that part of the reason we use MacOS is because it does some of this for us. It changes the menus based on which app is in focus. CoverFlow gives us a visual indication of where we are in the stack of files we're looking at. Maximizing a Safari.app window only maximizes it as far as it needs to in order to horizontally fit the content.



What else do you think your shell environment should do for you? Why?

Wednesday, June 25, 2008

Opening emailed Office documents

How hard can it be? I upgraded to Office 2008 SP1 on my work laptop (I only use iWork on my home machine) and now I can't seem to open Microsoft Office documents that have been emailed to me. How could they break this? Well, long story, and I'm actually more interested in fixing it. So, following these steps did it for me:

* Download MisFox, then double-click on "MisFox.prefPane" to install
* In the MisFox system preferences pane pick the File Mappings tab
* Scroll down the list till you find "Word Document" and the .doc file extension
* Double click on that line to open the editor
* Set the Creator Code to MSWD and the File Type to W8BN
* Check "Resource Fork is Significant"
* Repeat last steps for Excel, setting the code to XCEL and the type XLS8
* Repeat for Powerpoint, setting the code to PPT3 and the type to SLD8

Thanks to my colleagues at ThoughtWorks for figuring this out.

Wednesday, June 18, 2008

Unexpected utilities

There are many things on the Mac that just work so well that you hardly think about them, never mind looking for a utility that improves them. And then you stumble across a utility and after a short while you wonder how you lived without it before...

One of these areas is unarchiving. You just double-click the archive file in Finder and something runs in the background that opens it. What else would you want? Turns out you want The Unarchiver. Not only does is support more archive formats, including the dreaded StuffIt ones, but it also deals with the already supported ones better.

Another area is software update. Apple's Software Update works well, the big packages from Adobe and Microsoft have decent updaters, and, more surprisingly, most application written by indie developers have good and consistent update functionality. The latter is actually thanks to the excellent Sparkle framework. If you are a developer check it out. That said, what else could you ask for? Download and use AppFresh for a while and you'll know.

Friday, June 6, 2008

Widening Columns

One of the things I find myself doing all the time is making columns wider in Open and Save dialogs. I have a bunch of file names that are really long (the downloadable names of my presentations), and I find myself grabbing the little handle at the bottom of the column a lot to widen the column. Last month's MacWorld to the rescue. You can double-click on the little abraded area at the bottom of the column and it will resize the column to accommodate the longest file name.

Going one step further, you can right-click on the abraded area and get a pop-up menu that lets you choose one of three options: Right Size This Column, Right Size All Columns Individually, and Right Size All Columns Equally, as shown here:


Try as I might, I couldn't get a keyboard shortcut to stick for this (normal keyboard shortcuts don't seem to work in Open and Save dialogs). If anyone can, I'll be grateful. But this is good enough: rather than resizing by hand with the mouse, I can let if figure out the correct size (alas, still with the mouse).

Saturday, May 24, 2008

Scrial Consistency

scrial consistency logoAbout a decade ago, I worked with a colleague (named Terry) who was obsessed with finding the right way to organize his day. He and I had long digressive conversations about how best to manage tasks, calendars, email, etc. During that time, I studied things like the Covey method heavily. One of the enduring things I took from the Covey stuff was the distinction between the urgent and important. Lots of things are both, but there are some things in life that are urgent but not important and others that are important but not urgent. Terry and I discussed this category a lot, because busy people tend to ignore that quadrant the most.

Fast forward to today. I don't use the Covey system any more because it does not match my work habits well. I've struggled for a while putting together an effective way to handle my increasingly complex ToDo lists. I keep finding some applications that handle parts of what I need well, but fall down on other parts. For example, I've been using TaskPaper for a while, which I like because it's very simple, text based, and lightweight. But the thing that TaskPaper doesn't do well is handle the semi-recurring stuff, like haircut or dentist appointments: recurring appointments that fall into the "I need to do this 6 weeks after the last time I completed it" category. For that, I've been using a special purpose tool called Sciral Consistency (commercial, with a "try before you buy" option). It's not really a ToDo list manager so much as way to handle that specialized relationship between semi-recurring tasks and calendars. The Sciral Consistency site says that it handles the following types of conditions:

  • They don't have deadlines or rigid time intervals associated with them.

  • In order to gain and retain their benefits, you must perform them on a regular basis over a long period of time.

  • The ideal amount of time that elapses between completions of a particular task are unique to that task. To gain the maximum benefit you shouldn't do them too frequently or infrequently.

  • They can be carried out by you with minimal or no coordination with other people.

  • They are often “routine” tasks for which you have not firmly established a habit of carrying them out as second nature.

  • They are (in the words of Stephen Covey) “important, but not urgent.”


Sciral Consistency handles these things using a unique calendar view, which looks like this (also from their site):

sciral consistency screen shot


You create tasks with threshold values: after I finish this task, I need to do it again between 10 and 14 days from the finish date. You can have a bunch of these calendars. Like the last bullet point says, it is great for handling recurring "important but not urgent" tasks. I've been using Sciral Consistency for a while, and it serves me well.


I'm still on the lookout for a comprehensive solution. Recently, I've become mostly addicted to OmniFocus, a great GTD inspired task manager, which somewhat handles this special case. I haven't succumbed to the GTD religion, but like the Covey stuff before, I've assimilatedwhat I consider the good parts and made them part of my routine. I'll say more about OmniFocus once it has sunk into my work habit.

Monday, May 5, 2008

Unsafe Sleep

One thing I really liked about my PowerBook Pismo was its instant and super reliable sleep/wake functionality. In contrast the new MacBooks are slow as molasses and sometimes fail to wake up at all, at least for me.

One feature that is responsible for the MacBook to take a long time to sleep is SafeSleep. Basically, whenever you put your MacBook to sleep it saves the entire contents of its memory onto the hard drive, usually into /var/vm/sleepimage. It does so to ensure that no data gets lost even if the battery runs out while it is asleep. This hardly ever happens to me, and even if it did I wouldn't mind because I generally don't keep unsaved documents open. So, for me SafeSleep is a waste of time and energy, because it does cost battery to write all that memory to the hard drive, as well as disk space for the sleep image file.

If you haven't seen the wake up progress bar you might also be interested in turning off SafeSleep. But how? Apple decided not to repeat the Vista sleep fiasco and chose what would be the most useful functionality for 95% percent of their users; and not to confuse anyone, they decided against offering an obvious way to change it. That said, OS X is extremely modular and of course there's command line access to configure how you want your MacBook to sleep. Without further ado:


[499 ~] pmset -g
Active Profiles:
Battery Power -1
AC Power -1*
Currently in use:
sleep 60
sms 1
acwake 0
displaysleep 30
autorestart 0
hibernatefile /var/vm/sleepimage
hibernatemode 3
womp 1
halfdim 1
disksleep 10
lidwake 1
ttyskeepawake 1


You can see where it keeps the sleepimage and you can see that hibernate mode is set to 3, the default for new MacBooks. What I want is for my MacBook to never write its memory to disk.


[501 ~] sudo pmset hibernatemode 0
[502 ~] rm /var/vm/sleepimage


Now I have 2 gigs of disk space back, and I have near instant sleep; at the price of losing some work under circumstances which are unlikely for me.

More details and more fine-tuning possibilities are described here.

Wednesday, March 19, 2008

Secrets!

The creator of Quicksilver has created a new little power-user goodie called Secrets. It allows you to tweak a bunch of internal settings for Leopard all from one nice, consolidated place. It reminds me of TweakUI for the Mac, but with slightly more fundamental control. It is basically a UI for user defaults for all sorts of applications.

Sunday, February 10, 2008

Better Menubar Shortcut

It seems that Leopard broke one of my favorite Quicksilver magic tricks, documented here, which allows you to access the topmost application's menus through a Quicksilver trigger. It seems to work only with a few applications now, and intermittently at best.

The next best thing is the incremental search of the menu bar, where you get the cursor up onto the menu bar and type the first part of the menu you want, hit enter when it highlights the correct target, then incrementally search for the leaf item you want. Rinse and repeat. The only problem is the shortcut key to get up to the menubar: CTRL-F2, which is cumbersome on my laptop.

I'd rather light a candle than curse darkness, so I remapped it to CTRL-ALT-APPLE-SPACE (which are all together). This sounds like a horror, but it's really easy, and that combination wasn't taken by anything I can find. Until Quicksilver fixes the application proxy stuff, this is the next best thing.

Virtually instant update: Apparently Jason was sitting with his computer on, hitting the refresh button over and over on this blog, because he posted this comment almost before I finished the first entry. This link shows how to use a help hotkey for an alphabetized, incrementally searchable list of menu command in Leopard via the new help system. I added it here in case the comment didn't get read by everyone. Thanks, Jason!

Friday, February 1, 2008

Path Finder

For simple file manipulation, I tend to use Quicksilver (the universal solvent). However, when it comes time for heavy lifting, I turn to Path Finder. This is a hugely useful Finder replacement, even the new, improved Finder in Leopard. It has tons of useful stuff. The cookie trail of where you are in the directory structure? Path Finder has had that for a while. And, you can right click on it and copy the path in a bunch of different formats (UNIX, HFS, Terminal, Windows, etc). And you can click on it to get to the underlying contents of the path. It's tabbed, so you can drag and drop from one tab to the other.

It also has the best (which is damning with faint praise) Subversion client on the Mac (still no Tortoise for the Mac -- rats!). You still have to do serious stuff from the command line, but the Subversion client in Path Finder is great for simple stuff. And yesterday it saved me about 15 minutes of bash hacking because of the "Change Extension" command, which allows you to bulk change extensions of files.

My wife moved (evolved?) from Windows to Mac, and she found Finder too limiting compared to Windows Explorer. But she loves Path Finder. It's one of the first things I put on new machines.

Wednesday, January 23, 2008

Leopard Spots: Paste from Finder to Terminal

Actually, I don't know if this is a new Leopard thing or not, but it's massively useful. The other day, I needed to move some JAR files from one place to another, and I already had my trusty terminal window open on the destination directory. I wasn't sure which ones I needed in the giant pile in the source directory, so a wildcard expedition in Quicksilver didn't seem like the right way to go. So, I went to Finder and visually sighted the 4 files I needed. Wouldn't it be nice if I could just copy and paste them into the terminal? Why not try? So I did. Now, it didn't copy the files, but it did give me fully qualified path names to each of the files, separated with a space. A quick "cp" added to the front and an " ." added to the end, and they're copied. I don't know if Finder has always allowed you to copy and paste fully qualified file names, but it sure does now.

Tuesday, January 15, 2008

Heist!

Once a year, the MacHeist web site comes out with a bundle of a bunch of Mac software, with  a bundle price much lower than the sum of the individual products. And they only offer it for 2 weeks. We're already 1 week into this year's MacHeist, and it has come great software in it (including 1Password, which I talked about in an earlier post). The applications this year:

  • 1Password
  • CoverSutra
  • Cha-Ching
  • iStopMotion
  • Awaken
  • Speed Download
  • AppZapper
  • TaskPaper
  • CssEdit
  • Snap Pro X
  • Pixelmator
I use 1Password, Speed Download, AppZapper, and Snap Pro X all the time, and the combination of those applications alone is worth the heist price of $49. Check it out -- it's a great deal.

Monday, January 14, 2008

Drowning in Receipts

This is probably only useful to those who travel a lot with expense accounts. I generate lots of receipts. One of my former co-workers was diligent about scanning or copying all his receipts and keeping the originals, so that he never had to worry about the US Postal service eating them. Good idea, but too labor intensive.

Recently, I was talking to another of my colleagues this very topic. He had a clever trick: he carries a portable scanner with him. That allows him to scan the paper receipts as soon as he generates them, then he has multiple copies; he can send them in with expense reports via email, and he always keeps a copy. Sold! The only problem was that he was using NeatReceipts, a hardware/software combination that only works on Windows.

After a little research, I ended up buying this light, portable scanner from Amazon. For software, I use either Preview (yes, it can act as a TWAIN device to capture scanner input) or GraphicConverter, my preferred Swiss-army chain-saw for image manipulation. I scan the receipts as PDF, then combine all the files (using Acrobat, the full blown version) to create a nice little receipts package for expenses. This is great for me because I have a terrible time keeping up with the little scraps of paper.

One Password

Generating and keeping track of hundreds of strong passwords is a giant pain. I've used several different schemes in the past (and software to manage it), but haven't found a good alternative for the computer + iPhone situation...until now. When I got my new laptop, I tried 1Password (commercial), based on a review I read somewhere. I was hoping just for good password generation and browser plug-ins, but it has one great trick up its sleeve that I hadn't anticipated: synching with the iPhone.

No, it doesn't hack the iPhone and install an application. It writes a password protected web page to the file system on the iPhone, and you access it through the browser. So, the URL you look at starts with "file:///", but it acts just like a web page on the phone. 

I haven't tried many of the other similar applications, but it seems to have a pretty killer combination of password storage, strong generation, and synching. And, they are beta-ing a service to securely keep passwords on their site so that you can access them across machines. I'll have to see what that looks like when it appears, but I'm pretty happy even without that.

Thursday, January 10, 2008

Scary Screen Mode

One of the joys of using a laptop is portability. But as anyone who has tried to use a laptop outside in the sunlight knows, the screen is hard to read.

Which brings up this keyboard shortcut: CTRL-OPTION-APPLE-8, which switches to "inverse" mode. Basically, it inverts all the colors on the screen. Try it -- I'll wait. Notice this this is "8", not "F8".

See? Scary, huh? Great for using your laptop outside, though.

Wednesday, January 2, 2008

Calendar Madness

I've been trying to coordinate my calendars for a long time. My wife has her calendar and of course I have several of my own for all the traveling I do. For a while, I had iCal files hosted in a protected part of my web site. But that wasn't sufficient: several other people (who don't use Macs) also need access to some of my calendars, and I don't want to be in the business of permissions, software, etc. to make the old system work.

Then I found what I'm looking for: Spanning Sync. This is a commercial piece of software that automagically synchronizes iCal calendars with Google calendars. You can have as many calendars synchronizing as you want. It's licensed by Google account login, so now I can use calendars from any one of my machines and ensure that they all get synced (and that includes my wife's computer, which is using my same Google calendar account). And, I can selectively expose which calendars I want through the sharing mechanism at Google calendars.

The initial synchronization takes a long time, but after that it just runs in the lint bar, syncing on a regular basis (which is configurable). I've used it for about a month now, and it meets my goals: invisibly synchronizing all my calendars so that I have a single source of schedule information.

Now, if dopplr would only subscribe to Google calendar...