Skip to content

Instantly share code, notes, and snippets.

Last active July 16, 2024 05:56
Show Gist options
  • Save saetia/1623487 to your computer and use it in GitHub Desktop.
Save saetia/1623487 to your computer and use it in GitHub Desktop.
Clean Install – OS X 10.11 El Capitan

#Mac OS X

Mensch coding font


Webkit, Chrome, Firefox, iTerm, Transmit, Coda, Sublime Text, Sequel Pro, 1Password, LiveReload, LiveReload Extensions

#Xcode Command Line Tools

Xcode > Preferences > Downloads > Command Line Tools


Switch to z-shell

curl -L | sh


ruby <(curl -fsSkL"
brew install git ack wget curl redis memcached libmemcached colordiff imagemagick icoutils

Update .zshrc

wget -O ~/.zshrc

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 FXDefaultSearchScope -string "SCcf"

#Show Path bar in Finder
defaults write ShowPathbar -bool true

#Show Status bar in Finder
defaults write ShowStatusBar -bool true

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

#Enable AirDrop over Ethernet and on unsupported Macs running Lion
defaults write 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 12

#Disable disk image verification
defaults write skip-verify -bool true &&
defaults write skip-verify-locked -bool true &&
defaults write skip-verify-remote -bool true

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

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

#Disable the Ping sidebar in iTunes
defaults write 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 hide-ping-dropdown true

Set hostname

sudo scutil --set HostName Work


Setup Github

ssh-keygen -t rsa -C ""

#copy ssh key to
subl ~/.ssh/

#test connection
ssh -T

#set git config values
git config --global "Joel Glovacki"
git config --global ""
git config --global github.user saetia
git config --global github.token your_token_here

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


Install markdown support

git clone ~/Library/Application\ Support/Coda\ 2/modes/Markdown.mode

#Sublime Text

Add Sublime Text CLI

sudo mkdir -p "/usr/local/bin/" && ln -s "/Applications/Sublime Text" "/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(''+pf.replace(' ','%20')).read()); print 'Please restart Sublime Text to finish installation'

Install Soda Theme

git clone git:// ~/Library/Application\ Support/Sublime\ Text\ 2/Packages/Theme\ -\ Soda

Install Tomorrow Theme

git clone git:// ~/Library/Application\ Support/Sublime\ Text\ 2/Packages/Color\ Scheme\ -\ Tomorrow


	"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"} }


git clone "/Users/Joel/Library/Application Support/Sublime Text 2/Packages/Byte"


Install dnsmasq

brew install dnsmasq

Add DNS Domains

mkdir -p /usr/local/etc/ &&
echo "address=/build/" >> /usr/local/etc/dnsmasq.conf && 
echo "address=/stage/" >> /usr/local/etc/dnsmasq.conf && 
echo "listen-address=" >> /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' > /etc/resolver/build

#flush cache
dscacheutil -flushcache

#ensure it works
scutil --dns

Enable virtual hosts

subl "/etc/apache2/users/$USER.conf"
DocumentRoot "/Users/Joel/Sites/"
NameVirtualHost *:80
<Directory "/Users/Joel/Sites/">
    Options Indexes MultiViews FollowSymLinks Includes
    AllowOverride All
    Order allow,deny
    Allow from all
<VirtualHost *:80>
    UseCanonicalName off
    VirtualDocumentRoot /Users/Joel/Sites/%-2+/httpdocs
#open apache config
subl "/etc/apache2/httpd.conf"

Configure httpd.conf

ServerRoot "/usr"

Listen 80

LoadModule authn_file_module libexec/apache2/
LoadModule authn_dbm_module libexec/apache2/
LoadModule authn_anon_module libexec/apache2/
LoadModule authn_dbd_module libexec/apache2/
LoadModule authn_default_module libexec/apache2/
LoadModule authz_host_module libexec/apache2/
LoadModule authz_groupfile_module libexec/apache2/
LoadModule authz_user_module libexec/apache2/
LoadModule authz_dbm_module libexec/apache2/
LoadModule authz_owner_module libexec/apache2/
LoadModule authz_default_module libexec/apache2/
LoadModule auth_basic_module libexec/apache2/
LoadModule auth_digest_module libexec/apache2/
LoadModule cache_module libexec/apache2/
LoadModule disk_cache_module libexec/apache2/
LoadModule mem_cache_module libexec/apache2/
LoadModule dbd_module libexec/apache2/
LoadModule dumpio_module libexec/apache2/
LoadModule reqtimeout_module libexec/apache2/
LoadModule ext_filter_module libexec/apache2/
LoadModule include_module libexec/apache2/
LoadModule filter_module libexec/apache2/
LoadModule substitute_module libexec/apache2/
LoadModule deflate_module libexec/apache2/
LoadModule log_config_module libexec/apache2/
LoadModule log_forensic_module libexec/apache2/
LoadModule logio_module libexec/apache2/
LoadModule env_module libexec/apache2/
LoadModule mime_magic_module libexec/apache2/
LoadModule cern_meta_module libexec/apache2/
LoadModule expires_module libexec/apache2/
LoadModule headers_module libexec/apache2/
LoadModule ident_module libexec/apache2/
LoadModule usertrack_module libexec/apache2/
#LoadModule unique_id_module libexec/apache2/
LoadModule setenvif_module libexec/apache2/
LoadModule version_module libexec/apache2/
LoadModule proxy_module libexec/apache2/
LoadModule proxy_connect_module libexec/apache2/
LoadModule proxy_ftp_module libexec/apache2/
LoadModule proxy_http_module libexec/apache2/
LoadModule proxy_scgi_module libexec/apache2/
LoadModule proxy_ajp_module libexec/apache2/
LoadModule proxy_balancer_module libexec/apache2/
LoadModule ssl_module libexec/apache2/
LoadModule mime_module libexec/apache2/
LoadModule dav_module libexec/apache2/
LoadModule status_module libexec/apache2/
LoadModule autoindex_module libexec/apache2/
LoadModule asis_module libexec/apache2/
LoadModule info_module libexec/apache2/
LoadModule cgi_module libexec/apache2/
LoadModule dav_fs_module libexec/apache2/
LoadModule vhost_alias_module libexec/apache2/
LoadModule negotiation_module libexec/apache2/
LoadModule dir_module libexec/apache2/
LoadModule imagemap_module libexec/apache2/
LoadModule actions_module libexec/apache2/
LoadModule speling_module libexec/apache2/
LoadModule userdir_module libexec/apache2/
LoadModule alias_module libexec/apache2/
LoadModule rewrite_module libexec/apache2/
#LoadModule perl_module libexec/apache2/
LoadModule php5_module libexec/apache2/
#LoadModule hfs_apple_module libexec/apache2/

<IfModule !mpm_netware_module>
<IfModule !mpm_winnt_module>

User _www
Group _www



ServerName localhost

DocumentRoot "/Library/WebServer/Documents"

<Directory />
    Options FollowSymLinks
    AllowOverride None
    Order deny,allow
    Deny from all

<Directory "/Library/WebServer/Documents">
    Options Indexes FollowSymLinks MultiViews
    AllowOverride None
    Order allow,deny
    Allow from all

<IfModule dir_module>
    DirectoryIndex index.php index.html

<FilesMatch "^\.([Hh][Tt]|[Dd][Ss]_[Ss])">
    Order allow,deny
    Deny from all
    Satisfy All

<Files "rsrc">
    Order allow,deny
    Deny from all
    Satisfy All

<DirectoryMatch ".*\.\.namedfork">
    Order allow,deny
    Deny from all
    Satisfy All

ErrorLog "/private/var/log/apache2/error_log"

LogLevel warn

<IfModule log_config_module>

    LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
    LogFormat "%h %l %u %t \"%r\" %>s %b" common

    <IfModule logio_module>
      LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio

    CustomLog "/private/var/log/apache2/access_log" common


<IfModule alias_module>
    ScriptAliasMatch ^/cgi-bin/((?!(?i:webobjects)).*$) "/Library/WebServer/CGI-Executables/$1"

<IfModule cgid_module>

<Directory "/Library/WebServer/CGI-Executables">
    AllowOverride None
    Options None
    Order allow,deny
    Allow from all

DefaultType text/plain

<IfModule mime_module>

    TypesConfig /private/etc/apache2/mime.types

    AddType application/x-compress .Z
    AddType application/x-gzip .gz .tgz


TraceEnable off

Include /private/etc/apache2/extra/httpd-mpm.conf
Include /private/etc/apache2/extra/httpd-autoindex.conf
Include /private/etc/apache2/extra/httpd-languages.conf
Include /private/etc/apache2/extra/httpd-userdir.conf
Include /private/etc/apache2/extra/httpd-manual.conf

<IfModule ssl_module>
    SSLRandomSeed startup builtin
    SSLRandomSeed connect builtin

<IfModule php5_module>
    AddType application/x-httpd-php .php
    AddType application/x-httpd-php-source .phps
    <IfModule dir_module>
        DirectoryIndex index.html index.php

Include /private/etc/apache2/other/*.conf

Enable centOS style /var/www/vhosts

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


brew install


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

Configure php.ini

#create php.ini
sudo touch /etc/php.ini && subl /etc/php.ini

engine = On
short_open_tag = On
asp_tags = Off
precision = 14
y2k_compliance = On
output_buffering = 4096
;output_handler =
zlib.output_compression = On
zlib.output_compression_level = -1
zlib.output_handler =
implicit_flush = Off
unserialize_callback_func =
serialize_precision = 17
allow_call_time_pass_reference = Off
safe_mode = Off
safe_mode_gid = Off
safe_mode_include_dir =
safe_mode_exec_dir =
safe_mode_allowed_env_vars = PHP_
safe_mode_protected_env_vars = LD_LIBRARY_PATH
disable_functions =
disable_classes =
expose_php = On
max_execution_time = 30
max_input_time = 60
memory_limit = 128M
error_reporting = E_ALL | E_STRICT
display_errors = On
display_startup_errors = Off
log_errors = On
log_errors_max_len = 1024
ignore_repeated_errors = Off
ignore_repeated_source = Off
report_memleaks = On
track_errors = Off
html_errors = On
;error_prepend_string = "<span style='color: #ff0000'>"
;error_append_string = "</span>"
;error_log = php_errors.log
;error_log = syslog
variables_order = "GPCS"
request_order = "GP"
register_globals = Off
register_long_arrays = Off
register_argc_argv = Off
auto_globals_jit = On
post_max_size = 8M
magic_quotes_gpc = Off
magic_quotes_runtime = Off
magic_quotes_sybase = Off
auto_prepend_file =
auto_append_file =
default_mimetype = "text/html"
default_charset = "utf-8"
include_path = ".:/usr/lib/php/pear"
doc_root =
user_dir =
extension_dir = "/usr/lib/php/extensions/no-debug-non-zts-20090626"
enable_dl = Off
file_uploads = On
upload_max_filesize = 2M
max_file_uploads = 20
allow_url_fopen = On
allow_url_include = Off
default_socket_timeout = 60


date.timezone = "UTC"









pdo_mysql.cache_size = 2000



define_syslog_variables  = Off

[mail function]

SMTP = localhost
smtp_port = 25
mail.add_x_header = On


sql.safe_mode = Off


odbc.allow_persistent = On
odbc.check_persistent = On
odbc.max_persistent = -1
odbc.max_links = -1
odbc.defaultlrl = 4096
odbc.defaultbinmode = 1


ibase.allow_persistent = 1
ibase.max_persistent = -1
ibase.max_links = -1
ibase.timestampformat = "%Y-%m-%d %H:%M:%S"
ibase.dateformat = "%Y-%m-%d"
ibase.timeformat = "%H:%M:%S"


mysql.allow_local_infile = On
mysql.allow_persistent = On
mysql.cache_size = 2000
mysql.max_persistent = -1
mysql.max_links = -1
mysql.default_port = 3306
mysql.default_socket = /var/mysql/mysql.sock
mysql.default_host =
mysql.default_user =
mysql.default_password =
mysql.connect_timeout = 60
mysql.trace_mode = Off


mysqli.max_persistent = -1
mysqli.allow_persistent = On
mysqli.max_links = -1
mysqli.cache_size = 2000
mysqli.default_port = 3306
mysqli.default_socket = /var/mysql/mysql.sock
mysqli.default_host =
mysqli.default_user =
mysqli.default_pw =
mysqli.reconnect = Off


mysqlnd.collect_statistics = On
mysqlnd.collect_memory_statistics = Off



pgsql.allow_persistent = On
pgsql.auto_reset_persistent = Off
pgsql.max_persistent = -1
pgsql.max_links = -1
pgsql.ignore_notice = 0
pgsql.log_notice = 0


sybct.allow_persistent = On
sybct.max_persistent = -1
sybct.max_links = -1
sybct.min_server_severity = 10
sybct.min_client_severity = 10


bcmath.scale = 0



session.save_handler = files
session.use_cookies = 1
session.use_only_cookies = 1 = PHPSESSID
session.auto_start = 0
session.cookie_lifetime = 0
session.cookie_path = /
session.cookie_domain =
session.cookie_httponly =
session.serialize_handler = php
session.gc_probability = 1
session.gc_divisor = 1000
session.gc_maxlifetime = 1440
session.bug_compat_42 = Off
session.bug_compat_warn = Off
session.referer_check =
session.entropy_length = 0
session.cache_limiter = nocache
session.cache_expire = 180
session.use_trans_sid = 0
session.hash_function = 0
session.hash_bits_per_character = 5
url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=fakeentry"


mssql.allow_persistent = On
mssql.max_persistent = -1
mssql.max_links = -1
mssql.min_error_severity = 10
mssql.min_message_severity = 10
mssql.compatability_mode = Off
mssql.secure_connection = Off







tidy.clean_output = Off


soap.wsdl_cache_limit = 5



ldap.max_links = -1



xdebug.profiler_output_name = cachegrind.out.%s 

Restart apache

sudo apachectl graceful


cd /usr/lib/php &&
sudo php install-pear-nozlib.phar &&
sudo pear channel-update &&
sudo pecl channel-update &&
sudo pear upgrade-all &&
sudo pear channel-discover  &&
sudo pear channel-discover &&
sudo pear channel-discover &&
sudo pear install phpunit/PHPUnit &&
sudo pear install phpunit/phpcpd &&
sudo pear install PHP_CodeSniffer


gem install growl guard guard-phpunit

aww yeah

Copy link

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.

Copy link

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

Copy link

abecko commented Oct 4, 2015

@micti thx for info!

Copy link

@ghlecl @ManUtopiK same problem here with QLEnableTextSelection

Copy link

hanksudo commented Oct 6, 2015

QLEnableTextSelection doesn't work for me, too.

Copy link

EmptyJay commented Oct 6, 2015

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

Copy link

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

Great Gist!

Copy link

A great addition to this and I recommend you check out and

Copy link

n0ts commented Oct 26, 2015

In my El Cap,
defaults write enabled-state 2
defaults write dashboard-enabled-state 2

Copy link

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?


Copy link

vigo commented Oct 28, 2015

I guess Apple killded QLEnableTextSelection feature in EL CAP.

Copy link

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.

Copy link

kmassada commented Nov 7, 2015

fast way to configure

Copy link

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.

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


Copy link

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.

Copy link

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.

Copy link

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!

Copy link

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:

Copy link

Copy link

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

Copy link

abecko commented Dec 30, 2015

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

Copy link

Converted this into an Ansible build

Copy link

ryderr commented Jan 8, 2016

thanks for this.

Copy link

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.


Copy link

chromuh commented Feb 6, 2016


Copy link

gxgani commented Mar 10, 2016

Suggestion: Disable Accented Character menu

defaults write -g ApplePressAndHoldEnabled -bool false

Copy link

This helped alot! Thank you.

Copy link

@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


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

Copy link

It's not that the defaults write command fails. I verified the file, and it wrote the variable to it.
The problem is somewhere in the design. Maybe they have moved it?
I have been looking in the containers and other files but no luck yet.
I hope they didn't completely kill it.
Maybe there is a way to copy the old Yosemite version of QL back?
If I figure it out, I will update here.

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