My dotfiles and instructions on how to set up Mac OS X
Shell
Latest commit 5ab8bea Dec 12, 2016 @kevinrenskers committed on GitHub Update README.md
Permalink
Failed to load latest commit information.
.pip New Python instructions Jul 29, 2013
fonts Other fonts Jul 12, 2013
.aliases Sharing aliases and exports Jul 12, 2013
.bash_functions Completely new version of the dotfiles, now with smaller individual f… Jul 13, 2012
.bash_profile Sharing aliases and exports Jul 12, 2013
.bash_prompt Revert "Greatly simplified .bash_prompt" Jul 11, 2013
.bashrc Completely new version of the dotfiles, now with smaller individual f… Jul 13, 2012
.exports Add Yarn global packages to path Dec 6, 2016
.git_completion.sh git_completion -> .git_completion Aug 2, 2012
.gitconfig New git search alias Nov 14, 2013
.gitignore New git alias, added "env" to gitignore Jul 18, 2012
.hgignore New ignore rules Jul 16, 2012
.hgrc Completely new version of the dotfiles, now with smaller individual f… Jul 13, 2012
.hushlogin Completely new version of the dotfiles, now with smaller individual f… Jul 13, 2012
.inputrc Completely new version of the dotfiles, now with smaller individual f… Jul 13, 2012
.osx Updated instructions, separated dotfiles install file Jul 27, 2012
.screenrc Sharing aliases and exports Jul 12, 2013
.wgetrc Changes Jul 13, 2012
.zshrc .zshextra needs to be loaded before starting the oh-my-zsh script Dec 11, 2016
INSTALL.md .zshextra needs to be loaded before starting the oh-my-zsh script Dec 11, 2016
README.md Update README.md Dec 12, 2016
agnoster.png Make virtualenv work properly Oct 24, 2013
bootstrap.sh Automatically create nececcary wheels folder Aug 20, 2013

README.md

Mac OS X setup

This is a list of reproducible steps to get a clean Mac up and running with nice dotfiles for Bash and ZSH, plus a whole bunch of apps and development tools. Tested on OS X 10.9 (Mavericks) and 10.10 (Yosemite).

Agnoster theme

Step 1: prepare Mac OS X

  1. Install Xcode from the App Store
  2. Open Xcode's preferences and install the command line tools package (this will also install Git) (on OS X Mavericks you need to run xcode-select --install instead)
  3. Install http://www.starryhope.com/keyfixer/ (optional)

Step 2: install Homebrew

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

To update Homebrew itself:

$ brew update

Very handy first installs:

$ brew install trash && alias rm='trash'
$ brew cask install qlstephen

To update all installed packages:

$ brew upgrade

Step 3: dotfiles

3a: install dotfiles dependencies

For Bash

$ brew install bash-completion

For ZSH

I'm using oh-my-zsh with the agnoster theme.

$ curl -L http://install.ohmyz.sh | sh

3b: install the dotfiles

$ git clone https://github.com/kevinrenskers/dotfiles.git && cd dotfiles && ./bootstrap.sh

3c: set your default shell

$ chsh -s /bin/zsh

Restart your shell after it's done. Read the INSTALL.md file for more detailed instructions and tips.

On a fresh Mac you might want to run $ . .osx to setup some sensible defaults.

Step 3c: setup iTerm2 for ZSH

If you're using ZSH and the included .zshrc file, you need to configure iTerm2 (or the standard Terminal.app) to work with the agnoster theme.

  1. install and use the Solarized Dark colorscheme
  2. use the Menlo-Powerline font (note: already automatically installed to your system in step 3b)

Step 4: native apps

Installing native (non-Mac App Store) apps using Homebrew.

If you're not using my dotfiles or didn't restart your terminal session yet, you probably want to run this command first:

export HOMEBREW_CASK_OPTS="--appdir=/Applications"

Then to install the apps into /Applications:

$ brew install caskroom/cask/brew-cask
$ brew cask install dropbox
$ brew cask install one-password
$ brew cask install iterm2

Step 5: anything else you need

Python

I'm using Homebrew's Python because it's newer and comes with pip and setuptools.

$ brew install python giflib jpeg
$ pip install wheel virtualenvwrapper PIL

Upgrade pip itself:

$ pip install --upgrade pip

To upgrade setuptools, which is used by pip:

$ pip install --upgrade setuptools

note: ZSH trying to correct pip to .pip for you? Run hash -rf to fix this.

Ruby, RVM (Ruby Version Manager) and RubyGems

$ curl -L https://get.rvm.io | bash -s stable --ruby

Ignore the instructions to insert the rvm script into your bash profile - if you installed my dotfiles, that's already included.

Restart your shell after it's done and test with ruby --version, it should have installed version 2.x. If you want to stay on Ruby 1.9.3, run these commands after restarting your shell:

$ rvm install 1.9.3
$ rvm --default use 1.9.3

Once RVM is installed you can install your favorite packages:

$ gem install cocoapods
$ gem install rails

To update RVM itself:

$ rvm get stable

To update RubyGems itself:

$ gem update --system

PostgreSQL

$ brew install postgresql
$ initdb /usr/local/var/postgres
$ cp /usr/local/Cellar/postgresql/9.2.4/org.postgresql.postgres.plist ~/Library/LaunchAgents/
$ launchctl load -w ~/Library/LaunchAgents/org.postgresql.postgres.plist

To use with Python:

$ export CFLAGS=-Qunused-arguments
$ export CPPFLAGS=-Qunused-arguments
$ sudo pip install psycopg2

Or simply download Postgress.app from http://postgresapp.com.

MySQL

$ brew install mysql
$ brew services start mysql
$ mysql_secure_installation

To use with Python:

$ sudo pip install mysql-python

Manually Starting and stopping the server:

$ mysql.server start
$ mysql.server start

Node.js and NPM (Node Package Manager)

$ brew install node

Once this is installed you can install your favorite packages:

$ npm install -g coffee-script
$ npm install less --save

To update NPM:

$ npm install npm -g

Nginx

$ brew install nginx
$ sudo ln -sfv /usr/local/opt/nginx/*.plist /Library/LaunchAgents
$ sudo mkdir /var/log/nginx/

Edit /usr/local/etc/nginx/nginx.conf, change port to 80 and error_log to /var/log/nginx/error.log. Then start the server:

$ sudo nginx

Config file:

/usr/local/etc/nginx/nginx.conf

Other commands:

$ sudo nginx -s stop
$ sudo nginx -s reload

PHP-FPM

$ brew tap josegonzalez/homebrew-php
$ brew tap homebrew/dupes
$ brew install php55 --with-mysql --with-fpm
$ ln -sfv /usr/local/opt/php55/*.plist ~/Library/LaunchAgents
$ launchctl load -w ~/Library/LaunchAgents/homebrew-php.josegonzalez.php55.plist

Example Nginx config (place in server directive):

location ~ \.php$ {
    fastcgi_pass   127.0.0.1:9000;
    fastcgi_index  index.php;
    include        fastcgi_params;
    fastcgi_param  SCRIPT_FILENAME $document_root$fastcgi_script_name;
}

Config files:

/usr/local/etc/php/5.5/php-fpm.conf
/usr/local/etc/php/5.5/php.ini

Starting and stopping the server:

$ launchctl load -w ~/Library/LaunchAgents/homebrew-php.josegonzalez.php55.plist
$ launchctl unload -w ~/Library/LaunchAgents/homebrew-php.josegonzalez.php55.plist

LaunchRocket

LaunchRocket is a Mac PreferencePane for managing services with launchd. It's pretty handy for MySQL, PHP-FPM, Nginx, etc.

$ brew install caskroom/cask/brew-cask
$ brew cask install launchrocket

Thanks to...