Skip to content

Instantly share code, notes, and snippets.

@tino
Last active February 28, 2019 06:11
Show Gist options
  • Save tino/a669d69a95cd6d526f0e to your computer and use it in GitHub Desktop.
Save tino/a669d69a95cd6d526f0e to your computer and use it in GitHub Desktop.
Clean install of OS X El Capitan (based on https://gist.github.com/g3d/2709563)

Mac OS X

Mensch coding font

Apps

General Settings

  • Set keyboard to US, not US International.

Xcode Command Line Tools

xcode-select --install

OS X Preferences

#Fix fonth smoothing
defaults -currentHost write -globalDomain AppleFontSmoothing -int 0

#Disable press and hold for accented keys
defaults write ApplePressAndHoldEnabled -bool false

#Disable window animations
defaults write NSGlobalDomain NSAutomaticWindowAnimationsEnabled -bool false

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

#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

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

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

#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

For more, see: https://github.com/kvpb/.files/blob/9ef284f53a4ac65cb05203bb696027514a5c08bc/.osxmavericks

Set hostname

sudo scutil --set HostName Tino

Homebrew

ruby <(curl -fsSkL raw.github.com/mxcl/homebrew/go)
brew install git ack wget curl readline sqlite pkg-config libsass openssl redis libjpeg libtiff libpng dnsmasq zlib thefuck pyenv tmux hub node yarn

Install python through pyenv

brew install pyenv
cat <<EOF >> ~/.bashrc
# Pyenv
export PYENV_ROOT=/usr/local/var/pyenv
if which pyenv > /dev/null; then eval "$(pyenv init -)"; fi
EOF
pyenv install 3.6.1
pyenv rehash
pyenv global 3.6.1

Install virtualenv and wrapper

pip install virtualenv virtualenvwrapper

Source virtualenvwrapper script

source /usr/local/bin/virtualenvwrapper.sh

Sublime Text

Add Sublime Text CLI

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

Server

Install dnsmasq

brew install dnsmasq

Add DNS Domains

mkdir -p /usr/local/etc/ &&
echo "address=/dev/127.0.0.1" >> /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/*/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/dev

#flush cache
dscacheutil -flushcache

#ensure it works
scutil --dns
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment