— Macos, Development Environment — 1 min read
The setup assistant will launch once you turn the computer on. Enter your preferred language, time zone, Apple ID, and so on. The first thing you should do is update macOS to get the latest security updates and patches.
Install the Homebrew package manager. This will allow you to install almost any app from the command line.
1/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Make sure everything is up to date.
1brew upgrade
Shell Programs | Purpose |
---|---|
git | Version control |
bat | cat alternative |
fzf | search |
exa | ls alternative |
tldr | man alternative |
Here are some the applications I always install (cask flag in Homebrew):
NOTE: Do not install Node.js through Homebrew. Use nvm (below).
Application | Purpose |
---|---|
Visual Studio Code | text editor |
Google Chrome | web browser |
Firefox | web browser |
Rectangle | window resizing |
iTerm2 | terminal |
Docker | development |
Slack | communication |
Discord | communication |
Spotify | music |
Postgres | database |
Postico | database UI |
Postman | API Tool |
Notion | Notes |
Todoist | Todos |
1## Shell Programs2brew install \3 git \4 bat \5 exa \6 tldr \7 fzf &&8
9# GUI programs10brew install --cask \11 visual-studio-code \12 google-chrome \13 firefox \14 rectangle \15 iterm2 \16 docker \17 discord \18 slack \19 spotify \20 postgres \21 postico \22 bear \23 todoist \
Catalina comes with zsh as the default shell. Install Oh My Zsh for sensible defaults.Catalina comes with zsh as the default shell. Install Oh My Zsh for sensible defaults.
1sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
Use Node Version Manager (nvm) to install Node.js. This allows you to easily switch between Node versions, which is essential.
1curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
I recommand using LTS
1nvm install --lts
Restart terminal and run the final command.
1nvm use node
Confirm that you are using the latest version of Node and npm.
1node -v && npm -v
For later, here's how to update nvm.
1nvm install node --reinstall-packages-from=node
The first thing you should do with Git is set your global configuration.
1touch ~/.gitconfig
Input your config and create some aliases.
1[user]2 name = Firstname Lastname3 email = you@example.com4[github]5 user = username6[alias]7 a = add8 ca = commit -a9 cam = commit -am10 cm = commit -m11 s = status12 p = push13 pom = push origin master14 puom = pull origin master15 cob = checkout -b16 co = checkout17 fp = fetch --prune --all18 l = log --oneline --decorate --graph19 lall = log --oneline --decorate --graph --all20 ls = log --oneline --decorate --graph --stat21 lt = log --graph --decorate --pretty=format:'%C(yellow)%h%Creset%C(auto)%d%Creset %s %Cgreen(%cr) %C(bold blue)%an%Creset'
With the above aliases, I can run git s instead of git status, for example. The less I have to type, the happier I am.
You can generate an SSH key to distribute.
1ssh-keygen -t ed25519 -C "your_email@example.com"
Start ssh-agent.
eval "$(ssh-agent -s)" Add key.
1ssh-add -K ~/.ssh/id_rsa
Simplify the process of SSHing into other boxes with your SSH config file. Create ~/.ssh/config if it does not already exist.
Add the following contents, changing the variables for any hosts that you connect to. Using the below will be the same as running ssh -i ~/.ssh/key.pem user@example.com.
~/.ssh/config
1Host *2 AddKeysToAgent yes3 UseKeychain yes4 IdentityFile ~/.ssh/id_ed255195
6Host myssh7 HostName example.com8 User user9 IdentityFile ~/.ssh/key.pem
Now just run the alias to connect.
1ssh myssh
If you liked the write-up, leave your feedback and suggestions :)