Skip to content

Instantly share code, notes, and snippets.

@iamkevinv
Forked from marklawlor/setup.sh
Last active August 29, 2015 14:22
Show Gist options
  • Save iamkevinv/5d1342b95b5d46b3d7c0 to your computer and use it in GitHub Desktop.
Save iamkevinv/5d1342b95b5d46b3d7c0 to your computer and use it in GitHub Desktop.
Setup things for a new mac
#!/bin/bash
#
# Helper functions
#
function pause(){
read -p "$*"
}
#
# XCode install
#
# Install xcode
xcode-select --install
# Verify install
gcc --install
pause 'Verify Xcode was installed correctly and press [Enter] key to continue...'
#
# Homebrew install
#
# Check for Homebrew,
# Install if we don't have it
if test ! $(which brew); then
echo "Installing homebrew..."
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
fi
brew update; brew; brew upgrade brew-cask; brew doctor
pause 'Verify Brew was installed correctly and press [Enter] key to continue...'
#
# OSX Utility Install
#
echo "installing OSX utilities..."
# Install GNU core utilities (those that come with OS X are outdated)
brew install coreutils
# Install GNU `find`, `locate`, `updatedb`, and `xargs`, g-prefixed
brew install findutils
# Install Bash 4 to patch vunerabilities
brew install bash
# Install more recent versions of some OS X tools
brew tap homebrew/dupes
brew install homebrew/dupes/grep
#
# Binaries Install
#
binaries=(
python
git
zsh
z
ack
tig
vim
node
mongodb
)
echo "installing binaries..."
brew install ${binaries[@]}
brew linkapps
brew cleanup
#
# Application Install
#
brew install caskroom/cask/brew-cask
# Apps
apps=(
dropbox
google-chrome
firefox
vagrant
iterm2
sublime-text3
virtualbox
vlc
vagrant
vagrant-manager
)
# Install apps to /Applications
# Default is: /Users/$user/Applications
echo "installing apps..."
brew cask install --appdir="/Applications" ${apps[@]}
# Install a bunch of quick look plugins for devs
brew cask install qlcolorcode qlstephen qlmarkdown quicklook-json qlprettypatch quicklook-csv betterzipql qlimagesize webpquicklook suspicious-package
#
# Setup Bash
#
echo "installing zsh..."
# Setup zsh as a shell
echo "/usr/local/bin/zsh" | sudo tee -a /etc/shells
# Make default shell
chsh -s /usr/local/bin/zsh
# Install oh-my-zsh
curl -L http://install.ohmyz.sh | sh
# Enable oh-my-zsh plugins
echo "plugins=(git brew npm)" >> ~/.zshrc
# Syntax highlighting for zsh
cd ~/.oh-my-zsh && git clone git://github.com/zsh-users/zsh-syntax-highlighting.git
echo "source ~/.oh-my-zsh/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" >> ~/.zshrc
source ~/.zshrc
# Add Z to zsh
echo ". `brew --prefix`/etc/profile.d/z.sh" >> ~/.zshrc
# References
# http://lapwinglabs.com/blog/hacker-guide-to-setting-up-your-mac
# http://jilles.me/badassify-your-terminal-and-shell/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment