Skip to content

Instantly share code, notes, and snippets.

@andrewvaughan
Last active March 2, 2023 02:12
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save andrewvaughan/8923161 to your computer and use it in GitHub Desktop.
Save andrewvaughan/8923161 to your computer and use it in GitHub Desktop.
Mac OSX Setup

Mac OSX Bootstrap

Upgrade to Mavericks

  1. Install Mavericks 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

  1. Show remaining battery time; hide percentage

defaults write com.apple.menuextra.battery ShowPercent -string "NO" defaults write com.apple.menuextra.battery ShowTime -string "YES"

  1. Show all filename extensions in Finder

defaults write NSGlobalDomain AppleShowAllExtensions -bool true

  1. Use current directory as default search scope in Finder

defaults write com.apple.finder FXDefaultSearchScope -string "SCcf"

  1. Show Path bar in Finder

defaults write com.apple.finder ShowPathbar -bool true

  1. Show Status bar in Finder

defaults write com.apple.finder ShowStatusBar -bool true

  1. Expand save panel by default

defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode -bool true

  1. Expand print panel by default

defaults write NSGlobalDomain PMPrintingExpandedStateForPrint -bool true

  1. Disable the “Are you sure you want to open this application?” dialog

defaults write com.apple.LaunchServices LSQuarantine -bool false

  1. Disable shadow in screenshots

defaults write com.apple.screencapture disable-shadow -bool true

  1. Enable highlight hover effect for the grid view of a stack (Dock)

defaults write com.apple.dock mouse-over-hilte-stack -bool true

  1. Enable spring loading for all Dock items

defaults write enable-spring-load-actions-on-all-items -bool true

  1. Show indicator lights for open applications in the Dock

defaults write com.apple.dock show-process-indicators -bool true

  1. Disable auto-correct

defaults write NSGlobalDomain NSAutomaticSpellingCorrectionEnabled -bool false

  1. Enable AirDrop over Ethernet and on unsupported Macs running Lion

defaults write com.apple.NetworkBrowser BrowseAllInterfaces -bool true

  1. 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

  1. Display full POSIX path as Finder window title

defaults write com.apple.finder _FXShowPosixPathInTitle -bool true

  1. Avoid creating .DS_Store files on network volumes

defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true

  1. Disable the warning when changing a file extension

defaults write com.apple.finder FXEnableExtensionChangeWarning -bool false

  1. Show item info below desktop icons

/usr/libexec/PlistBuddy -c "Set :DesktopViewSettings:IconViewSettings:showItemInfo true" ~/Library/Preferences/com.apple.finder.plist

  1. Enable snap-to-grid for desktop icons

/usr/libexec/PlistBuddy -c "Set :DesktopViewSettings:IconViewSettings:arrangeBy grid" ~/Library/Preferences/com.apple.finder.plist

  1. Enable tap to click (Trackpad)

defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad Clicking -bool true

  1. Disable Safari’s thumbnail cache for History and Top Sites

defaults write com.apple.Safari DebugSnapshotsUpdatePolicy -int 2

  1. Enable Safari’s debug menu

defaults write com.apple.Safari IncludeInternalDebugMenu -bool true

  1. Make Safari’s search banners default to Contains instead of Starts With

defaults write com.apple.Safari FindOnPageMatchesWordStartsOnly -bool false

  1. Add a context menu item for showing the Web Inspector in web views

defaults write NSGlobalDomain WebKitDeveloperExtras -bool true

  1. Only use UTF-8 in Terminal.app

defaults write com.apple.terminal StringEncodings -array 4

  1. Disable the Ping sidebar in iTunes

defaults write com.apple.iTunes disablePingSidebar -bool true

  1. Disable all the other Ping stuff in iTunes

defaults write com.apple.iTunes disablePing -bool true

  1. Show the ~/Library folder

chflags nohidden ~/Library

  1. Configure Spotlight searching
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

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
  2. Add to ~/.bash_profile:
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:
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.

  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

  1. 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

  1. 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

  1. Move Nginx Configuration
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
  2. DaisyDisk
  3. Cloud
  4. Textual
  5. Todoist
  6. Alfred

Install Other Applications

  1. TextMate
  2. PHPStorm
  3. Adobe CS
  4. VirtualBox
  5. Dropbox
  6. FileZilla
  7. Spotify
  8. Adium
  9. Skype
  10. Steam
  11. RescueTime
  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
alias utcnow='(TZ=UTC date '\''+%Y.%m.%d_%H.%M'\'')'
alias utcnowpb='(TZ=UTC date '\''+%Y.%m.%d_%H.%M'\'') | pbcopy'
  1. CLI XDebug Flags
alias xdoff='unset XDEBUG_CONFIG'
alias xdon='export XDEBUG_CONFIG='\''idekey=default'\'''

Download IE test VMs

  1. IE8 (WinXP)
curl -O "https://az412801.vo.msecnd.net/vhd/IEKitV1_Final/VirtualBox/OSX/IE8_XP/IE8.XP.For.MacVirtualBox.ova"
  1. IE9 (Win7)
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}"
  1. IE10 (Win8)
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}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment