Skip to content

Instantly share code, notes, and snippets.

@darokel
Forked from kevinelliott/osx-10.10-setup.md
Last active December 19, 2019 11:28
Show Gist options
  • Save darokel/ebfdc84cae3652efbeb4 to your computer and use it in GitHub Desktop.
Save darokel/ebfdc84cae3652efbeb4 to your computer and use it in GitHub Desktop.
Instructions for bootstrapping my dev environment on a new machine.

Mac OS X 10.11 El Capitan

Custom recipe to get OS X 10.11 El Capitan running from scratch, setup applications and developer environment. I use this gist to keep track of the important software and steps required to have a functioning system after a semi-annual fresh install. On average, I reinstall each computer from scratch every 6 months, and I do not perform upgrades between distros.

This keeps the system performing at top speeds, clean of trojans, spyware, and ensures that I maintain good organizational practices for my content and backups. I highly recommend this.

You are encouraged to fork this and modify it to your heart's content to match your own needs.

Install Software

The software selected is software that is "tried and true" --- software I need after any fresh install. I often install other software not listed here, but is handled in a case-by-case basis.

Install from App Store

Install from Third-Party Websites

#Xcode Command Line Tools

Run Xcode and accept the license

Homebrew can not install properly until this occurs.

xcode-select --install

#Homebrew

Install Homebrew

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

At the time of this writing, brew doctor says that Xcode 6.1 is required, which means downloading it from the Apple Developer Center until it is released in the Mac App Store.

Install Homebrew extension Cask

brew install caskroom/cask/brew-cask

Install common applications via Homebrew

Databases are installed later.

brew install the_silver_searcher autojump automake colordiff curl git git-flow \
             hub icoutils imagemagick libmemcached memcached openssl ossp-uuid qt \
             readline redis tmux wget libxml2

Install applications via Homebrew Cask

brew cask install authy-bluetooth
brew cask install awareness
brew cask install bartender
brew cask install battery-guardian
brew cask install cyberduck
brew cask install github
brew cask install joinme
brew cask install iterm2
brew cask install rescuetime
brew cask install satellite-eyes
brew cask install sidestep
brew cask install spotify
brew cask install vagrant
brew cask install vagrant-manager

#Shell

Fish Shell

brew install fish

# Add Fish to /etc/shells, which will require an administrative password
echo "/usr/local/bin/fish" | sudo tee -a /etc/shells

# Make Fish your default shell
chsh -s /usr/local/bin/fish

# Create the Fish config directory
mkdir -p ~/.config/fish

# Create initial config file
atom ~/.config/fish/config.fish

# [Optional] Update completions:
fish_update_completions

Customisations

Fonts

.oh-my-Fish (level up Fish)

Get .oh-my-fish:

curl -L https://github.com/oh-my-fish/oh-my-fish/raw/master/bin/install | fish

Install the following fish plugins:

  • bundler
  • foreign-env
  • git-flow
  • kill-on-port
  • nvm (after installing nvm below)
  • rvm (after installing rvm below)
  • osx

Add the following lines to your fish config file:

set -g -x fish_greeting ''
set -x EDITOR atom -w
  • (Ruby and Node installed later)

One Dark iTerm Theme

One Dark

OS X Preferences

#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

#Add a context menu item for showing the Web Inspector in web views
defaults write NSGlobalDomain WebKitDeveloperExtras -bool true

#Show the ~/Library folder
chflags nohidden ~/Library

#Store screenshots in subfolder on desktop
mkdir ~/Desktop/Screenshots
defaults write com.apple.screencapture location ~/Desktop/Screenshots

Set hostname

sudo scutil --set HostName thelab

#Git

Setup Github

ssh-keygen -t rsa -C "[email protected]"

# Copy ssh key to github.com
cat ~/.ssh/id_rsa.pub

# Test connection
ssh -T [email protected]

# Set git config values
git config --global user.name "David Kewal"
git config --global user.email "[email protected]"
git config --global github.user darokel
git config --global github.token your_token_here

git config --global core.editor "subl -w"
git config --global color.ui true

#Install Ruby

# Install RVM
curl -L https://get.rvm.io | bash -s stable --ruby

# Set to global gemset 
rvm gemset use global

# Faster gem installation 
echo "gem: --no-document" >> ~/.gemrc

# Update default gems
gem outdated
gem update

# Get Nokogiri
gem install nokogiri

#Install Rails

# Create a new gemset for latest Rails and set as default
rvm use --default [email protected] --create
gem install rails

Ruby Gems

libv8 / therubyracer

brew uninstall v8-315
gem uninstall libv8
brew install v8-315
gem install libv8 -v '3.16.14.19' -- --with-system-v8
gem install therubyracer -v '0.12.3' -- --with-v8-dir=/usr/local/opt/[email protected]

nokogiri (alternative solution if above fails)

brew tap homebrew/dupes
brew install libxml2 libxslt libiconv
gem install nokogiri -- --with-iconv-dir=/usr/local/Cellar/libiconv/VERSION/

capybara-webkit

brew install -v https://raw.github.com/cliffrowley/homebrew/patched_qt/Library/Formula/qt.rb --HEAD --without-ssse3
gem install capybara-webkit -v '0.9.0'

#Install NVM (node version manager)

curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.29.0/install.sh | bash

# Add fundle plugin 'edc/bass' to your fish config, relaunch you shell and run fundle install.

#Create a fish function in /Users/david/.config/fish/functions/nnvm.fish
function nnvm
  bass source ~/.nvm/nvm.sh ';' nvm $argv
end

#Install Node.js
nnvm install 4 (or 5)

Server

Docker

MySQL

brew install mysql
brew pin mysql

MySQL Settings

# Copy launch agent into place
mkdir -p ~/Library/LaunchAgents && cp /usr/local/Cellar/mysql/VERSION/homebrew.mxcl.mysql.plist ~/Library/LaunchAgents/

# Edit launch agent and set both keepalive and launch at startup to false
vi ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist

# Inject launch agent
launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist

# Set up databases to run as your user account
unset TMPDIR && mysql_install_db --verbose --user=`whoami` --basedir="$(brew --prefix mysql)" --datadir=/usr/local/var/mysql --tmpdir=/tmp

# Start mysql
start mysql

# Secure mysql
/usr/local/Cellar/mysql/VERSION/bin/mysql_secure_installation

PostgreSQL

brew install postgres --no-ossp-uuid
brew pin postgres

PostgreSQL Settings

# Initialize db if none exists already
initdb /usr/local/var/postgres

# Create launchctl script
mkdir -p ~/Library/LaunchAgents
cp /usr/local/Cellar/postgresql/VERSION/homebrew.mxcl.postgresql.plist ~/Library/LaunchAgents/

# Edit launchctl script (set to not start automatically and keepalive false)
subl ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist

# Inject launchctl script
launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist

# Start PostgreSQL
start pg

MongoDB

brew install mongodb

aww yeah

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