setting up a new macintosh computer

2020-07-01

 | 

~6 min read

 | 

1180 words

Setting up a new machine can take a lot of time. I prefer to document the tools I like / use. This is a blend of a /uses and a step-by-step guide to getting up and running with a new machine the way I like it.

Much of this is personalized, so, if you adopt it, your mileage may vary.

General steps:

  1. Download password management (in my case, Lastpass)
  2. Install default browser (Brave)
  3. Install XCode
  4. Configure SSH
  5. Clone dotfiles
  6. Update fonts

Set Up SSH Keys for Common Resources

The pattern I’m following for ssh keys is _<encryption type

For example:

  • A personal github ssh key using rsa would be: id_github_rsa
  • A work gitlab using sha512 would be (company’s name is Acme Co. in this example): id_acme_gitlab_sha512

For the steps on setting up an SSH key (and managing multiple) SSH Keygen Basics.

I store an example of my .ssh/config file in my dotfiles repo on Github.

Set Up Git Profile and Global GitIgnore

My standard .gitconfig is stored in dotfiles here.

Optionally, create a global .gitignore. You can base this off of a .gitignore template or do something very simple like:

% echo .DS_Store > ~/.gitignore_global

A MacOS template is here.

Setting Up Git For Multiple Profiles

If it’s a work machine, or there’s a reason to have multiple git profiles, check out Managing Multiple Git Configurations

Applications To Install Manually

I like Homebrew a lot for managing my applications, so let’s start there.

To install Homebrew, use the cURL below:

% /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

Upgrade The Text Editor

`

Upgrade The Terminal

Warp is my preferred terminal now. It can be downloaded here.

If you don’t have Warp, iTerm2 is my backup. It can be downloaded here, or via Homebrew:

% brew install iterm2 --cask

I’ve blogged about some of the changes I like to make. They include:

My dotfiles are all available here.

Improve your prompt with Starship

% curl -sS https://starship.rs/install.sh | sh

Having spent time learning vim, I’m now working through neovim.

% brew install neovim

Install vim-plug.

% sh -c 'curl -fLo "${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/autoload/plug.vim --create-dirs \
       https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'

Note: this is for neovim, and you may need to also install it for vim. Or, maybe only install it for vim and not neovim. I ended up needing to install both.

Don’t forget to reload .vimrc and :PlugInstall to install plugins.

RipGrep

Install ripgrep

% brew install ripgrep

IDE

VSCode

% brew install visual-studio-code --cask

or

% brew install visual-studio-code-insiders --cask

Browsers

Chrome / Firefox / Brave

% brew install google-chrome --cask
% brew install firefox --cask
% brew install brave-browser --cask

Applications

Discord

% brew install --cask discord

Spotify

% brew install spotify --cask

Slack

% brew install slack --cask

LastPass

% brew install lastpass --cask

or

% brew install lastpass-cli

Zoom

% brew install zoom

Powershell - To run powershell scripts on MacOS

% brew install powershell --cask

Rocket - great emoji tool

Postman - API testing

% brew install --cask postman

Javascript Toolchain

Install Volta

% curl https://get.volta.sh | bash

Then install common JS CLIs

% volta install node yarn typescript ts-node

Golang

Install Golang.

Install golangci-lint

% brew install golangci-lint
% brew upgrade golangci-lint

Rust

Install Rust

% curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

Utilities

AWS CLI - For managing AWS resources

Homebrew Bundle - This one’s more aspirational. If I end up using this, it can obviate the need for much of this document!

% brew bundle

Github CLI

% brew install gh

pyenv: Simple Python version management

% brew update
% brew install pyenv

Alternatively poetry: Dependency Management for Python

% curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python

Netlify-CLI

% brew install netlify-cli

Nom - A homegrown CLI for managing notes

% volta install note-mgr-cli

Exercism

brew update && brew install exercism

Httpie - for API testing (CLI postman alternative)

% brew install httpie

Heroku CLI - for fast and easy application deployments

% brew tap heroku/brew && brew install heroku

Configuration Settings

VS Code

Preferences: dotfiles/vscode-preferences.json at master · stephencweiss/dotfiles · GitHub

VS Code Extensions

Quality of Life

Javascript Specific

Language / DevOps Support

iTerm Configurations

Browser Extensions

  1. React Dev Tools

Onboarding environment setup for Mac

Xcode

xcode-select —install

Setup SSH

https://help.github.com/articles/connecting-to-github-with-ssh/

pgAdmin

https://www.postgresql.org/ftp/pgadmin/pgadmin4/v1.5/macos/

set up development tools

brew install postgresql brew install curl brew install tree brew install jq # (command line json parsing/filtering) brew install httpie # (better http command line app than curl)

setup docker/kubernetes

install docker via https://download.docker.com/mac/stable/Docker.dmg

brew install kubernetes-cli

install kops

brew install kops

install minikube requires virtualbox

brew cask install virtualbox

install minikube via https://github.com/kubernetes/minikube/releases

bash auto-completion (will prompt you to add line(s) to ~/.bash_profile)

brew install bash-completion

kubectl auto-complete (requires bash-completion)

cat “source <(kubectl completion bash)” >> ~/.bash_profile


# Backend Development/Data Access

`brew cask install dbeaver-community # (good database viewer/query tool)`
`pgadmin` is a good alternative for `Postgres`

# Troubleshooting

## Issue:

Running npm run start or npm run configure-<environment> results in SyntaxError: Unexpected token u in JSON at position 0
Solution:
In the terminal, run brew install jq

## Issue:

Running npm run configure-development results in aws: error: argument operation: Invalid choice, valid choices are:
Solution:
In the terminal, run brew install awscli


Hi there and thanks for reading! My name's Stephen. I live in Chicago with my wife, Kate, and dog, Finn. Want more? See about and get in touch!