Skip to content

Instantly share code, notes, and snippets.

@markbirbeck
Last active February 27, 2021 18:54
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save markbirbeck/2fb12460eb69484a87b3 to your computer and use it in GitHub Desktop.
Save markbirbeck/2fb12460eb69484a87b3 to your computer and use it in GitHub Desktop.
Mac From Scratch

Admin Account

During installation, create a user called admin rather than one with your own name.

Apps for All Users

Then install Homebrew as per latest instructions (note that this will install the necessary CLI components for XCode):

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

Next run the following script:

# B R E W
# =======
#
brew install \
  awscli \
  cloc \
  git \
  git-flow \
  gdal \
  heroku-toolbelt \
  homebrew/completions/brew-cask-completion \
  node \
  terminal-notifier \
  todo-txt \
  watch

brew linkapps \
  terminal-notifier

# C A S K
# =======
#
# Dev tools:
#
# Need the versions cask to get ST3 and its dev version.
#
brew tap caskroom/versions

brew cask install \
  --appdir=/Applications \
  --fontdir=/Library/Fonts \
  --prefpanedir=/Library/PreferencePanes \
  --input_methoddir=/Library/Input\ Methods \
  --screen_saverdir=/Library/Screen\ Savers \
  adium \
  android-studio \
  android-file-transfer \
  divvy \
  docker \
  hammerspoon \
  iterm2 \
  sublime-text-dev

# Data science:
#
brew cask install \
  --appdir=/Applications \
  --fontdir=/Library/Fonts \
  --prefpanedir=/Library/PreferencePanes \
  --input_methoddir=/Library/Input\ Methods \
  --screen_saverdir=/Library/Screen\ Savers \
  r \
  rstudio

# Utilities:
#
brew cask install \
  --appdir=/Applications \
  --fontdir=/Library/Fonts \
  --prefpanedir=/Library/PreferencePanes \
  --input_methoddir=/Library/Input\ Methods \
  --screen_saverdir=/Library/Screen\ Savers \
  1password \
  alfred \
  arq \
  cakebrew \
  cyberduck \
  dash \
  dropbox \
  evernote \
  geektool \
  google-cloud-sdk \
  google-chrome \
  google-drive \
  google-photos-backup \
  horndis \
  kindle \
  music-manager \
  picasa \
  revisions \
  sketch \
  skitch \
  slack \
  skype \
  wercker

# Need sudo since writes to /Library/Ruby/Gems/2.0.0, which is owned
# by root:
#
sudo gem install foreman

Personal Account

Now create your own personal account, preferably not as an administrator. Don't use the iCloud password as you main password.

Login to this account, and login to iCloud at the same time. (Don't set up the iCloud Keychain or iCloud Drive.)

Connect Dropbox so that your 1Password passwords get sync'd.

Connect Evernote and log in so that it can get syncing, too.

Connect Google Drive, to get access to config.

Open Chrome and log in to get your bookmarks, extensions, etc. You'll get a flurry of login pages for Evernote, Pushbullet, Buffer, Pocket, Feedly, etc.

Set up Arq.

Mac settings:

# M A C   O S   C O N F I G
# =========================
#
# Many settings gratefully copied from:
#
#  http://strajk.me/blog/2015/geek-setup/
#  https://coderwall.com/p/7e3xyw/osx-setup
#  https://coderwall.com/p/jzuuzg/osx-set-fast-keyboard-repeat-rate
#
# Set a blazingly fast keyboard repeat rate:
#
defaults write NSGlobalDomain KeyRepeat -int 0.02 

# Set a shorter Delay until key repeat:
#
defaults write NSGlobalDomain InitialKeyRepeat -int 12

# Use column view in all Finder windows by default:
#
defaults write com.apple.Finder FXPreferredViewStyle -string "clmv"

# Expand save panel by default:
#
defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode -bool TRUE

# Disable auto-correct:
#
defaults write NSGlobalDomain NSAutomaticSpellingCorrectionEnabled -bool FALSE

# Show hidden files:
#
defaults write com.apple.finder AppleShowAllFiles YES

# Show all filename extensions:
#
defaults write NSGlobalDomain AppleShowAllExtensions YES

# Disable the warning when changing a file extension:
#
defaults write com.apple.finder FXEnableExtensionChangeWarning -bool false

# When performing a search, search the current folder by default:
#
defaults write com.apple.finder FXDefaultSearchScope -string "SCcf"

# Avoid creating .DS_Store files on network volumes:
#
defaults write com.apple.desktopservices DSDontWriteNetworkStores YES

# Disable the warning before emptying the Trash:
#
defaults write com.apple.finder WarnOnEmptyTrash NO

# Trackpad: disable 'tap to click':
#
defaults write NSGlobalDomain com.apple.mouse.tapBehavior -int 0

# Only show open applications in the dock:
#
defaults write com.apple.dock static-only -bool TRUE

# Autohide the dock:
#
defaults write com.apple.Dock autohide -bool TRUE

# Minimize windows into their application’s icon:
#
defaults write com.apple.dock minimize-to-application -bool true

# Enable spring loading for all Dock items:
#
defaults write com.apple.dock enable-spring-load-actions-on-all-items -bool true

# Show indicator lights for open applications in the Dock
#
defaults write com.apple.dock show-process-indicators -bool true

Finally, add the various symbolic links that point back to sync'd files.

# Link in config files from Google Drive:
#
# B A S H
# =======
#
ln -s \
  ~/Google\ Drive/User\ Settings/markbirbeck/.bash_functions \
  ~
ln -s \
  ~/Google\ Drive/User\ Settings/markbirbeck/.bash_mac_osx \
  ~
ln -s \
  ~/Google\ Drive/User\ Settings/markbirbeck/.bash_profile \
  ~
ln -s \
  ~/Google\ Drive/User\ Settings/markbirbeck/.bashrc \
  ~

# G I T
# =====
#
ln -s \
  ~/Google\ Drive/User\ Settings/markbirbeck/.gitconfig \
  ~
ln -s \
  ~/Google\ Drive/User\ Settings/markbirbeck/.gitignore_global \
  ~

# H E R O K U
# ===========
#
ln -s \
  ~/Google\ Drive/User\ Settings/markbirbeck/.netrc \
  ~

# N P M
# =====
#
ln -s \
  ~/Google\ Drive/User\ Settings/markbirbeck/.npmrc \
  ~

# Since El Capitan is protecting `/usr/local` it makes sense to follow the
# instructions at option 2 of [Fixing npm permissions](https://docs.npmjs.com/getting-started/fixing-npm-permissions)
# and use our own directory:
#
ln -s \
  ~/Google\ Drive/User\ Settings/markbirbeck/.npm-global \
  ~

# t o d o . t x t
# ===============
#
ln -s \
  ~/Google\ Drive/App\ Settings/Todo.txt \
  ~/.todo

# g h
# ===
#
ln -s \
  ~/Google\ Drive/User\ Settings/markbirbeck/.gh.json \
  ~

# S S H
# =====
#
# To test everything is ok with GitHub use:
#
#  ssh -T git@github.com
#
ln -s \
  ~/Google\ Drive/User\ Settings/markbirbeck/.ssh \
  ~

# S u b l i m e   T e x t
# =======================
#
# Need to create directory if ST hasn't run yet:
#
mkdir -p  ~/Library/Application\ Support/Sublime\ Text\ 3/Packages/
ln -s \
  ~/Google\ Drive/App\ Settings/Sublime\ Text\ 3/Packages/User \
  ~/Library/Application\ Support/Sublime\ Text\ 3/Packages/
npm install -g eslint

App Configuration

Alfred

  • add license key;
  • Preferences > Advanced > Set sync folder... should refer to ~/Google Drive/App Settings/Alfred.

Dash

  • add license key;
  • Preferences > General > Set Up Syncing... should refer to ~/Google Drive/App Settings/Dash.

Sublime Text 3

TopoJSON

  • npm install -g topojson

GitHub from the command-line

  • npm install -g gh

App Store Apps Without Casks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment