Skip to content

Instantly share code, notes, and snippets.

@frankolson
Last active June 1, 2018 20:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save frankolson/9d24d18bcd63dd400640885824f488db to your computer and use it in GitHub Desktop.
Save frankolson/9d24d18bcd63dd400640885824f488db to your computer and use it in GitHub Desktop.
Steps I used to setup an macOS 10.12 web development machine.

macOS 10.12 Web Development Machine

Show Library folder

$ chflags nohidden ~/Library

Show hidden files

This can also be done by pressing command + shift + ..

$ defaults write com.apple.finder AppleShowAllFiles YES

Show path bar

$ defaults write com.apple.finder ShowPathbar -bool true

Show status bar

$ defaults write com.apple.finder ShowStatusBar -bool true

Command Line Tools (without needing Xcode)

$ xcode-select --install

Homebrew

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

Mac App Store

$ brew install mas

Sign in

$ mas signin example@email.com

Brewfile - ~/Brewfile

tap 'caskroom/cask'

brew 'bash-completion'
brew 'git'
brew 'heroku'
brew 'mysql'
brew 'node'
brew 'postgresql'
brew 'rbenv'
brew 'ruby-build'
brew 'sqlite3'
brew 'yarn', args: ['without-node']
brew 'redis'

cask 'atom'
cask 'firefox'
cask 'gimp'
cask 'google-chrome'
cask 'opera'
cask 'spectacle'
cask 'spotify'
cask 'vlc'

mas 'Slack', id: 803453959
mas 'GIPHY Capture, id: 668208984
$ brew bundle install

Preferences

  • Keyboard > Text > Disable "Correct spelling automatically".
  • Keyboard > Key Repeat "Fast".
  • Keyboard > Delay Until Repeat "Short".
  • Security and Privacy > Firewall > On
  • Security and Privacy > FileVault > On
  • Security and Privacy > General > App Store and identified developers
  • Security and Privacy > General > Require password immediately
  • File Sharing > Off
  • Users & Groups > Login Items > Spectacle

SSH

Config - ~./ssh/config

Host example
    HostName example.com
    User example-user
    IdentityFile key.pem

Generate SSH key

Be sure to accept all defaults when entering the following command:

$ ssh-keygen -t rsa -b 4096 -C "email@email.com"

GitHub

Config - ~/.gitconfig

[user]
  name = First Name
  email = example@email.com
[github]
  user = username
[alias]
  a = add
  ca = commit -a
  cam = commit -am
  s = status
  pom = push origin master
  pog = push origin gh-pages
  puom = pull origin master
  puog = pull origin gh-pages
  cob = checkout -b
[color]
  ui = true
[credential]
  helper = osxkeychain

SSH Credentials

$ cat ~/.ssh/id_rsa.pub

Use the output of the last command to authorize a new SSH public key for GitHub at: https://github.com/settings/keys.

Test out the new credentials with:

$ ssh -T git@github.com

Bash

Config - ~/.bash_profile

# Better ls
alias ls="ls -Gh"
alias ll="ls -la"
# Tab complete
if [ -f $(brew --prefix)/etc/bash_completion ]; then
  . $(brew --prefix)/etc/bash_completion
fi
# Brew stuff
alias brewup='brew update; brew upgrade; brew prune; brew cleanup; brew doctor'

Terminal Colors - ~/.bash_profile

export PS1='\[\033[36m\]\u\[\033[m\]@\[\033[32m\]\h:\[\033[33;1m\]\w\n\[\033[32m\]$(__git_ps1) \[\033[m\]\$ '
export GIT_PS1_SHOWDIRTYSTATE=true
export CLICOLOR=1
export LSCOLORS=ExFxBxDxCxegedabagacad
$ source ~/.bash_profile

Rails

Add rbenv to bash

$ echo 'if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi' >> ~/.bash_profile
$ source ~/.bash_profile

Install Ruby

$ rbenv install 2.4.2
$ rbenv global 2.4.2
$ ruby -v

Install Rails

$ gem install rails -v 5.1.3
$ rbenv rehash
$ rails -v

Databases

sqlite3

Completed during the Brewfile steps.

MySQL

To have launchd start mysql at login:

$ brew services start mysql

PostgreSQL

To have launchd start postgresql at login:

$ brew services start postgresql

Redis

To have launchd start postgresql at login:

$ brew services start redis

Uncategorized steps

Create some extra directories

$ mkdir ~/Gems
$ mkdir ~/NodeModules
$ mkdir ~/Sites

Set a custom host, local host, and computer name

$ sudo scutil --set HostName new_hostname
$ sudo scutil --set LocalHostName new_hostname
$ sudo scutil --set ComputerName new_computer_name

Finish setting up Private Internet Access

verison number could possibly change, check version number here: https://github.com/caskroom/homebrew-cask/blob/master/Casks/private-internet-access.rb

$ open "/usr/local/Caskroom/private-internet-access/v72/Private Internet Access Installer.app"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment