How I setup my 2017 MacBook Pro

Configuring my new MacBook Pro

Run software updates Setup system preferences.

Install homebrew brew install cask iterm2

Configure zsh and iTerm Setup instructions here

Setup 1Password and VPN

brew install cask 1password brew install cask cloak

setup SSH

ssh-keygen -t rsa -b 4096 -C "my_email@example.com"

ssh-keygen -t rsa -b 4096 -C “scott@scottgruber.me”

added a passphrase for more security. use ssh-agent to avoid having to enter password each time

Host *
 AddKeysToAgent yes
 UseKeychain yes
 ServerAliveInterval 60

brew install git

assuming you're using the default zshrc file, you need to modify your PATH to include /usr/local/git/bin in line 57 of the file ~.zsch

Another option would be to update the .profile file with the proper path (this is the option I took) Global git configuration git config --global user.name “Scott Gruber“ git config --global user.email "scott@scottgruber.me"

touch ~/.gitignore_global

git config --global core.excludesfile ~/.gitignore_global

Browser

brew cask install chrome brew cask install firefox

Extensions 1password Accessibility Developer Tools Grammarly

Sublime Text

brew cask install sublime-text ln -s /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl /usr/local/bin/subl

Install material theme dark, update preferences Make sublime git merge tool.

git config --global mergetool.sublime.cmd "subl -w \$MERGED" git config --global mergetool.sublime.trustExitCode false git config --global merge.tool sublime git mergetool -y

Setup SSH Key for digital ocean

Creating and Using SSH Keys - Servers for Hackers

cd ~/.ssh ssh-keygen -t rsa -b 4096 -C "scott@scottgruber.me" -f id_rsa

On Mac, copy the public key to clipboard

cat id_rsa.pub | pbcopy

cat ~/.ssh/id_rsa.pub | ssh user@123.45.56.78 "mkdir -p ~/.ssh && cat >> ~/.ssh/authorized_keys"

Setup ssh key for digital ocean

cat ~/.ssh/id_rsa.pub then copy key then login from another computer to digital ocean server nano ~/.ssh/authorized_keys

copy and paste key into authorized_keys

Node

followed these instructions with slight variations because I use zsh instead of bash https://johnpapa.net/how-to-use-npm-global-without-sudo-on-osx/ to get gulp and npm to work install node with brew

brew install node --without-npm

After installing node, brew threw this message.

Homebrew has NOT installed npm. If you later install it, you should supplement your NODE_PATH with the npm module folder: /usr/local/lib/node_modules

mkdir "${HOME}/.npm-packages"

echo NPM_PACKAGES="${HOME}/.npm-packages" >> ${HOME}/.zshrc

echo prefix=${HOME}/.npm-packages >> ${HOME}/.npmrc

curl -L https://www.npmjs.org/install.sh | sh

echo NODE_PATH=\"\$NPM_PACKAGES/lib/node_modules\:\$NODE_PATH\" >> ${HOME}/.zshrc

echo PATH=\"\$NPM_PACKAGES/bin\:\$PATH\" >> ${HOME}/.zshrc

echo source "~/.zshrc" >> ${HOME}/.profile

replaced above with recommended bash_profile. This may be a point of error. Ensure that you source your .bashrc file by adding the following to your .bash_profile. echo source "~/.bashrc" >> ${HOME}/.bash_profile

echo 'export PATH="/usr/local/sbin:$PATH"' >> ~/.zshrc

Checking Your Files

When you are done, you should have a files that looks something like the following: ~/.npmrc

prefix=/Users/john/.npm-packages

~/.bashrc

NPM_PACKAGES=/Users/john/.npm-packages  
NODE_PATH="$NPM_PACKAGES/lib/node_modules:$NODE_PATH"  
PATH="$NPM_PACKAGES/bin:$PATH"  

~/.bash_profile

Make sure you have the source ~/.bashrc in your ~/.bash_profile To see the files beginning with . such as .bashrc and .npmrc you need to show hidden files for OSX. In terminal run the following command: defaults write com.apple.finder AppleShowAllFiles YES Verification Run these commands to test if you were successful: Run node -v to see the version of node Run npm -v to see the version of npm Run npm list -g --depth=0 to see the global npm packages you have installed (should just be npm right now)

Advanced Users

For advanced users, the rest of these can be run via copy and paste into terminal.

brew install node --without-npm  
mkdir "${HOME}/.npm-packages"  
echo NPM_PACKAGES="${HOME}/.npm-packages" >> ${HOME}/.bashrc  
echo prefix=${HOME}/.npm-packages >> ${HOME}/.npmrc  
curl -L https://www.npmjs.org/install.sh | sh  
echo NODE_PATH=\"\$NPM_PACKAGES/lib/node_modules:\$NODE_PATH\" >> ${HOME}/.bashrc  
echo PATH=\"\$NPM_PACKAGES/bin:\$PATH\" >> ${HOME}/.bashrc  
echo source "~/.bashrc" >> ${HOME}/.bash_profile  
source ~/.bashrc  

Install NPM packages

npm install -g postcss

npm install -g postcss-cli

npm install -g stylelint

npm install -g autoprefixer

npm install -g bower

npm install -g browser-sync

npm install -g gulp

npm install -g gulp-cli

npm install -g @frctl/fractal

npm install -g @frctl/mandelbrot

Update Ruby and avoid using sudo

from Install Ruby on Rails 5.0 · macOS Sierra

xcode-select -p

brew install gpg

command curl -sSL https://rvm.io/mpapis.asc | gpg --import -

\curl -L https://get.rvm.io | bash -s stable

source /Users/scottgruber/.rvm/scripts/rvm

ruby -v

gem -v

gem update --system

rvm gemset list

rvm gemset use global

gem list

gem outdated

gem update nameOfGem

Install Sass

gem install sass

Install wp-cli

brew install wp-cli

Install python

brew install python3

Install openssl

brew install openssl

adapted from Carl Alexandar’s 2016 article

Tags:


← Previous How to Make Sense of Any Mess maptimeLA meetup notes Next →