Archive for the 'Apple' Category

making dot-files visible in MacOS X Finder

Like GNU/Linux, MacOS X treats files with names that start with a dot as hidden files. While "power users" will have no trouble accessing these files using Terminal.app or iTerm.app , it is sometimes handy to have them displayed in the Finder. A case in point: I recently wanted to restore a dot-file from a Time Machine backup, but the file was hidden in the Time Machine Finder window.
With some command-line-fu one can configure Finder to display dot-files:

   $ defaults write com.apple.finder AppleShowAllFiles TRUE
   $ killall Finder

To revert, simply flip the TRUE to a FALSE:

   $ defaults write com.apple.finder AppleShowAllFiles FALSE
   $ killall Finder

vnc://

I have been delighted to discover that not only does Leopard (MacOS X.5) have a built-in VNC client, it supports screen-scaling out of the box. Connect to Server (Finder >> Go >> Connect to Server, or Command-K) has a handler for the vnc:// protocol handler that invokes Screen Sharing as a VNC client.

Apple win again.

Macworld has an article that outlines the power of Screen Sharing as more than just a VNC client.

NSLog an NSString

NSLog(@"hello, %@", @"world");

mercurial error ‘ValueError: unknown locale: UTF-8′ on MacOS 10.5

Having installed mercurial via macports, any hg command fails with:

   <nasty Traceback snipped>
   ValueError: unknown locale: UTF-8

This is mercurial 0.9.5 and Python 2.5.1, but its seem that its caused by Leopard’s Term.app not setting the local encoding correctly. To resolve this, add the following to .profile:

   export LC_ALL=en_US.UTF-8
   export LANG=en_US.UTF-8

as noted in the mercurial mailing list.