bentomas.com

Setting up my Mac after installing Snow Leopard

I know there are a lot of these going around, but I’d figured I’d throw in my two cents anyway.

If you are reading this in a feed reader, you might want to click through because I have some code examples that aren’t rendering right (in Google Reader at least). I’m looking into it, but it isn’t fixed right now.

Installation

On Monday, even though Amazon did not ship my Snow Leopard disc in two days like it said it would, with the help of a friend I was able to finally upgrade!

Whenever upgrading my operating system I like to go the erase and install route. In fact, I generally try and do this one or two times a year. I find that as time goes by, and I try out new programs and the like, that a computer just generally fills up with crud. Also, I have a tendency to get entrenched in my ways, and completely erasing everything gives me a chance to properly evaluate my organization and methods.

The first step (and the most important!) when doing an erase and install is properly backing everything up. These days, with Time Machine, this is a pretty easy step. A few years ago before I had a DVD burner, it was a MAJOR pain in the ass. Plus, I have moved most of my super important irreplaceable files off of my computer to my Drobo which has itself some good lovin’ redundancy.

Actually installing Snow Leopard was quick and easy. Well not super quick, I did have time to go to the library and back. And not super easy, because they removed the ‘Erase and install’ option, but I didn’t remember this and clicked ‘Install’ thinking more options would be coming. So, I had to cancel the installation and then restart.

Booting into Snow Leopard for the first time was pretty anti-climactic. Not a whole lot is different! In fact, as far as my everyday usage goes, the only thing I notice is Quicktime. I’m glad I read Jason Snell’s quite lengthy review, because it made me pretty excited about an upgrade that didn’t have a whole lot in the punch-factor.

Preferences

The first thing I always do when I get a fresh install up and running is go through every preference I can get my hands on. Some of the more notable prefereces I change:

I treat my Desktop as a staging area where files and links sit until I do something with them or read them. As such I collect a lot of files and in order to keep them organized I created a background image with different sections to put files.

To get finder to show the full path of the current directory in the title bar:

 defaults write com.apple.finder _FXShowPosixPathInTitle -bool YES 

To get the dock to look simpler:

 defaults write com.apple.dock no-glass -boolean YES 

To get the dock to stick to a corner (so you don’t have to guess where the trash is):

 defaults write com.apple.dock pinning -string end 

Applications

A few years ago, reinstalling applications was not the simple process it is today. I find that generally speaking most of what I do on my computer has now moved to two applications: Terminal and Safari. It may not look short, but this is quite a bit shorter than it used to be…

Everything I mention below is working fine for me in Snow Leopard.

There is one very notable application missing from this list: Quicksilver. I used to be a HUGE Quicksilver fanboy. These days I use Quicksilver for two things: Launching applications and resizing images (via its Image Manipulation plugin). The former Spotlight can do and the later I can do in the Terminal via ImageMagick. I am always looking for ways to keep the number of running applications to a minimum, and this time I decided to axe Quicksilver. I tried this last October too, but eventually installed it. We’ll see what happens this time.

Setting up my development environment

I decided to switch things up quite a bit this time after reading an article on Development Virtual Machines. The article goes over creating an Ubuntu virtual machine in VMware Fusion that you can SSH into and do all your development there. There are a couple advantages to this system:

It isn’t the easiest thing to set up, and I actually had to try a couple times before I got a virtual machine properly working the way I wanted it to, but now that I have it I don’t regret it!

That being said, there are still a few things I have installed on my Mac:

I finally got around to learning about configuring the tools I use on the command line. Some resources I used:

That said the coolest, best, most amazing thing I found out about was SSH aliases! Put the following in a file called ~/.ssh/config

Host nytimes
  HostName staging.nytimes.com
  User developer

Host nytimes_production
  HostName nytimes.com
  User developer

And now you can type ssh nytimes to SSH into that server! Amazing! This is particularly nice if you have to SSH into a custom port (which you should be doing if you can change it). And these work for the scp command, too! Needless to say, I am very, very excited about this.

My zsh configuration isn’t as interesting. A few notable lines:

# misspell a command?  This will suggest a correction.  Useful if
# can't quite remember the right name
setopt correct

# use vim key bindings on the terminal.  With this you can hit esc
# and then use vim commands
bindkey -v

# this alias makes it so you can open multiple files at once and
# they will all open in individual tabs
alias vim='vi -p'

The Vim configuration is where I really went to town. A few notable lines:

" This makes there be a bar before the command line at the bottom
" and the bar says the file name.  I have always been frustrated
" about not being able to tell the name of the file I am editing
" in the terminal
set laststatus=2

" This enables you to search for any files contained in the
" current directories or its subdirectories, by a regular
" expression.  pure genius!
" http://weblog.jamisbuck.org/2008/10/10/coming-home-to-vim
let fuzzy_matching_limit=10
map <leader>t :FuzzyFinderTextMate<CR>

" I don't remember where I got this one, but this allows me
" to hit \r to search for the documentation for the current word.
" ruby only, but it would be pretty easy to add for php.
let g:browser = 'open -a Safari '     
" Open the Ruby ApiDock page for the word under cursor, in a new Firefox tab
function! OpenRubyDoc(keyword)
	let url = 'http://apidock.com/ruby/'.a:keyword
	exec '!'.g:browser.' '.url.' &'
endfunction           
map <leader>r :call OpenRubyDoc(expand('<cword>'))<CR>

" Tab completion options
" (only complete to the longest unambiguous match, and show a menu)
" This makes it so looking for files in vim behaves more like in
" a terminal.
set completeopt=longest,menu
set wildmode=list:longest,list:full
set complete=.,t

The only thing I still have to do is find a nice template for Vim. With the default one that is loaded in Terminal it is hard for me to tell where the cursor is when I am on a search result. I tried some popular ones that have a black background but the background didn’t show up in the Terminal (just in MacVim) which made it hard to read since it had light text. I’ll figure it out though!

That’s all I got for now!

Impressions

All in all I am very happy with the new set up. I’ve only been using it for 3 days though, so I won’t be able to really say how useful it is for another month or so.

As far as Snow Leopard goes, I am pleased so far, in that I was already extremely pleased with Leopard. My only complaint is that the new Quicktime automatically starts playing videos from the internet once they have buffered enough. And as we all know, autoplay is the devil. This seems fairly obvious to me, but if you are going to have it, it seems even more obvious that if the window isn’t the frontmost window, or the application isn’t even the frontmost application, THEN DON’T START PLAYING A MOVIE. The only place I really run into this is when I buffer a bunch of trailers from Apple.com to watch at once. So it isn’t a huge deal.