Skip to content

Instantly share code, notes, and snippets.

@shortdudey123
Last active April 13, 2017 21:40
Show Gist options
  • Save shortdudey123/5ba82881270647ca5ef5 to your computer and use it in GitHub Desktop.
Save shortdudey123/5ba82881270647ca5ef5 to your computer and use it in GitHub Desktop.
Setup Mac OS X Yosemite

Setup Mac OS X Yosemite

Taken from:

Setup

1. Run software update

Make sure everything is up to date.

2. Install Xcode

From App Store

xcode-select --install
sudo xcodebuild -license

3. Install homebrew and CLI tools

http://brew.sh/

# install homebrew
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

brew install git
brew install tig
brew install wget
brew install htop-osx
brew install mtr
brew install tree
brew install vim
brew install rbenv
brew install ruby-build
brew install python
brew install curl
brew install nmap
brew install kubernetes-cli
brew install watch

# OR
brew install git tig wget htop-osx mtr tree vim rbenv ruby-build python curl nmap kubernetes-cli watch

Optional:

brew install docker
brew install docker-compose
brew install docker-machine
brew install gawk
brew install geoip
brew install go
brew install graphviz
brew install lzo
brew install lzop
brew install node
brew install pstree
brew install python3
brew install snappy
brew install wireshark
brew install xz

4. Install softwares

homebrew-cask

Many softwares can be installed through homebrew-cask which makes the process way simpler:

# install homebrew-cask
brew tap phinze/homebrew-cask
brew install brew-cask

# dev
brew cask install charles
brew cask install virtualbox
brew cask install vagrant
brew cask install sublime-text
brew cask install chefdk
brew cask install google-cloud-sdk

# utils
brew cask install vlc
brew cask install cyberduck
brew cask install keybase
brew cask install java
brew cask install tunnelblick
brew cask install mongodb-compass

# browsers
brew cask install firefox
brew cask install google-chrome

# music
brew cask install pandora

# communication
brew cask install skype
brew cask install gitter

# quick look plugins (https://github.com/sindresorhus/quick-look-plugins)
brew cask install qlcolorcode qlstephen qlmarkdown quicklook-json qlprettypatch quicklook-csv betterzipql webpquicklook suspicious-package && qlmanage -r
Vagrant
vagrant plugin install vagrant-aws
vagrant plugin install vagrant-berkshelf
vagrant plugin install vagrant-vbguest
vagrant box add bento/centos-6.7 --provider virtualbox
vagrant box add bento/centos-6.8 --provider virtualbox
vagrant box add bento/centos-7.1 --provider virtualbox
vagrant box add bento/centos-7.2 --provider virtualbox
vagrant box add bento/centos-7.3 --provider virtualbox
vagrant box add bento/debian-6.0.10 --provider virtualbox
vagrant box add bento/debian-7.11 --provider virtualbox
vagrant box add bento/debian-8.5 --provider virtualbox
vagrant box add bento/debian-8.6 --provider virtualbox
vagrant box add bento/debian-8.7 --provider virtualbox
vagrant box add bento/fedora-21 --provider virtualbox
vagrant box add bento/fedora-22 --provider virtualbox
vagrant box add bento/fedora-23 --provider virtualbox
vagrant box add bento/fedora-24 --provider virtualbox
vagrant box add bento/fedora-25 --provider virtualbox
vagrant box add bento/freebsd-9.3 --provider virtualbox
vagrant box add bento/freebsd-10.3 --provider virtualbox
vagrant box add bento/freebsd-11.0 --provider virtualbox
vagrant box add bento/ubuntu-14.04 --provider virtualbox
vagrant box add bento/ubuntu-16.04 --provider virtualbox
Sublime Text 3
mkdir -p ~/bin && ln -s "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" ~/bin/subl

Run Sublime Text 3 and access the console via the CTRL + ` shortcut or the View > Show Console menu.

import urllib.request,os,hashlib; h = 'df21e130d211cfc94d9b0905775a7c0f' + '1e3d39e33b79698005270310898eea76'; pf = 'Package Control.sublime-package'; ipp = sublime.installed_packages_path(); urllib.request.install_opener( urllib.request.build_opener( urllib.request.ProxyHandler()) ); by = urllib.request.urlopen( 'http://packagecontrol.io/' + pf.replace(' ', '%20')).read(); dh = hashlib.sha256(by).hexdigest(); print('Error validating download (got %s instead of %s), please try manual install' % (dh, h)) if dh != h else open(os.path.join( ipp, pf), 'wb' ).write(by)

Install the following packages:

App Store

5. Configure Git

# Setup ssh key
# https://help.github.com/articles/generating-ssh-keys/
ssh-keygen -t rsa -b 4096 -C "<XXXXX@XXXXXX>"
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_rsa

# Copy key to GitHub
pbcopy < ~/.ssh/id_rsa.pub

# Test
ssh -T [email protected]

# gitconfig
git config --global user.name "<Full Name"
git config --global user.email <XXXXX@XXXXXX>
git config --global github.user <github_username>
git config --global github.token your_token_here

6. Setup Ruby

# Install Ruby versions
rbenv install 2.2.5
rbenv install 2.3.1
rbenv global 2.3.1

# User Global Gems
gem install bundler
gem install rake
gem install rubocop
gem install pry

nokogiri

brew tap homebrew/dupes
brew install libxml2 libxslt libiconv
gem install nokogiri -- --use-system-libraries --with-iconv-dir=/usr/local/Cellar/libiconv/1.14/ --with-xslt-dir=/usr/local/opt/libxslt
  --with-xml2-include=/usr/local/Cellar/libxml2/2.9.2/include/libxml2 --with-xml2-lib=/usr/local/Cellar/libxml2/2.9.2/lib
  
# bundle config
$ cat .bundle/config 
---
BUNDLE_BUILD__NOKOGIRI: "--use-system-libraries --with-iconv-dir=/usr/local/Cellar/libiconv/1.14/ --with-xslt-dir=/usr/local/opt/libxslt
  --with-xml2-include=/usr/local/Cellar/libxml2/2.9.2/include/libxml2 --with-xml2-lib=/usr/local/Cellar/libxml2/2.9.2/lib"
NOKOGIRI_USE_SYSTEM_LIBRARIES=1
$

7. OS X Preferences

#Store screenshots in subfolder on desktop
mkdir ~/Pictures/Screenshots
defaults write com.apple.screencapture location ~/Pictures/Screenshots

# disable auto sleep on battery
sudo pmset -b sleep 0

8. Hostname

sudo scutil --set ComputerName "HOSTNAME"
sudo scutil --set HostName "HOSTNAME"
sudo scutil --set LocalHostName "HOSTNAME"
sudo defaults write /Library/Preferences/SystemConfiguration/com.apple.smb.server NetBIOSName -string "HOSTNAME"

9. Python

pip install virtualenv

10. Misc settings

Allow Airdrop on all interfaces (including wired)

defaults write com.apple.NetworkBrowser BrowseAllInterfaces 1
killall Finder
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment