This repo contains scripts and files for William Gao to set up his macOS.
Created around March, 2021. Updated on Dec 15, 2022. Updated on Feb 08, 2023.
Follow this gist to set System preferences.
$ xcode-select --install
This also installs Git:
$ git --version
- Set global identity config
$ git config --global user.name "William Gao"
$ git config --global user.email "me@wlgao.com"
- Set up SSH keys
Install Homebrew by following the command here: https://brew.sh/
$ brew install tree
$ brew install jq
Use pyenv
to manage different Python versions. See: https://github.com/pyenv/pyenv#homebrew-in-macos
$ brew update
$ brew install pyenv
Create virtual environments:
$ python -m venv ~/venv/toil_env
$ python -m venv ~/venv/binf_env
Put this in the Python section in ~/.zshrc
:
alias toil_env=". ~/venv/toil_env/bin/activate"
alias binf_env=". ~/venv/binf_env/bin/activate"
# ...
$ binf_env
$ pip install jupyterlab
$ pip install notebook
Download and install Node.js here: https://nodejs.org/en/download/.
This will install node
and npm
.
nvm
is like pyenv
- it allows you to switch between different versions.
See: https://github.com/nvm-sh/nvm
To install nvm
via brew:
$ brew install nvm
# install the latest version
$ nvm install --lts
This requires Node.js.
If you prefer yarn
as your package manager.
$ npm install --global yarn
NOTE: This requires sudo permission.
Following this, it looks like the best way to install Java on a Apple Silicon machine is through Homebrew.
$ brew update
$ brew install openjdk
# then follow `brew info openjdk`:
# let the system Java wrappers find it
$ sudo ln -sfn /opt/homebrew/opt/openjdk/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk.jdk
# add to PATH
$ echo 'export PATH="/opt/homebrew/opt/openjdk/bin:$PATH"' >> ~/.zshrc
Download Docker Desktop for Mac here: https://docs.docker.com/desktop/install/mac-install/
Check installation:
$ docker --version
If you are working with k8s clusters, you probably need kubectl
.
$ brew update
$ brew install kubectl
It may be a good idea to alias kubectl to k
:
$ echo 'alias k=kubectl' >> ~/.zshrc
$ . ~/.zshrc
This depends on the k8s cluster setup.
If working with multiple contexts, consider installing kubectx
(and alias to kx
) as well.
Check installation/configuration:
$ k version
This should display the versions of the client and server.
If you want to set up a local kubernetes cluster for development, consider using minikube
:
$ brew update
$ brew install minikube
NOTE: minikube
needs a driver such as VirtualBox, hyperkit, or Docker. Docker works great.
Check installation:
$ minikube version