Skip to content

Instantly share code, notes, and snippets.

@jessebishop
Forked from saetia/gist:1623487
Last active March 13, 2019 18:56
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save jessebishop/28a8584452e18e40361c to your computer and use it in GitHub Desktop.
Save jessebishop/28a8584452e18e40361c to your computer and use it in GitHub Desktop.
Clean Install – OS X 10.11 El Capitan

OS X Preferences


most of these require logout/restart to take effect

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

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

# Set a blazingly fast keyboard repeat rate
defaults write NSGlobalDomain KeyRepeat -int 0

# Disable window animations ("new window" scale effect)
#defaults write NSGlobalDomain NSAutomaticWindowAnimationsEnabled -bool false

# Turn on dashboard-as-space
defaults write com.apple.dashboard enabled-state 2

# Use plain text mode for new TextEdit documents
defaults write com.apple.TextEdit RichText -int 0

# Make top-right hotspot start screensaver
#defaults write com.apple.dock wvous-tr-corner -int 5 && \
#defaults write com.apple.dock wvous-tr-modifier -int 0

# Set default Finder location to home folder (~/)
defaults write com.apple.finder NewWindowTarget -string "PfLo" && \
defaults write com.apple.finder NewWindowTargetPath -string "file://${HOME}"

# Expand save panel by default
defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode -bool true

# Disable ext change warning
defaults write com.apple.finder FXEnableExtensionChangeWarning -bool false

# Check for software updates daily, not just once per week
#defaults write com.apple.SoftwareUpdate ScheduleFrequency -int 1

# 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 icons for hard drives, servers, and removable media on the desktop
#defaults write com.apple.finder ShowExternalHardDrivesOnDesktop -bool true && \
#defaults write com.apple.finder ShowHardDrivesOnDesktop -bool true && \
#defaults write com.apple.finder ShowMountedServersOnDesktop -bool true && \
#defaults write com.apple.finder ShowRemovableMediaOnDesktop -bool true

# Avoid creating .DS_Store files on network volumes
defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true

# 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

# Trackpad: map bottom right corner to right-click
#defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad TrackpadCornerSecondaryClick -int 2 && \
#defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad TrackpadRightClick -bool true && \
#defaults -currentHost write NSGlobalDomain com.apple.trackpad.trackpadCornerClickBehavior -int 1 && \
#defaults -currentHost write NSGlobalDomain com.apple.trackpad.enableSecondaryClick -bool true

# Enable the Develop menu and the Web Inspector in Safari
defaults write com.apple.Safari IncludeInternalDebugMenu -bool true && \
defaults write com.apple.Safari IncludeDevelopMenu -bool true && \
defaults write com.apple.Safari WebKitDeveloperExtrasEnabledPreferenceKey -bool true && \
defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2DeveloperExtrasEnabled -bool true && \
defaults write NSGlobalDomain WebKitDeveloperExtras -bool true

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

# Show absolute path in finder's title bar.
defaults write com.apple.finder _FXShowPosixPathInTitle -bool YES

# Enable text copying from Quick Look
defaults write com.apple.finder QLEnableTextSelection -bool YES

# Auto-play videos when opened with QuickTime Player
#defaults write com.apple.QuickTimePlayerX MGPlayMovieOnOpen 1

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

# Disable WebkitNightly.app's homepage
#defaults write org.webkit.nightly.WebKit StartPageDisabled -bool true

####Homebrew For more info, see https://brew.sh/ https://caskroom.github.io/ https://github.com/caskroom/homebrew-fonts https://github.com/caskroom/homebrew-versions https://github.com/OSGeo/homebrew-osgeo4mac

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

# Install some homebrew packages that make life easier...
brew install ack
brew install autoconf
brew install automake
brew install bash-completion
brew install brew-cask-completion
brew install colordiff
brew install coreutils
brew install curl
brew install ffmpeg
brew install fsql
brew install git
brew install gpg
brew install gpg-agent
brew install graphicsmagick
brew install htop-osx
brew install imagemagick
brew install jpegoptim
brew install keybase
brew install node
brew install pdf2png
brew install pigz
brew install pngcrush
brew install postgresql
brew install python
brew install ssh-copy-id
brew install tippecanoe
brew install tree
brew install vim
brew install watch
brew install wget

####Homebrew Cask Apps & Fonts

# add cask for easy install of packages
brew tap caskroom/cask

# add support for fonts
brew tap caskroom/fonts

#add dev/beta versions
brew tap caskroom/versions

#install mac apps & fonts
brew cask install audacity # audio stuff
brew cask install audio-hijack # audio stuff
brew cask install bettertouchtool # adds a bunch of great shortcuts to OS X, but requires license
# brew cask install clipmenu # support dropped in homebrew but install this manually cause it's awesome http://www.clipmenu.com/
brew cask install cocktail # audio stuff
# brew cask install coda # editor, but sublime is better
brew cask install cyberduck # easy interaction with AWS S3, FTP, etc
brew cask install dropbox
brew cask install evernote
brew cask install filezilla
brew cask install firefox
brew cask install flux
brew cask install font-source-code-pro
brew cask install font-fira-code
brew cask install gas-mask # manages /etc/hosts for development
brew cask install google-backup-and-sync
brew cask install google-chrome
brew cask install google-drive
brew cask install google-earth-pro
brew cask install haroopad # Awesome markdown editor
brew cask install imagealpha
brew cask install imageoptim
brew cask install inkscape
brew cask install librecad
brew cask install libreoffice
brew cask install liquibase
# brew cask install moom # Better touch tools is better and I have a license for it.
brew cask install pgadmin4
brew cask install postico
brew cask install r
brew cask install rstudio
brew cask install skitch
brew cask install slack
brew cask install sonarr
brew cask install sonarr-menu
brew cask install spotify
brew cask install sublime-text
brew cask install textmate
brew cask install transmit
brew cask install vagrant
brew cask install vagrant-manager
brew cask install virtualbox
brew cask install vlc
brew cask install xquartz

####Homebrew GIS Related

# Tap osgeo4mac
brew tap osgeo/osgeo4mac

brew install qgis
brew install postgis

####Python packages

pip install --upgrade pip setuptools
pip install \
virtualenv \
virtualenvwrapper \
numpy \
scipy \
matplotlib \
processing \
psycopg2 \
ipython \
requests \
beautifulsoup4 \
SQLAlchemy \
Pillow \
lxml \
fabric \
rasterio

###Agree To Xcode

sudo xcrun cc

###Git


####Setup Github

ssh-keygen -t rsa -C "jesse.bishop@nbtsolutions.com"

#copy ssh key to clipboard for adding to github.com
pbcopy < ~/.ssh/id_rsa.pub

#test connection
ssh -T git@github.com

#set git config values
git config --global user.name "Jesse Bishop" && \
git config --global user.email "jesse.bishop@nbtsolutions.com" && \
git config --global github.user jessebishop && \
git config --global color.ui true && \


#token
git config --global github.token your_token_here

###Sublime Text


####Install Soda Theme

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

####Install Tomorrow Night Eighties Themes

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

#iTerm2
wget https://raw.githubusercontent.com/mbadolato/iTerm2-Color-Schemes/master/schemes/Tomorrow%20Night%20Eighties.itermcolors \
-O ~/Downloads/Tomorrow\ Night\ Eighties.itermcolors && open ~/Downloads/Tomorrow\ Night\ Eighties.itermcolors

#Xcode
mkdir -p ~/Library/Developer/Xcode/UserData/FontAndColorThemes && \
wget https://raw.githubusercontent.com/chriskempson/tomorrow-theme/master/Xcode%204/Tomorrow%20Night%20Eighties.dvtcolortheme -O \
~/Library/Developer/Xcode/UserData/FontAndColorThemes/Tomorrow\ Night\ Eighties.dvtcolortheme

####Settings

{
	"auto_complete_commit_on_tab": true,
	"create_window_at_startup": false,
	"ensure_newline_at_eof_on_save": true,
	"font_face": "Fira Code Medium",
	"font_size": 16,
	"highlight_modified_tabs": true,
	"ignored_packages":
	[
		"Vintage"
	],
	"match_brackets": false,
	"match_brackets_angle": false,
	"match_brackets_braces": false,
	"match_brackets_content": false,
	"match_brackets_square": false,
	"match_tags": false,
	"open_files_in_new_window": false,
	"rulers":
	[
		80
	],
	"scroll_past_end": true,
	"shift_tab_unindent": true,
	"show_encoding": true,
	"show_line_endings": true,
	"translate_tabs_to_spaces": true,
	"trim_trailing_white_space_on_save": true,
	"word_wrap": true
}

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

git clone git@github.com:co-b/sublime-snippets.git \
~/Library/Application\ Support/Sublime\ Text\ 3/Packages/CoB

Node


Packages

npm install -g grunt grunt-cli bower

Vagrant


vagrant plugin install vagrant-hostsupdater

####NGINX

sudo cp -v /usr/local/opt/nginx/*.plist /Library/LaunchDaemons/ &&
sudo chown root:wheel /Library/LaunchDaemons/homebrew.mxcl.nginx.plist &&
sudo launchctl load /Library/LaunchDaemons/homebrew.mxcl.nginx.plist

Local Web Server


Add DNS Domains, Enable dnsmasq daemon

This will route requests to any url ending in .build back to your own computer. The goal is to use urls like http://example.com.build for development while you work on http://example.com

mkdir -pv $(brew --prefix)/etc/ && \
echo 'address=/.build/127.0.0.1' > $(brew --prefix)/etc/dnsmasq.conf && \
sudo cp -v $(brew --prefix dnsmasq)/homebrew.mxcl.dnsmasq.plist /Library/LaunchDaemons && \
sudo launchctl load -w /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist && \
sudo mkdir -v /etc/resolver && \
sudo zsh -c 'echo "nameserver 127.0.0.1" > /etc/resolver/build'

#flush cache
sudo discoveryutil mdnsflushcache && scutil --dns

####Enable virtual hosts

This will allow you to serve folders under ~/Sites/ as websites.

  • ~/Sites
    • example.com
      • htdocs
        • index.html

to access this site, visit http://example.com.build

####Match production server paths

sudo mkdir -p /var/ && sudo ln -s ~/Sites /var/www

aww yeah

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