Monday, December 8, 2008
Wednesday, November 19, 2008
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
- 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.
- 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.
- 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.
Monday, August 11, 2008
Thursday, August 7, 2008
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
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
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
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
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:
- Got scm information in the bash prompt. This is something the git folks have been doing for long time.
- Abstracted out the scm commands I use most frequently. In other words, I can now type
svn up / git pullvs
svn commit / git commit && git push.
- Created an alias that takes me back to the root of my project by guessing it from the SCM structure.
- Showed the current project in iTerm's tab title.
- Displayed the previously executed command in the tab title (next to the project).
- Rounded out the tab title by alternatively showing the currently running command if one was currently running.
- Made it notice new projects as I checked them by implementing automatic aliases to project directories.
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
* 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
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
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
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):
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
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
Battery Power -1
AC Power -1*
Currently in use:
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
Sunday, February 10, 2008
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.
Friday, February 1, 2008
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
Tuesday, January 15, 2008
- Speed Download
- Snap Pro X
Monday, January 14, 2008
Thursday, January 10, 2008
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
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...