Rebuilding The Operating System

I set out to rebuild the OS on my constant companion, the MacBook Air. It has been running OS X 10.10 upgraded from 10.9 and since I do a lot of weird things on it the cruft level was getting pretty high.

The first step was to back it up using Carbon Copy Cloner. Such a useful tool. This included backing up my usual boot partition and the one I had built to test 10.11 onto an external drive. No need to waste time on an OS install, though if you don’t have a known good install then do it from scratch.

I then booted into the newly cloned 10.11 on the external so I could wipe the internal SSD. God, the new version of Disk Utility is a disaster. The interface has been “dumbed down” so that an expert doesn’t get the information required and it’s still too difficult for most. This time it failed to either wipe or repartition the internal drive and gave so little feedback on the reason for failure it was useless.

I booted into the backup of my 10.10 partition and used the old Disk Utility. The drive had been a bit mangled so it no longer saw both partitions and Core Storage meant it didn’t show the SSD, just a single logical volume. Fortunately erasing the logical volume fixed that and I once again had a 256 Gb SSD. Phew.

Carbon Copy Cloner quickly had my 10.11 partition back on the SSD and it kindly offered to create a Recovery partition on the drive. Got to love a good tool.

The whole idea behind doing this is to end up with an exceptionally clean System so I’m not using Migration Assistant for anything and only installing applications as I need them, preferably from a fresh download.

On To Installs

First task was to install the Xcode command line tools to I can get git working as I also want to start putting my home folder stuff into a git repository. Downloading all of Xcode is tiresome as it is large and Apple’s servers never seem fast for the App Store, I only ever use the command line tools. If you run git from the command line it prompts you to start the download.

Next, TextWrangler to edit text and Markdown files. I’ve got an ancient license for BBEdit but I find TextWrangler good enough. I keep on flirting with Emacs (indeed it will get installed Real Soon Now) and Sublime Text but still use TextWrangler most of the time.

Here’s a list of the apps and utilities I find essential.

  • 1Password Absolutely essential. Not only does it store my passwords but also all the software licenses.
  • Alfred I don’t use it as much as some but I do like a good search and launch utility.
  • Bartender Nice utility that hides menu bar items until required.
  • Carbon Copy Cloner Just the thing for backups and cloning a working partition from one drive to another.
  • Dash Great tool for documentation and cheat sheets.
  • Dropbox Not only does it sync documents across all my devices (and provide backup) there are a number of Mac and iOS apps that sync settings across computers using Dropbox.
  • Evernote I use Evernote as a research tool. You can throw anything from anywhere into an Evernote note.
  • Flycut My clipboard utility of choice.
  • Chrome There are some sites and web tools that don’t support Safari.
  • Karabiner With Seil it is responsible for looking after my keyboard hacks such as turning my caps lock into Command-Option-Control.
  • Keyboard Maestro The keyboard master. Nothing better for turning a single keystroke into a powerful command.
  • Marked 2 It provides real time preview of Markdown and a great export capability. If you aren’t going to use Emacs and pandoc you want this.
  • nvAlt The best tool for quick notes. Hard to explain exactly how it works but it is so handy.
  • Patterns A great tool for developing and testing regular expressions, and who doesn’t need that.
  • Pixelmatr My favourite tool for photo correction.
  • PopClip A great tool to manipulate or use the currently selected text. Change case, search on Wikipedia or shorten a URL using Bitly.
  • Neil Required for some deep keyboard hacks by Karabiner.
  • Slack Got to talk to people.
  • TaskPaper My current effort to keep track of things I’ve forgotten to do and overdue promises. Actually I’ve used TaskPaper for many years as I like simple.. Quite a number of other tools can read or write to TaskPaper files.
  • TextExpander The best text shortcut tool there is.
  • TextWrangler The most useful text editor I’ve found, if for no other reason than it’s command line tool edit supports the +n open at line number syntax all the old Unix tools use. That’s a hint for the developers of Sublime Text.
  • The Unarchiver For the archives the Mac doesn’t quite handle. The site also has a command line tool to do the same thing.
  • TotalSpaces2 Turns the Mac OS Spaces feature into something useful. Requires turning down SIP to get it to work in 10.11 but I like it too much to not do it.
  • VLC For your video playback needs. VLC plays anything.
  • VMWare Fusion Sometimes you just can’t avoid Windows. I also have a couple of Linux VMs for building and developing servers. They usually end up on Amazon Web Services but I build and test locally first.

Wow, that’s a fair list.

The Terminal’s Friends

I spend a great deal of time at the command line so it is important to get bash and Terminal working at a fine pitch. A number of small changes and utilities to get them just right.

First is HomeBrew. The first task for HomeBrew is to install the gnu coreutils package. For one it has a much nicer version of ls with good file colouring. Seriously, there are a number of differences between the tools installed by Apple and the Gnu/Linux versions. So that various tips and tricks work you install these tools. They are all prefixed by g to avoid a clash with the installed versions.

I’ve also fallen in love with a little tool called z that offers major improvements to cd. Give it a try. It tracks your most used directories, based on ‘frecency’. After a short learning phase, z will take you to the most ‘frecent’ directory that matches the regular expression you enter.

Then Anaconda. Anaconda is an install of Python and a number of libraries and tools. The most important of these for me are IPython and Jupyter which provide a marvelous development environment. It also provides a tool, conda, as an alternative to virtualenv.

At this point I brought across my .bash_profile file and bin and dev directories from the old machine.

As a final step for the rebuild I then built a Git repo and pushed it up to Github to cover the important bits of the new home directory.

Setting Up The Apps

There’s always an hour or two of twiddling settings that are lost. I kept a document open in TextEdit and made notes as I went along to document what I set. For me the only really important settings are for the tools I live in, TextWrangler, Terminal and Safari. One suggestion from this process, change your default search engine in Safari to DuckDuckGo just so you can use bang search which allows you to quickly search a huge number of web sites from the URL field.

Set up also includes things like setting various tools to sync settings via Dropbox. This makes it easy to, for example, grab my macros for Keyboard Maestro and my passwords for 1Password.

Yak Shaving

OK, now for some real yak shaving.

Pandoc is an essential tool for converting from one text format to another. It requires MacTeX for full power so install that as well. The Pandoc documentation recommends the much smaller BasicTeX, about 200Mb instead of 2Gb, but I figure I’m going to end up doing a little bit of TeX hacking to get the best from Pandoc and that will require a bunch of stuff. Easier to get it all at once.

I install the Solarized colour scheme (give it a look, it has a deserved reputation for easy readabiity) for Terminal and vim, unfortunately the colour scheme format has changed for TextMate so you can’t get it for that, instead I use ‘Dusk’. By the way, using the ansi version of Solarized seems to work better than the xterm–256 one, certainly for syntax highlighting in vim.

I also install the Input font. I love it as it you can choose alternatives for various key characters and there are a huge range of styles. Free for personal use. I use the Mono style for code and the Terminal and Serif Narrow for my Markdown windows where I write. It’s rare to find an attractive variable width font with a slashed zero but Input is one.

Brett Terpstra offers mdless for MarkDown highlighting in a less clone for the command line. QLMarkDown adds Markdown support to QuickLook.

I also install the Gnu source-highlight package for syntax highlighting in less. I then add some lines to my .bash_profile to add highlighting in man.

If you want to see the results of my shaving then feel free to check out my .bash_profile file in my home Github repo. My .vimrc file, IPython setup and even my first steps at a .emacs file are in the same repo.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s