Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?

Mac from scratch

Install Software

Install from App Store

Install from Third-Party Websites

Fonts

Mensch coding font

open http://robey.lag.net/downloads/mensch.ttf

Folders of interest

mkdir -p ~/{Projects,Virtualenvs}

#Homebrew

Install Homebrew

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

#Xcode Command Line Tools Xcode > Preferences > Downloads > Command Line Tools

Install Homebrew extension Cask

brew install caskroom/cask/brew-cask

Install applications via Homebrew Cask

for app in atom github vagrant vagrant-manager virtualbox \
           box-sync dropbox slack boot2docker intellij-idea; do
    brew cask install ${app}
done

Install common applications via Homebrew

brew install ack autojump automake colordiff curl git git-flow gnu-sed gnu-which gnu-tar gnutls \
             gnu-getopt hub icoutils imagemagick libmemcached memcached openssl ossp-uuid qt \
             go readline redis tmux wget scala python node

Node / NPM

npm install -g npm@latest

for app in grunt-cli express bower; do
    npm install -g ${app}
done

Python setup and configuration

Add the following to ~/.bash_profile this configuration will require all pip executions to be from a virtual env.

# pip should only run if there is a virtualenv currently activated
pip install virtualenvwrapper
export PIP_REQUIRE_VIRTUALENV=true
# global pip access via `gpip`
gpip(){
   PIP_REQUIRE_VIRTUALENV="" pip "$@"
}

######

for pkg in pip setuptools virtualenv virtualenv awscli glances httpie; do
    gpip install --upgrade ${pkg}
done


# install virtualenv wrapper
echo "export WORKON_HOME=~/Virtualenvs"
echo "source /usr/local/bin/virtualenvwrapper.sh" >> ~/.extra"

# create the rst documentation virtualenv
mkvirtualenv documentation
pip install sphinx markdown

configure aws-cli

aws configure

AWS KeyCHain Util

aws-keychain-util

sudo gem install aws-keychain-util
aws-creds init
aws-creds add
aws-creds ls

Shell

Install custom .dotfiles (optional)

cd ~/
git init
git remote add origin git@${git_home_of_dot_files}
git fetch origin
git checkout -b master --track origin/master
. ~/.bash_profile

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
# Show the ~/Library folder
chflags nohidden ~/Library
# Store screenshots in subfolder on desktop
mkdir ~/Desktop/Screenshots
defaults write com.apple.screencapture location ~/Desktop/Screenshots

Git

Setup Github

ssh-keygen -t rsa -C "${my_email_address}"

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

# Test connection
ssh -T git@github.com

# Set git config values
git config --global user.name "${FULL_NAME}"
git config --global user.email "${GIT_EMAIL}"
git config --global github.user ${GITHUB_USERNAME}
git config --global github.token ${your_github_token_here}

git config --global core.editor "vim"
git config --global color.ui true

Server

Docker

# for remote docker servers/shared build/docker env
unset DOCKER_TLS_VERIFY
export DOCKER_HOST=tcp://docker.dev.my-domains.local:2376

#for boot2docker local
boot2docker init
boot2docker up
export DOCKER_CERT_PATH=/Users/`whoami`/.boot2docker/certs/boot2docker-vm
export DOCKER_TLS_VERIFY=1
export DOCKER_HOST=tcp://${address_of_boot2docker_or_remote_docker_instance}

PostgreSQL

brew install postgres --no-ossp-uuid --with-python
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/*/homebrew.mxcl.postgresql.plist ~/Library/LaunchAgents/

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

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

# Start PostgreSQL
launchctl start pg

# Create DB
createdb `whoami`
@zircote

This comment has been minimized.

Copy link
Owner Author

commented Apr 5, 2016

El Capitan:
gem install nokogiri -- --use-system-libraries

@kvengala

This comment has been minimized.

Copy link

commented Mar 27, 2017

The virtual environment set up the line
echo "source /usr/local/bin/virtualenvwrapper.sh" >> ~/.extra"

The line should be
echo "source /usr/local/bin/virtualenvwrapper.sh >> ~/.extra"

to start the virtual environment,
the commands must be executed in the following order.

source which virtualenvwrapper.sh
source ~/.bash_profile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.