Mac Setup

I recently had to reinstall a Macbook I'm using for work. Since some time has passed since the last time, and since I learned a couple of things since then, I decided to write down what I installed for reference.

1. Package Management - Homebrew

I have been using MacPorts for several years now. Although I never thought it was great, it got the job done. Homebrew is a competing project. It is much faster and robust, and uses /usr/local/ under regular permissions (no sudo'ing all the time). It has a nice supporting infrastructure and I could get it to install all of my essential software without any special intervention. For now it seems I'm not using Macports again ever.

Installing Homebrew, very much like Macports, requires Xcode to be installed.

You will want to install libreadline and ncursesw, because the ones supplied with Mac tend to cause issues. I couldn't find the brew formula for ncursesw, so I scraped something off the internet. Just dump this into a file, /usr/local/Library/Formula/ncursesw.rb:

require 'formula'

class Ncursesw <Formula
  url ''
  md5 'cce05daf61a64501ef6cd8da1f727ec6'
  homepage ''

  def install
    system "./configure", "--prefix=#{prefix}",
    system "make install"

and then just run brew install ncursesw

I also install htop (top alternative):

# brew install --HEAD
# sudo chmod 6555 /usr/local/bin/htop
# sudo chown root /usr/local/bin/htop

2. Essentials

The first thing I ever install in any Mac is Quicksilver. This is by far the most productive tool I've ever used, and I tend to use many plugins as well on a daily basis. Take some time to learn its advanced features. It will pay off.

The second is git (brew install git). All my config files are stored in git, so it makes sense.

Another thing is making sure a recent zsh is installed (also via brew), and making it my default shell. I then proceed to download and install my favorite zsh config - oh my zsh.

I make sure I have recent Python installations, with a working 2.x installation as my default (2.7 nowadays) and a working 3.x (3.2 today) installation. I also install the Haskell platform.

For a terminal, I am using iTerm2, which is loaded with awesome features. I set it up to act similar to Visor (open up from the top of the screen). It has a setting for that (show/hide iTerm2 with a system-wide hotkey) and then use a specific profile to pop up from the top of the screen with the desired attributes.

One small thing I had to change with iTerm is to make it properly send the escape codes for Ctrl+left/right/delete, which I use very often. I found a recipe that works here. Basically what you have to do is, under the profiles/keys settings tab:

I also install tmux, a terminal multiplexer (next-generation screen, if you will).

When accessing the laptop remotely, I usually use vnc (screen sharing) over an ssh tunnel. It is wise to add a rule to forbid vnc from anywhere but localhost to ipfw:

sudo ipfw add 01000 deny tcp from not me to me dst-port 5800,5900,3283,5988 in

3. Development Environment

I use Emacs from here, and install my emacs configuration (sorry, don't have it online yet).

4. More Stuff


blog comments powered by Disqus