Skip to content

Instantly share code, notes, and snippets.

@yuhui
Last active December 17, 2022 21:18
Show Gist options
  • Save yuhui/c0da64dec78f66e7779b7ab834f4e11f to your computer and use it in GitHub Desktop.
Save yuhui/c0da64dec78f66e7779b7ab834f4e11f to your computer and use it in GitHub Desktop.
Setup macOS for programming development

References:

Source .zshrc in .zsh_profile

echo 'source ~/.zshrc' >> ~/.zsh_profile
source ~/.zsh_profile

Update locale

Add LC_ALL to .zsh_profile.

echo 'export LC_ALL=en_US.UTF-8' >> ~/.zsh_profile
source ~/.zsh_profile

Install Xcode

Install Xcode from App Store from https://apps.apple.com/sg/app/xcode/id497799835?mt=12.

Or install command line tools only.

xcode-select --install

Generate private-public SSH keys

Generate keys.

ssh-keygen -t rsa -C "your_email@youremail.com"

Copy public key to macOS clipboard.

pbcopy < ~/.ssh/id_rsa.pub

Add copied public key to Github at https://github.com/settings/keys.

Install Homebrew

References:

Install Homebrew.

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

Update $PATH in .zsh_profile.

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

Verify Homebrew.

brew doctor

Setup GPG

Install gnupg

brew install gnupg

Create GPG key

References:

Create the key.

gpg --full-generate-key

# use the following settings:
# - "RSA and RSA" key
# - 4096 bits
# - key does not expire

List keys.

gpg --list-secret-keys --keyid-format LONG

# Copy the `sec` key after `rsa4096/`

Export key.

gpg --armor --export [sec key] > ~/.gnupg/gpg_rsa.pub

Copy public key to macOS clipboard.

pbcopy < ~/.gnupg/gpg_rsa.pub

Add copied key to Github at https://github.com/settings/keys.

Install Git

brew install git

Update global configuration.

git config --global user.name "Your Name Here"
git config --global user.email "your_email@youremail.com"

Install Python

References:

Install python and pip

brew install python

Update $PATH in .zsh_profile.

# note the correct path to brewed Python after installing
# or check with `brew info python`
echo 'export PATH="/usr/local/opt/python/libexec/bin:$PATH"' >> ~/.zsh_profile
source ~/.zsh_profile

Install virtualenv

pip install virtualenv

Install NodeJS

Install NVM

Install NVM.

# check https://github.com/nvm-sh/nvm for the latest version of NVM to install

\curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh | zsh

Update Terminal's environment.

source ~/.zsh_profile

Install NodeJS

Install NodeJS.

nvm install node

Install Ruby

Install RVM

References:

Add GPG keys.

gpg --keyserver hkp://ipv4.pool.sks-keyservers.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB

Install RVM.

\curl -sSL https://get.rvm.io | zsh -s stable

Install Ruby

Get list of known Rubies.

rvm list known

Install the latest version of Ruby.

# install the latest listed version.
rvm install 2.6

Install MySQL

Install MySQL Community Server from https://dev.mysql.com/downloads/mysql/.

Or install from Homebrew.

brew install mysql

Install MySQL Workbench from https://dev.mysql.com/downloads/workbench/.

Install Docker

Install Docker from https://docs.docker.com/docker-for-mac/install/.

Install Microsoft Azure SDK

References:

Install Azure CLI.

brew install azure-cli

Login to Azure.

az login

Install Google Cloud SDK

References:

Download the SDK from https://cloud.google.com/sdk/docs/ to $HOME, then extract the ZIP.

Update $PATH in ~/.zsh_profile.

cd ~/google-cloud-sdk
./install.sh

Initialise the SDK.

cd ~/google-cloud-sdk
./bin/gcloud init
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment