Skip to content

Instantly share code, notes, and snippets.

@ebetancourt
Forked from matiskay/gist:3181894
Last active October 7, 2015 16:38
Show Gist options
  • Save ebetancourt/3194974 to your computer and use it in GitHub Desktop.
Save ebetancourt/3194974 to your computer and use it in GitHub Desktop.
Clean Install – Mountain Lion OS X 10.8 DP3

#Mac OS X

Apps

#Xcode Command Line Tools

Xcode > Preferences > Downloads > Command Line Tools

#Shell

Switch to z-shell

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

Update .zshrc

vim ~/.zshrc

Configure zsh plugins

ZSH=$HOME/.oh-my-zsh
ZSH_THEME="kphoen"
plugins=(git osx rails ruby github node npm brew)
source $ZSH/oh-my-zsh.sh
export PATH=/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/mysql/bin:/usr/X11/bin

Install rvm

curl https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer | bash -s stable

Install rubies

rvm get head
rvm install 1.9.3

OS X Preferences

#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

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

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

#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

#Get rid of hidden dock delay
defaults write com.apple.Dock autohide-delay -float 0 && killall Dock

Set hostname (Still need to set the Hostname in Sharing Prefs)

sudo scutil --set HostName EVE

Install python

brew install python --framework --universal

Add into your ~/.zshrc

export PATH=/usr/local/share/python:$PATH

Change system symlinks

cd /System/Library/Frameworks/Python.framework/Versions
sudo rm Current
ln -s /usr/local/Cellar/python/2.7.2/Frameworks/Python.framework/Versions/Current

Install pip & virtualenv

easy_install pip
pip install virtualenv
pip install virtualenvwrapper

Source virtualenvwrapper script

source /usr/local/share/python/virtualenvwrapper.sh

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

#flush cache
dscacheutil -flushcache

#ensure it works
scutil --dns

XDebug

brew tap josegonzalez/homebrew-php
brew install xdebug-php
brew install mcrypt

MySQL

MySQL Settings

#setup daemon
mkdir -p ~/Library/LaunchAgents && cp /usr/local/Cellar/mysql/5.5.28/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.28/bin/mysql_secure_installation

PostgreSQL

brew install --without-ossp-uuid postgres

PostgreSQL Settings

#create database
initdb /usr/local/var/postgres

#autostart
mkdir -p ~/Library/LaunchAgents
cp /usr/local/Cellar/postgresql/9.1.4/homebrew.mxcl.postgresql.plist ~/Library/LaunchAgents
launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist

#fix the psql error
sudo mkdir /var/pgsql_socket/
ln -s /private/tmp/.s.PGSQL.5432 /var/pgsql_socket/

#create user and databases
createuser user
createdb -Ouser -Eutf8 -T template0 user_development
createdb -Ouser -Eutf8 -T template0 user_test

Configure php.ini

#create php.ini
sudo touch /etc/php.ini && subl /etc/php.ini
[PHP]

engine = On
short_open_tag = Off
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 = 256M
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 = /Users/elliot/Sites/logs/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
zend_extension="/usr/local/Cellar/xdebug-php/2.1.3/xdebug.so"

[Date]

date.timezone = "America/New_York"

[filter]

[iconv]

[intl]

[sqlite]

[sqlite3]

[Pcre]

[Pdo]

[Pdo_mysql]

pdo_mysql.cache_size = 2000
pdo_mysql.default_socket=/var/mysql/mysql.sock

[Phar]

[Syslog]

define_syslog_variables  = Off

[mail function]

SMTP = localhost
smtp_port = 25
mail.add_x_header = On

[SQL]

sql.safe_mode = Off

[ODBC]

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

[Interbase]

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]

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]

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]

mysqlnd.collect_statistics = On
mysqlnd.collect_memory_statistics = Off

[OCI8]

[PostgresSQL]

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

[Sybase-CT]

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

[bcmath]

bcmath.scale = 0

[browscap]

[Session]

session.save_handler = files
session.use_cookies = 1
session.use_only_cookies = 1
session.name = 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]

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

[Assertion]

[COM]

[mbstring]

[gd]

[exif]

[Tidy]

tidy.clean_output = Off

[soap]

soap.wsdl_cache_enabled=1
soap.wsdl_cache_dir="/tmp"
soap.wsdl_cache_ttl=86400
soap.wsdl_cache_limit = 5

[sysvshm]

[ldap]

ldap.max_links = -1

[mcrypt]

[dba]

[xdebug]
xdebug.idekey="macgdbp"
xdebug.remote_enable=1 
xdebug.remote_handler=dbgp 
xdebug.remote_mode=req 
xdebug.remote_host=127.0.0.1 
xdebug.remote_port=9000 
xdebug.profiler_append=1 
xdebug.profiler_enable=1
xdebug.profiler_enable_trigger=1 
xdebug.profiler_output_name = cachegrind.out.%s 
xdebug.profiler_output_dir=/tmp/

Restart apache

sudo apachectl graceful

aww yeah

ruby -e "$(curl -fsSkL raw.github.com/mxcl/homebrew/go)";
brew tap homebrew/dupes;
brew tap josegonzalez/homebrew-php;
brew install ack atlassian-plugin-sdk autoconf autojump automake bash-completion bcrypt byobu cmake colordiff coreutils ctags curl dnsmasq elasticsearch fasd freetype gd gdbm gettext git gnu-sed graphviz grc hub icoutils imagemagick jasper jpeg libevent libgpg-error libksba libmemcached libpng libtiff libtool libxml2 libxslt lighttpd little-cms lzo macvim mcrypt memcached mongodb mysql nginx node ossp-uuid pcre php53 php53-mcrypt php53-xdebug pidof pkg-config postgresql putty qcachegrind qt readline redis scons sphinx sqlite ssh-copy-id swig tmux v8 watch wget xz zeromq zlib tig git-flow;
cd
svn co svn://anonsvn.kde.org/home/kde/trunk/KDE/kdesdk/kcachegrind kcachegrind
cd kcachegrind/qcachegrind
qmake -spec 'macx-g++'
make
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment