Install macOS

How to make that Mac feel new again.

Preferences and settings

Monospace fonts

Color palettes

Download the base16 templates:

Ocean is the preferred color scheme.

Download our and profiles.


r-exec enables the user to run R code directly from Atom.

apm install r-exec

Microsoft Excel

Change system defaults

# Unhide the user library
chflags nohidden ~/Library

# Speed up user interface animations
defaults write autohide-delay -float 0
defaults write autohide-time-modifier -int 0
defaults write DisableAllAnimations -bool true
defaults write NSGlobalDomain NSWindowResizeTime .001
killall Dock
killall Finder

# Don't write `.DS_Store` files to network storage
defaults write DSDontWriteNetworkStores true

# Save screenshots into Documents, instead of Desktop
mkdir -p "$screenshots_dir"
defaults write disable-shadow -bool true
defaults write location "$screenshots_dir"
defaults write name Screenshot
killall SystemUIServer

# Disable podcasts in iTunes
defaults write disablePodcasts -bool YES

Generate an SSH key pair

First, check to see if one already exists.

ls -l ~/.ssh/id_rsa*
# Remove existing keys
rm ~/.ssh/id_rsa*

Create a new keypair.

ssh-keygen -t rsa -b 4096 -f ~/.ssh/id_rsa -C <EMAIL>

On macOS Sierra, you have to enable keychain storage in ~/.ssh/config to save your passphrase.

Host *
    UseKeychain yes

Add the newly created private key to the macOS keychain.

ssh-add -K ~/.ssh/id_rsa

Copy the public key to the clipboard.

cat ~/.ssh/ | pbcopy

Add your newly created public key to the ~/.ssh/authorized_keys file of the remote server. Be sure to ensure the correct permissions of both the remote ~/.ssh folder (700) and ~/.ssh/authorized_keys (600).

Install Homebrew

Homebrew is an incredibly useful package and application manager for macOS. It requires Xcode to be installed first from the App Store. Then the default workspace environment can be set up using our custom script.

# Install Homebrew binaries and casks.

# Create sbin directory and set permissions.
sudo mkdir -p /usr/local/sbin
sudo chown -R $(whoami) /usr/local/sbin

# Install Xcode CLT.
xcode-select --install

# Install Homebrew.
/usr/bin/ruby -e "$(curl -fsSL"

# Here's how to uninstall Homebrew (for reference).
# /usr/bin/ruby -e "$(curl -fsSL"

# Update Homebrew.
brew update

# brew cask ====
# These apps have permission issues with non-admin accounts:
# - carbon-copy-cloner
# - dropbox
# - little-snitch
# - slack

# Priority
brew cask install java osxfuse xquartz

brew cask install 1password
brew cask install alfred
brew cask install aspera-connect
brew cask install atom
brew cask install authy
brew cask install basictex
brew cask install bbedit
brew cask install bibdesk
brew cask install coconutbattery
brew cask install coda
brew cask install docker
brew cask install emacs
brew cask install fiji
brew cask install firefox
brew cask install github
brew cask install google-chrome
brew cask install google-cloud-sdk
brew cask install google-drive-file-stream
brew cask install gpg-suite
brew cask install hazel
brew cask install igv
brew cask install iterm2
brew cask install keka
brew cask install kid3
brew cask install libreoffice
brew cask install omnidisksweeper
brew cask install onyx
brew cask install r-app
brew cask install rstudio
brew cask install safari-technology-preview
brew cask install skype
brew cask install spillo
# License is expensive. Use BBEdit, Atom, VS Studio Code.
# brew cask install sublime-text
brew cask install superduper
brew cask install torbrowser
# License is too expensive, use Visual Studio Code + GitLens.
# brew cask install tower
brew cask install transmit
brew cask install tunnelblick
brew cask install visual-studio-code
brew cask install vlc
brew cask install xld
# Note that v2.7.11 doesn't work well with wine.
# Install v2.7.9 directly instead.
# brew cask install xquartz
brew cask install wine-devel

# brew ====
# Homebrew now supports a global variable to force bottle installations.
# Alternatively, can use `--force-bottle`.
# See also:
# -
# -

# Use CRAN R (r-app cask) instead of Homebrew R.

# Priority
brew install flac lame tcl-tk

# Shells
brew install bash fish ksh tcsh zsh

brew install autoconf
brew install automake
brew install bash-completion
# Requires Java 1.7+.
brew install bfg
brew install ccache
brew install circleci
brew install cmake
brew install convmv
brew install coreutils
brew install curl
# Modern replacement for ls.
brew install exa
brew install exiftool
brew install ffmpeg
brew install findutils
brew install flac
brew install gcc
brew install gdal
brew install git
brew install git-lfs
brew install gsl
# Reinstall from source if you see this:
# Warning: hdf5 dependency gcc was built with a different C++ standard
# library (libstdc++ from clang). This may cause problems at runtime.
# brew reinstall hdf5 --build-from-source
# Otherwise hdf5 in R can have issues.
brew install hdf5
brew install hub
# --with-ghostscript --with-pango --with-webpbrew
brew install imagemagick --with-fontconfig --with-librsvg
brew install leiningen
brew install libav
brew install libgit2
brew install libiconv
brew install libressl
brew install librsvg
brew install libssh2
brew install libxml2
brew install libxslt
# Full mainline: --with-toolchain (very slow)
brew install llvm
# Use instead of mysql.
brew install mariadb-connector-c
brew install mas
brew install md5sha1sum  # md5sum
brew install neovim
brew install node
# CPU intensive if built from source.
brew install openblas --with-openmp
brew install pandoc
brew install pandoc-citeproc
brew install pandoc-crossref
brew install pkg-config
brew install protobuf
brew install python --with-tcl-tk
brew install rsync
brew install rbenv
brew install screen
brew install shellcheck
brew install sshfs
brew install sox --with-flac --with-lame
brew install tesseract
brew install tmux
brew install trash
brew install tree
brew install udunits
brew install vim
brew install wget
brew install winetricks
brew install youtube-dl
brew install zlib

# Cask repair (for pull requests)
brew install vitorgalvao/tiny-scripts/cask-repair

Note that R should be installed using brew cask install r-app instead of brew install r. This command will install the latest official binary, which has two main advantages: (1) support in the RStudio IDE, and (2) fast downloading of pre-compiled packages from CRAN.

Homebrew needs to be updated on a regular schedule.

brew update
brew upgrade
brew cask outdated | xargs brew cask reinstall

Upgrade OpenSSL

macOS ships with an outdated version of OpenSSL. Compile and install the current version.

# Use latest OpenSSL stable release
# 1.1.0h (2018-03-27)
cd ~/Downloads
curl -O
tar -xvzf openssl-*
cd openssl-*
./Configure darwin64-x86_64-cc
make test
sudo make install
cd ..
rm -rf openssl-*
# Reload terminal and check version
exit 1
which openssl
openssl version

Configure Python

Python is useful for scripting workflows. Homebrew can manage installations of both versions 2 and 3 and the launcher application automatically.

pip install --upgrade pip setuptools
pip3 install --upgrade pip setuptools wheel

Final steps