My good friend and hacker BP, with whom I have many real conversations, and even more imaginary conversations (then I call him Virtual BP or just VBP), recommends that when one moves to a new Mac machine, one ought to manually reinstall everything instead of using one of the fancy shmancy Time Machine imports. This is a hard way. And yet, I always listen to BP … and rarely defy VBP.

So I’m writing this to remind myself of how to go this hard way with minimal effort.

Preparation

The old machine should be backed up with Time Machine. Here’s a gotcha: in Time Machine, make sure there’s nothing you want that’s listed as an exception to the Time Machine backup under Options ....

It’s nice to take this time to clean up unneeded junk that’s accumulated. Think in terms of what you want to keep and not what you want to discard. Especially get rid of most things in Downloads and any cruft cluttering Desktop.

Set up the new Mac

I recommend using the same username as that used previously. Nothing should depend on that, but we’ve all hard-wired a full path before.

Install some foundations

The following foundations will help the installation of other components.

Chrome

For whatever reason I’m biased.

Dropbox

Sadly, 1Password requires this. I have more room on Google Drive, though.

1Password

It’s nigh impossible to set things up without a password manager.

.bashrc

From the Time Machine backup, bring in .bashrc and place it, as usual, in the home folder.

iTerm

Sublime Text 3

Get it here. Also install package control here. Finally, install LaTeXTools from here.

Configure the settings for LaTeXTools by traversing to the menu item Sublime Text > Preferences > Package Settings > LaTeXTools > Settings - User. Edit the line starting with "show_error_phantoms", to read as as follows.

"show_error_phantoms": "errors",

Homebrew

This is how I installed it before. Note that it doesn’t require a Ruby installation. In fact, we’ll use Homebrew to install rbenv (with a plugin called ruby-build) to install Ruby. Hold your horses.

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

rbenv

This is the package manager for Ruby I’ve been using. I use it to install Ruby. Here’s how to install rbenv and ruby-build with Homebrew.

brew install rbenv ruby-build

Ruby

Finally ready for Ruby! Here we go. Make sure .bashrc has the following lines (or equivalent)

if which rbenv > /dev/null;
  then eval "$(rbenv init -)";
fi
export PATH="$HOME/.rbenv/bin:$PATH"

Restart iTerm. Check rbenv installation with rbenv … should return version and usage.

Check the Ruby website to see which is the latest version. If it’s 2.3.x, check to which 2.3 versions are available with

egrep "^\s+2\.3\.\d+$" <(rbenv install -l) | tail -1

Let’s say the latest is 2.3.1. Then install that with

rbenv install 2.3.1

Now assign it as the default for everyone.

rbenv global 2.3.1

Now check the current version of Ruby.

ruby -v

If the version you expect is returned, success!

Some essential gems

Install the essentials.

gem install jekyll

Get homepage running

It should just work, but you may have file permission issues. If so, cd to the user directory and execute the following commands to change ownership and permissions.

sudo chown -R $(whoami) .
sudo chmod -R u+w .

I had to do this when Finder’s permissions listed my user as “Fetching …” indefinitely. Executing the above commands fixed it and let me build and serve with the following command.

jekyll serve

I had some issues getting Jekyll running, but my issues were entangled with upgrading from Jekyll 2.x to Jekyll 3.x. Eventually, everything was ironed out.

gnu command line utilities

This gives you nice things like gsort.

brew install coreutils

There are more to be had with this handy guide.

Python

Don’t trust the MacOS version of Python (but also don’t try to uninstall it). Just install with Homebrew (note that pip also gets installed).

brew install python

Python youtube-upload

This is another aspect of the video lecture capturing/uploading system. It depends on the Python script youtube-upload, which uses the youtube API to upload videos automatically. As of this writing, to install, first install the following dependencies.

sudo pip install --upgrade google-api-python-client progressbar2

Then clone youtube-upload to the ~/code repository, cd to the youtube-upload directory, and install via the following command.

sudo python setup.py install

There’s the final issue of OAuth. I believe this will work. Go to your Google API account and download the JSON file for your Client ID. Rename it client_secrets.json and place it at the top of the lectures directory. The first time it runs, you’ll be asked to verify in the browser with your Google account, but thereafter you’ll be good to go.

Other command-line tools

pdftk

This command-line pdf utility is great for manipulating pdfs. I like to use it for encrypting pdfs. The following doesn’t work right now, but hopefully will again, soon.

brew tap spl/pdftk
brew install pdftk

For me, the installation hung. However, the this link from this stackoverflow question works on macOS Sierra.

which pdftk
pdftk --version

trash

This allows moving files to the Trash directory from the command line.

brew install trash

Key software and settings

Adobe Illustrator

See the ~/software directory for installation files and details.

Template files

Wacom tablet

ImageMagick

This is a great command-line utility for converting photos, among other things.

brew install imagemagick

ffmpeg

This is key for my video lecture system. Install with homebrew with the --with-freetype option so the text can be overlayed on the screen (gives you the filter drawtext).

brew install ffmpeg --with-freetype

MacTeX

MacTeX has an installer that can be downloaded via the BitTorrent file distribution system.

nonfreefonts

To get fonts like uw-garamond, run the following command or see more here.

curl --remote-name https://tug.org/fonts/getnonfreefonts/install-getnonfreefonts
sudo texlua install-getnonfreefonts

Then update the “TeX filename database” with the following. It’s worth reviewing this documentation.

sudo -H mktexlsr
sudo -H updmap-sys --force --enable Map=newfont.map
sudo texlua install-getnonfreefonts

It I kept having an error updmap [ERROR] in which it couldn’t locate newfont.map, although the file was where it said it was supposed to be! I think the above sequence works, but I could be wrong.

Skim

This viewer’s alright, overall. I mostly like it for annotation and its SyncTeX capabilities. It works seemlessly with Sublime Text and SyncTeX.

MATLAB

See the ~/software directory for installation file and details. The 2015b bug that launches a Processing ... task when MATLAB launches can be worked-around by turning off the source control functionality in Preferences > MATLAB > General > Source Control.

Mathematica

Get the latest release from either UW’s or Saint Martin’s license.

Printers

The printer on the first floor of Cebula Hall can be set up with this guide.