Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
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

# 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

###Shell


####Switch to z-shell

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

####Homebrew

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

# install homebrew packages
brew install \
tree \
node \
ssh-copy-id \
wget \
jpegoptim \
pngcrush \
colordiff \
ghostscript \
imagemagick --with-ghostscript \
graphicsmagick \
ack

####Homebrew Web Server Packages

brew install \
dnsmasq \
nginx \
mariadb \
redis \
memcached \
libmemcached \

####Homebrew Cask Apps & Fonts

# add support for fonts
brew tap caskroom/fonts

#add dev/beta versions
brew tap caskroom/versions

#install mac apps & fonts
brew cask install \
font-source-code-pro \
adobe-creative-cloud \
blueharvest \
cleanmymac \
cocktail \
ghostlab \
coda \
sublime-text-dev \
virtualbox \
coderunner \
google-chrome \
firefox \
codekit \
iterm2-beta \
sequel-pro \
querious \
imageoptim \
imagealpha \
xquartz \
simpholders-2-alpha \
handbrake \
vagrant \
ksdiff \
spotify

####Update .zshrc

wget https://gist.githubusercontent.com/saetia/2764210/raw/ab099b587689640eb32cbc1afdb6a19b62be7fb0/.zshrc -O \
~/.zshrc

#syntax highlighting
git clone git://github.com/zsh-users/zsh-syntax-highlighting.git \
~/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting

####Set hostname

sudo scutil --set HostName Work

###Agree To Xcode

sudo xcrun cc

###Git


####Setup Github

ssh-keygen -t rsa -C "saetia@gmail.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 "Joel Glovacki" && \
git config --global user.email "saetia@gmail.com" && \
git config --global github.user saetia && \
git config --global core.editor "subl -w" && \
git config --global color.ui true && \
git config --global push.default simple

#token
git config --global github.token your_token_here
#diff-so-fancy
brew install diff-so-fancy
git config --global pager.diff "diff-so-fancy | less --tabs=4 -RFX" && \
git config --global pager.show "diff-so-fancy | less --tabs=4 -RFX"

###Coda


####Install markdown support

git clone https://github.com/bobthecow/Markdown.mode.git \
~/Library/Application\ Support/Coda\ 2/modes/Markdown.mode

###Sublime Text


####Install Soda Theme

git clone git://github.com/buymeasoda/soda-theme.git \
~/Library/Application\ Support/Sublime\ Text\ 3/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\ 3/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

{
	"close_windows_when_empty": true,
	"color_scheme": "Packages/Color Scheme - Tomorrow/Tomorrow-Night-Eighties.tmTheme",
	"draw_indent_guides": false,
	"font_face": "Source Code Pro",
	"font_size": 22.0,
	"highlight_modified_tabs": true,
	"ignored_packages":
	[
		"Vintage"
	],
	"show_full_path": true,
	"show_tab_close_buttons": false,
	"spell_check": false,
	"tab_size": 2,
	"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

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

iOS


sudo gem install cocoapods
pod setup

Ruby


Ruby version manager

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

Gems

gem install pygmentize growl guard guard-phpunit bropages

Node


Packages

npm install -g coffee-script bower

Vagrant


vagrant plugin install vagrant-hostsupdater

PHP


#switch from SecureTransport
brew reinstall --with-openssl curl

#install php-fpm
brew tap homebrew/dupes && \
brew tap homebrew/versions && \
brew tap homebrew/dupes && \
brew install php70 \
--with-fpm \
--without-apache \
--with-mysql \
--with-homebrew-curl \
--with-homebrew-openssl \ 
--without-snmp

#setup daemon
ln -sfv /usr/local/opt/php70/*.plist ~/Library/LaunchAgents && \
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.php70.plist

####PHP-Redis

#brew install php70-redis
brew install --HEAD homebrew/php/php70-redis

####Imagemagick

brew install homebrew/php/php70-imagick

####MariaDB

#setup daemon
ln -sfv /usr/local/opt/mariadb/*.plist ~/Library/LaunchAgents && \
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mariadb.plist

#initial setup
mysql_install_db

#secure mariadb
mysql_secure_installation

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

if I can make a good suggestion, that would be:

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

(=

Any trickery to get libmemcached to install now on Mavericks? Errors on fatal error: 'tr1/cinttypes' file not found these days. Brew is not fixing Mavericks related issues yet, though: mxcl/homebrew#20635

Owner

saetia commented Jul 27, 2013

yikes, sorry @SlexAxton i have no tips for getting libmemcached installed with homebrew. I haven't tried doing anything on this list with a clean install of 10.9 😕

You can replace the XCode paragraph with xcode-select --install

Awesome list!

Do you know if there a way to increase the number of "Top Sites" in Safari and force only use of Favicons instead of previews?

I gathered my own gist from various sources such as your gist: https://gist.github.com/kimmobrunfeldt/350f4898d1b82cf10bce

nemfoz commented Jan 6, 2015

Your Homebrew installation is outdated.
The new installation paths is

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

sabisama commented Jan 9, 2015

Hi I am trying to run the following command in terminal using OS X 10.10 (Yosemite)
defaults write com.apple.finder _FXShowPosixPathInTitle -bool TRUE
killall Finder

When Finder reopens it there is no change i.e. I cannot see the path instead i see the icon path view

Owner

saetia commented Jan 19, 2015

@sabisama that flag just adds the full path instead of only the current directory. in this directory you would normally see it titled "Sites".
https://dl.dropboxusercontent.com/s/3dt248924qp49r5/Screen%20Shot%202015-01-19%20at%2011.56.09%20AM.png?dl=0

Great gist

you are missing a part for PHP brew tap homebrew/homebrew-php

bgeek commented May 4, 2015

Does the line defaults write NSGlobalDomain NSAutomaticWindowAnimationsEnabled -bool false still work on Yosemite? It doesn't seem to stop fullscreen animations on my macbook. Stumbled across this while looking for a fix to stop the animation.

br0g commented May 8, 2015

Did some of the "default write" commands work for you? I ran them and did not see any new changes. Had to run as the user that was logged in ... as not sudo. But I can't for the life of me set the hot corners using..
defaults write com.apple.dock.wvous-bl_codecorner -int 5
defaults write com.apple.dock.wvous-bl_modifier -int 0

Great thanks!

Owner

saetia commented Jun 10, 2015

@br0g those will work when you logout or restart

galxy25 commented Jul 11, 2015

Have not been able to install node from homebrew or from source after updating to the public-beta . For home-brew I get:

 /usr/local/Cellar/pkg-config/0.28: 10 files, 604K, built in 74 seconds
==> Installing node
==> Downloading https://nodejs.org/dist/v0.12.7/node-v0.12.7.tar.gz
######################################################################## 100.0%
==> ./configure --prefix=/usr/local/Cellar/node/0.12.7 --without-npm --without-ssl2 --without-ssl3
==> make install
ld: library not found for -lgcc_s.10.5
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [/private/tmp/node20150710-15730-d81eow/node-v0.12.7/out/Release/openssl-cli] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [node] Error 2

READ THIS: https://git.io/brew-troubleshooting

These open issues may also help:
Adding formulas for ndenv and node-build. Inspired by rbenv and ruby-build formulas. (https://github.com/Homebrew/homebrew/pull/34994)
Warning: You are using OS X 10.11.
We do not provide support for this pre-release version.
You may encounter build failures or other breakage.

molovo commented Jul 11, 2015

@galxy25 I ran into the same issue with 10.11. Needed to download and install Xcode 7 beta, and select the command line tools for that version in Xcode > Preferences > Locations. After doing that node compiled with homebrew without any issues.

A video tutoiral might come in handy, what's say? @saetia

abecko commented Oct 1, 2015

Hi I'm trying to install PEAR and PECL on OS X 10.11, and I have problem.

abe-mbp% cd /usr/lib/php
abe-mbp% sudo php install-pear-nozlib.phar
Password:
[PEAR] Archive_Tar: failed to mkdir /usr/lib/php/pear/Archive
[PEAR] Console_Getopt: failed to mkdir /usr/lib/php/pear/Console
warning: pear/PEAR requires package "pear/Archive_Tar" (version >= 1.3.7)
warning: pear/PEAR requires package "pear/Structures_Graph" (recommended version 1.0.4)
warning: pear/PEAR requires package "pear/Console_Getopt" (recommended version 1.2.3)
warning: pear/PEAR requires package "pear/XML_Util" (recommended version 1.2.1)
[PEAR] PEAR: failed to mkdir /usr/lib/php/pear/OS
[PEAR] Structures_Graph: failed to mkdir /usr/lib/php/pear/docs/Structures_Graph/docs/html/media
[PEAR] XML_Util: failed to mkdir /usr/lib/php/pear/docs/XML_Util/examples
abe-mbp% pear
zsh: command not found: pear

Can anyone help?

micti commented Oct 2, 2015

@abecko
beacause of "Rootless" or "System Integrity Protection" feature.
Third party app can't not modify something even if you use sudo command (Like sudo mkdir usr/lib....)
More info http://apple.stackexchange.com/questions/193368/what-is-the-rootless-feature-in-el-capitan-really

ghlecl commented Oct 3, 2015

Sorry to bother, but can someone confirm that the

defaults write com.apple.finder QLEnableTextSelection -bool TRUE

command still works. I have done a fresh install of El Capitan and I have been trying to make text selections in QuickLook work, but I seem to be unable to. What happens when I click to make a selection is always that the windows is "selected" and moves around with the mouse.

Thanks for this gist!
It never occurred to me to configure Mac OS setting like this after a clean install.
I was completely unaware of about half of these, and really look forward to implementing most of them.
This is going to save me so much time, and make my general computing experience much more comfortable.
Again... I just wanted to express my appreciation for your work and effort to create and maintain this gist.
👍

@ghlecl I got the same issue. I can't select text...
I also tested with:
defaults write com.apple.finder QLEnableTextSelection -boolean YES;

abecko commented Oct 4, 2015

@micti thx for info!

@ghlecl @ManUtopiK same problem here with QLEnableTextSelection

hanksudo commented Oct 6, 2015

QLEnableTextSelection doesn't work for me, too.

EmptyJay commented Oct 6, 2015

QLEnableTextSelection seems to have gone away in El Cap. Gah!

QLEnableTextSelection doesn't work for me, too. Any fix?

Great Gist!
Thanks

A great addition to this and I recommend you check out http://pow.cx/ and http://xip.io/

n0ts commented Oct 26, 2015

In my El Cap,
defaults write com.apple.dashboard enabled-state 2
is
defaults write com.apple.dashboard dashboard-enabled-state 2

I hate setting up my local machine. I typically develop right on my servers (I know it's a bad practice). But here's my question...

I want to install the bare minimums for developing a wordpress site on my local machine using Nginx, MySQL, PHP... Which packages should I install?

Thanks!

vigo commented Oct 28, 2015

I guess Apple killded QLEnableTextSelection feature in EL CAP.

tucq88 commented Nov 4, 2015

I'm using El Captain 10.11.1 and QLEnableTextSelection doesn't work as well. I can't even find that setting. It seems like Apple has removed that or replaced with something else. Damn.

kmassada commented Nov 7, 2015

fast way to configure example.com.build

https://gist.github.com/kmassada/1ad1b0e1742139b8f3d5

Hi guys,
I found this useful (but not confirmed) comment that explain the QL QLEnableTextSelection trick:

As much as I find this useful, this presents a bug which I find more infuriating than having this convenience.
The bug being the Quick Look white/blank image/snapback bug.
What happens is when viewing images via QL and scrolling through them with your arrow keys, and you move back one image, that image may not display. This bug has been around for a while now. The only fix for this is to disable the quick look text selection.

https://apple.stackexchange.com/questions/128825/quicklook-blanks-when-d...
https://discussions.apple.com/thread/6018924?start=0&tstart=0

It also explain the annoying bug that hides she QL images preview, when moving back to the previous image.
Maybe Apple fixed the bug

source: http://www.imore.com/how-enable-text-selection-os-x-quick-look#comment-653144

lsloan commented Nov 13, 2015

The references cited in the last comment doesn't explain the QLEnableTextSelection feature. If that feature interferes with other Quick Look features, then they might explain why that feature no longer works.

eheiser commented Nov 18, 2015

If I do a clean install and the use migration assistant to copy over my data and apps, does this lose all the node, npm and homebrew junk? My current install is seriously borked and I'd like to start from scratch.

Mipme commented Dec 12, 2015

usually all the lowlevel apps and config gets lost – (Apache, PHP, etc.). But it renames some of the files to .old. Yes, it's always a big effort to upgrade a dev machine!

Mipme commented Dec 12, 2015

Some of the commands described in this gist are not working under el capitan no more – because of the new "System Integrity Protection". One guide how to disable it, is here: http://www.macworld.com/article/2986118/security/how-to-modify-system-integrity-protection-in-el-capitan.html

@abecko I have met this problem, do you slove this problem?? turn SIP off ??

abecko commented Dec 30, 2015

@jasonsworld No, i don't have a solution. I wan't disable SIP :/

ryderr commented Jan 8, 2016

thanks for this.

Hi,
can you help me with installing mcrypt and smbclient php extensions?
I have follow all instruction to install it and done it correctly, but after restart I don't see there this two extension. I have installed others also and this I have running in php.

Thanks.

chromuh commented Feb 6, 2016

ayeeeeee

gxgani commented Mar 10, 2016

Suggestion: Disable Accented Character menu

defaults write -g ApplePressAndHoldEnabled -bool false

This helped alot! Thank you.

@abecko @jasonsworld Might be too little, too late, but found a solution to the

warning: pear/PEAR requires package "pear/Archive_Tar"

problem. Seems to have gotten things installed satisfactorily.

sudo php /usr/lib/php/install-pear-nozlib.phar -d /usr/local/lib/php -b /usr/local/bin

here

http://stackoverflow.com/questions/32893056/installing-pecl-and-pear-on-os-x-10-11-el-capitan-or-macos-10-12-sierra

if nothing else, maybe it'll help someone else who comes bumbling around these parts. :P

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