Skip to content

Instantly share code, notes, and snippets.

@cc12258
Forked from saetia/gist:1623487
Created October 9, 2012 16:40
Show Gist options
  • Save cc12258/3859944 to your computer and use it in GitHub Desktop.
Save cc12258/3859944 to your computer and use it in GitHub Desktop.
Clean Install – Mountain Lion OS X 10.8

#Mac OS X

Mensch coding font

Apps

Webkit, Chrome, Firefox, Sublime Text, Sequel Pro, 1Password, LiveReload, LiveReload Extensions, XQuartz, VirtualBox

#Xcode Command Line Tools

Install Xcode from the app store.

Xcode > Preferences > Downloads > Command Line Tools

OS X Preferences

#Disable window animations
defaults write NSGlobalDomain NSAutomaticWindowAnimationsEnabled -bool false

#Enable repeat on keydown
defaults write -g ApplePressAndHoldEnabled -bool false

#Disable webkit homepage
defaults write org.webkit.nightly.WebKit StartPageDisabled -bool true

#Use current directory as default search scope in Finder
defaults write com.apple.finder FXDefaultSearchScope -string "SCcf"

#Show Path bar in Finder
defaults write com.apple.finder ShowPathbar -bool true

#Show Status bar in Finder
defaults write com.apple.finder ShowStatusBar -bool true

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

#Enable AirDrop over Ethernet and on unsupported Macs running Lion
defaults write com.apple.NetworkBrowser BrowseAllInterfaces -bool true

#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 8

#Disable disk image verification
defaults write com.apple.frameworks.diskimages skip-verify -bool true &&
defaults write com.apple.frameworks.diskimages skip-verify-locked -bool true &&
defaults write com.apple.frameworks.diskimages skip-verify-remote -bool true

#Disable Safari’s thumbnail cache for History and Top Sites
defaults write com.apple.Safari DebugSnapshotsUpdatePolicy -int 2

#Enable Safari’s debug menu
defaults write com.apple.Safari IncludeInternalDebugMenu -bool true

#Disable the Ping sidebar in iTunes
defaults write com.apple.iTunes disablePingSidebar -bool true

#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

#Disable ping dropdowns
defaults write com.apple.iTunes hide-ping-dropdown true

#Shell

Switch to z-shell

curl -L https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh | sh

#Homebrew

ruby <(curl -fsSkL raw.github.com/mxcl/homebrew/go)
brew install git ack wget curl redis memcached libmemcached colordiff imagemagick icoutils rbenv ruby-build

Update .zshrc

wget https://raw.github.com/gist/2764210/94ad3b85c8f9d61ed08d6e7f7b65e98277a07c1a/.zshrc -O ~/.zshrc

Rbenv Setup Add to ~/.bash_profile or ~/.zshrc

eval '$(rbenv init -)'
export PATH="/usr/local/bin:$PATH"

Set hostname

sudo scutil --set HostName Work

#Git

Setup Github

ssh-keygen -t rsa -C "youremail@whatever.com"

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

#test connection
ssh -T git@github.com

#set git config values
git config --global user.name "Your Name"
git config --global user.email "youremail@whatever.com"
git config --global github.user githubusername
git config --global github.token your_token_here

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

#Sublime Text

Add Sublime Text CLI

sudo mkdir -p "/usr/local/bin/" && ln -s "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl" "/usr/local/bin/subl"

Install Package Control

import urllib2,os; pf='Package Control.sublime-package'; ipp=sublime.installed_packages_path(); os.makedirs(ipp) if not os.path.exists(ipp) else None; urllib2.install_opener(urllib2.build_opener(urllib2.ProxyHandler())); open(os.path.join(ipp,pf),'wb').write(urllib2.urlopen('http://sublime.wbond.net/'+pf.replace(' ','%20')).read()); print 'Please restart Sublime Text to finish installation'

Install Soda Theme

git clone git://github.com/buymeasoda/soda-theme.git ~/Library/Application\ Support/Sublime\ Text\ 2/Packages/Theme\ -\ Soda

Install Tomorrow Theme

git clone git://github.com/chriskempson/textmate-tomorrow-theme.git ~/Library/Application\ Support/Sublime\ Text\ 2/Packages/Color\ Scheme\ -\ Tomorrow

Settings

{
  "close_windows_when_empty": true,
  "color_scheme": "Packages/Color Scheme - Tomorrow/Tomorrow-Night-Eighties.tmTheme",
  "draw_indent_guides": false,
  "font_face": "Mensch",
  "font_size": 18,
  "highlight_modified_tabs": true,
  "show_tab_close_buttons": false,
  "tab_size": 2,
  "spell_check": false,
  "theme": "Soda Light.sublime-theme",
  "word_separators": "./\\()\"'-:,.;<>~!@#%^&*|+=[]{}`~?"
}

Key Bindings

[
  { "keys": ["super+b"], "command": "expand_selection", "args": {"to": "brackets"} },
  { "keys": ["super+f"], "command": "show_panel", "args": {"panel": "replace"} },
  { "keys": ["super+alt+f"], "command": "show_panel", "args": {"panel": "find"} }
]

Snippets

cd ~/Library/Application\ Support/Sublime\ Text\ 2/Packages/
git clone git@github.com:mhartl/rails_tutorial_snippets.git RailsTutorial

Rails Setup

Rails Tutorial Sublime Text

#Server

Install dnsmasq

brew install dnsmasq

Add DNS Domains

mkdir -p /usr/local/etc/ &&
echo "address=/build/127.0.0.1" >> /usr/local/etc/dnsmasq.conf && 
echo "address=/stage/192.168.10.200" >> /usr/local/etc/dnsmasq.conf && 
echo "listen-address=127.0.0.1" >> /usr/local/etc/dnsmasq.conf

Enable dnsmasq daemon

sudo cp "/usr/local/Cellar/dnsmasq/2.57/homebrew.mxcl.dnsmasq.plist" "/Library/LaunchDaemons" &&
sudo launchctl load -w "/Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist"

Add Localhost to /etc/resolver

sudo -s
sudo mkdir -p /etc/resolver
sudo echo 'nameserver 127.0.0.1' > /etc/resolver/build

#flush cache
dscacheutil -flushcache
sudo dscacheutil -flushcache; sudo killall mDNSResponder

#ensure it works
scutil --dns

MySQL

brew install mysql

MySQL Settings

#setup daemon
mkdir -p ~/Library/LaunchAgents && cp /usr/local/Cellar/mysql/5.5.20/homebrew.mxcl.mysql.plist ~/Library/LaunchAgents/ && 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
mysql.server start

#secure mysql
/usr/local/Cellar/mysql/5.5.20/bin/mysql_secure_installation

Guard

gem install guard spork

Vagrant

gem install vagrant veewee

aww yeah

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