# Mac OSX Bootstrap ## Upgrade to Mavericks 1. Install [Mavericks](https://itunes.apple.com/us/app/os-x-mavericks/id675248567) via the App Store. ## Secure The Machine 1. Open **System Preferences** and choose **Security & Privacy**. 2. In the **General** tab, ensure that a password is required after sleep or screen saver, and disable automatic login. 3. In the **FileVault** tab, click **"Turn On FileVault..."** and follow the instructions to secure your entire disk. ## Set Mac Configrations 1. Enable full keyboard access for all controls (e.g. enable Tab in modal dialogs) > `defaults write NSGlobalDomain AppleKeyboardUIMode -int 3` 2. Show remaining battery time; hide percentage > `defaults write com.apple.menuextra.battery ShowPercent -string "NO"` > `defaults write com.apple.menuextra.battery ShowTime -string "YES"` 3. Show all filename extensions in Finder > `defaults write NSGlobalDomain AppleShowAllExtensions -bool true` 4. Use current directory as default search scope in Finder > `defaults write com.apple.finder FXDefaultSearchScope -string "SCcf"` 5. Show Path bar in Finder > `defaults write com.apple.finder ShowPathbar -bool true` 6. Show Status bar in Finder > `defaults write com.apple.finder ShowStatusBar -bool true` 7. Expand save panel by default > `defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode -bool true` 8. Expand print panel by default > `defaults write NSGlobalDomain PMPrintingExpandedStateForPrint -bool true` 9. Disable the “Are you sure you want to open this application?” dialog > `defaults write com.apple.LaunchServices LSQuarantine -bool false` 10. Disable shadow in screenshots > `defaults write com.apple.screencapture disable-shadow -bool true` 11. Enable highlight hover effect for the grid view of a stack (Dock) > `defaults write com.apple.dock mouse-over-hilte-stack -bool true` 12. Enable spring loading for all Dock items > `defaults write enable-spring-load-actions-on-all-items -bool true` 13. Show indicator lights for open applications in the Dock > `defaults write com.apple.dock show-process-indicators -bool true` 14. Disable auto-correct > `defaults write NSGlobalDomain NSAutomaticSpellingCorrectionEnabled -bool false` 15. Enable AirDrop over Ethernet and on unsupported Macs running Lion > `defaults write com.apple.NetworkBrowser BrowseAllInterfaces -bool true` 16. Automatically open a new Finder window when a volume is mounted > `defaults write com.apple.frameworks.diskimages auto-open-ro-root -bool true` > `defaults write com.apple.frameworks.diskimages auto-open-rw-root -bool true` > `defaults write com.apple.finder OpenWindowForNewRemovableDisk -bool true` 17. Display full POSIX path as Finder window title > `defaults write com.apple.finder _FXShowPosixPathInTitle -bool true` 18. Avoid creating .DS_Store files on network volumes > `defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true` 19. Disable the warning when changing a file extension > `defaults write com.apple.finder FXEnableExtensionChangeWarning -bool false` 20. Show item info below desktop icons > `/usr/libexec/PlistBuddy -c "Set :DesktopViewSettings:IconViewSettings:showItemInfo true" ~/Library/Preferences/com.apple.finder.plist` 21. Enable snap-to-grid for desktop icons > `/usr/libexec/PlistBuddy -c "Set :DesktopViewSettings:IconViewSettings:arrangeBy grid" ~/Library/Preferences/com.apple.finder.plist` 22. Enable tap to click (Trackpad) > `defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad Clicking -bool true` 23. Disable Safari’s thumbnail cache for History and Top Sites > `defaults write com.apple.Safari DebugSnapshotsUpdatePolicy -int 2` 24. Enable Safari’s debug menu > `defaults write com.apple.Safari IncludeInternalDebugMenu -bool true` 25. Make Safari’s search banners default to *Contains* instead of *Starts With* > `defaults write com.apple.Safari FindOnPageMatchesWordStartsOnly -bool false` 26. Add a context menu item for showing the Web Inspector in web views > `defaults write NSGlobalDomain WebKitDeveloperExtras -bool true` 27. Only use UTF-8 in Terminal.app > `defaults write com.apple.terminal StringEncodings -array 4` 28. Disable the Ping sidebar in iTunes > `defaults write com.apple.iTunes disablePingSidebar -bool true` 29. Disable all the other Ping stuff in iTunes > `defaults write com.apple.iTunes disablePing -bool true` 30. Show the ~/Library folder > `chflags nohidden ~/Library` 31. Configure Spotlight searching ```sh defaults write com.apple.spotlight orderedItems -array \ '{"enabled" = 1;"name" = "APPLICATIONS";}' \ '{"enabled" = 1;"name" = "SYSTEM_PREFS";}' \ '{"enabled" = 1;"name" = "DIRECTORIES";}' \ '{"enabled" = 1;"name" = "PDF";}' \ '{"enabled" = 1;"name" = "FONTS";}' \ '{"enabled" = 0;"name" = "DOCUMENTS";}' \ '{"enabled" = 0;"name" = "MESSAGES";}' \ '{"enabled" = 0;"name" = "CONTACT";}' \ '{"enabled" = 0;"name" = "EVENT_TODO";}' \ '{"enabled" = 0;"name" = "IMAGES";}' \ '{"enabled" = 0;"name" = "BOOKMARKS";}' \ '{"enabled" = 0;"name" = "MUSIC";}' \ '{"enabled" = 0;"name" = "MOVIES";}' \ '{"enabled" = 0;"name" = "PRESENTATIONS";}' \ '{"enabled" = 0;"name" = "SPREADSHEETS";}' \ '{"enabled" = 0;"name" = "SOURCE";}' ``` ## Create SSH Keys 1. In a new terminal window, type `ssh-keygen -b 2048 -t rsa` to create a new, RSA secured SSH key. **Accept the default naming conventions and do enter a password when prompted.** 2. Distribute key as needed to GitHub, Servers, etc. ## Install XCode 1. Install [XCode](https://itunes.apple.com/us/app/xcode/id497799835) ## Install Command Line Tools 1. `xcode-select --install` 2. Click *Install* on the popup ## Install Bash-It 1. `git clone https://github.com/revans/bash-it.git ~/.bash_it` 2. `~/.bash_it/install.sh` ## Install MacPorts 1. Install [MacPorts](http://www.macports.org/install.php) 2. Add to ~/.bash_profile: ```bash export PATH=/opt/local/bin:/opt/local/sbin:$PATH ``` ## Install AutoSSH 1. `sudo port install autossh` ## Install Git 1. `sudo port install git-core +svn +doc +bash_completion +gitweb` 2. Setup globals: ```sh git config --global user.name "Andrew Vaughan" git config --global user.email andrew@undoubtedly.me ``` ## Install MySQL 1. `sudo port install mysql5-server mysql5 +server` 2. `sudo /opt/local/lib/mysql5/bin/mysql_install_db --user=mysql` 3. `sudo launchctl load -w /Library/LaunchDaemons/org.macports.mysql5.plist` ## Re-Install PHP 1. Occasionally, our PHP services require various versions of PHP. To make this easier to switch between, we make use of binary packages, as provided by Liip. Follow their instructions for installation on their [installation page](http://php-osx.liip.ch/). 2. Update the path by this terminal command: `export PATH=/usr/local/php5/bin:/usr/local/mysql/bin:$PATH` ## Install Nginx 1. `sudo port install nginx` ## Configure Web Services 1. Configure PHP-FPM > `sudo mv /usr/local/php5/etc/php-fpm.conf.default /usr/local/php5/etc/php-fpm.conf` 2. Enable APC > `sudo vi /usr/local/php5/php.d/50-extension-apc.ini` Should Look Like: > extension=/usr/local/php5/lib/php/extensions/no-debug-non-zts-20100525/apc.so > > [APC]
> apc.enabled = on
> apc.enable\_cli = on 3. Enable XDebug on Port 9100 > `sudo vi /usr/local/php5/php.d/50-extension-xdebug.ini` Should Look Like: > zend\_extension=/usr/local/php5/lib/php/extensions/no-debug-non-zts-20100525/xdebug.so > > [xdebug]
> xdebug.remote\_enable=on
> xdebug.default\_enable=on
> xdebug.remote\_autostart=off
> xdebug.remote\_port=9100
> xdebug.remote\_host=localhost
> xdebug.profiler\_enable\_trigger=1
> xdebug.profiler\_output\_name=xdebug-profile-cachegrind.out-%H-%R
> xdebug.var\_display\_max\_children = 128
> xdebug.var\_display\_max\_data = 2048
> xdebug.var\_display\_max\_depth = 128
> xdebug.max\_nesting\_level = 500 4. Move Nginx Configuration ```bash sudo mv /opt/local/etc/nginx/nginx.conf.default /opt/local/etc/nginx/nginx.conf sudo mv /opt/local/etc/nginx/fastcgi_params.default /opt/local/etc/nginx/fastcgi_params sudo mv /opt/local/etc/nginx/mime.types.default /opt/local/etc/nginx/mime.types ``` ## Install Composer 1. `cd ~` 2. `curl -skS https://getcomposer.org/installer | php` 3. `chmod ug+x composer.phar` 4. `sudo mv composer.phar /usr/bin/` ## Install Capistrano 1. `sudo gem install capistrano` ## Install Node.js 1. `sudo port install nodejs npm` 2. `npm adduser avaughan` ## Install and Configure App Store Applications 1. [1Password](https://itunes.apple.com/us/app/1password-password-manager/id443987910?mt=12) 2. [DaisyDisk](https://itunes.apple.com/us/app/daisydisk/id411643860?mt=12) 3. [Cloud](https://itunes.apple.com/us/app/cloud/id417602904?mt=12) 4. [Textual](https://itunes.apple.com/us/app/textual-irc-client/id403012667?mt=12) 5. [Todoist](https://itunes.apple.com/us/app/todoist-to-do-list-task-list/id585829637?mt=12) 6. [Alfred](https://itunes.apple.com/us/app/alfred/id405843582?mt=12) ## Install Other Applications 1. [TextMate](http://macromates.com/) 2. [PHPStorm](http://www.jetbrains.com/phpstorm/) 3. [Adobe CS](http://www.adobe.com/products/creativecloud.html) 4. [VirtualBox](https://www.virtualbox.org/) 5. [Dropbox](https://www.dropbox.com/) 6. [FileZilla](https://filezilla-project.org/) 7. [Spotify](https://www.spotify.com/) 8. [Adium](https://adium.im/) 9. [Skype](http://www.skype.com/en/) 10. [Steam](http://store.steampowered.com/about/) 11. [RescueTime](https://www.rescuetime.com) 12. Ableton Live 13. Jaksta ## Install CLI Utilities 1. `sudo port install gnutar wget ntop watch nmap unrar` ## Useful aliases for `~/.bash_profile` 1. UTC Now Timestamps ```sh alias utcnow='(TZ=UTC date '\''+%Y.%m.%d_%H.%M'\'')' alias utcnowpb='(TZ=UTC date '\''+%Y.%m.%d_%H.%M'\'') | pbcopy' ``` 2. CLI XDebug Flags ```sh alias xdoff='unset XDEBUG_CONFIG' alias xdon='export XDEBUG_CONFIG='\''idekey=default'\''' ``` ## Download IE test VMs 1. IE8 (WinXP) ```sh curl -O "https://az412801.vo.msecnd.net/vhd/IEKitV1_Final/VirtualBox/OSX/IE8_XP/IE8.XP.For.MacVirtualBox.ova" ``` 2. IE9 (Win7) ```sh curl -O "https://az412801.vo.msecnd.net/vhd/IEKitV1_Final/VirtualBox/OSX/IE9_Win7/IE9.Win7.For.MacVirtualBox.part{1.sfx,2.rar,3.rar,4.rar,5.rar}" ``` 3. IE10 (Win8) ```sh curl -O "https://az412801.vo.msecnd.net/vhd/IEKitV1_Final/VirtualBox/OSX/IE10_Win8/IE10.Win8.For.MacVirtualBox.part{1.sfx,2.rar,3.rar}" ```