tools,

Setup Workstation

Cui Cui Follow Jan 01, 2021 · 2 mins read
Setup Workstation
Share this

“Place which dreams come true “ - Art by painter Julia Makors

Install brew.sh

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
brew tap homebrew/cask-versions

Install zsh && Oh My Zsh

brew install zsh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
chsh -s $(which zsh)

Install zsh-autosuggestions

git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
plugins=(zsh-autosuggestions)

# Theme
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k

vi ~/.zshrc
ZSH_THEME="powerlevel10k/powerlevel10k"

Install Java

Oracle JDK

brew install --cask oracle-jdk

Adopt OpenJDK

brew tap adoptopenjdk/openjdk
brew search jdk
brew install --cask adoptopenjdk
brew install --cask adoptopenjdk11

Switch version with JEnv

brew install jenv

jenv add /Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home

Or

## JDK
export JAVA_11_HOME=$(/usr/libexec/java_home -v11)
export JAVA_17_HOME=$(/usr/libexec/java_home -v17)
alias java11='export JAVA_HOME=$JAVA_11_HOME'
alias java17='export JAVA_HOME=$JAVA_17_HOME'

Install Maven, Gradle

brew install maven
brew install gradle

SSH Keys

KEY_TYPE=github
KEY_NAME=`whoami`-$KEY_TYPE-`date +%Y-%m-%d`
mkdir -p ~/.ssh/$KEY_TYPE

ssh-keygen -t rsa -b 2048 -C $KEY_NAME -f ~/.ssh/$KEY_TYPE/$KEY_NAME
ssh-keygen -l -E md5 -f ~/.ssh/$KEY_TYPE/$KEY_NAME

chmod 600 $KEY_NAME
chmod 644 $KEY_NAME.pub

ssh-add ~/.ssh/$KEY_TYPE/$KEY_NAME
# macOS reboot service
vi ~/.ssh/config

Host *
   AddKeysToAgent yes
   UseKeychain yes

Git Repo

git clone ColourfulCodesTechnologies@vs-ssh.visualstudio.com:v3/ColourfulCodesTechnologies/Projects/infrastructure
git clone ColourfulCodesTechnologies@vs-ssh.visualstudio.com:v3/ColourfulCodesTechnologies/Projects/deployments
git clone ColourfulCodesTechnologies@vs-ssh.visualstudio.com:v3/ColourfulCodesTechnologies/Projects/gateway

Install Cloud CLIs

  • Azure CLI
brew install azure-cli

az login

az account set --subscription "ColourfulCodes - Subscriptions"

az aks get-credentials --name kube-cluster-name --resource-group group-name

kubectl config set-context kube-cluster-name --namespace=application
  • GCP CLI
brew install --cask google-cloud-sdk

# zsh
export CLOUDSDK_PYTHON="/usr/local/opt/python@3.8/libexec/bin/python"
source "/usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/path.zsh.inc"
source "/usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/completion.zsh.inc"

# gcloud
gcloud init

# k8s
gcloud container clusters get-credentials cluster1 --region europe-west2 --project project-name

8 install Terraform

brew tap hashicorp/tap

brew install hashicorp/tap/terraform

brew upgrade hashicorp/tap/terraform

brew link --overwrite terraform@0.12

Install Kubernetes CLI

brew install kubernetes-cli

OR

brew install kubectl

Install Docker Desktop

Install MongoDB CLI

brew tap mongodb/brew

brew install mongodb-community-shell

brew install mongocli

brew install mongodb-database-tools

# Upgrade
brew upgrade mongodb-database-tools

Install tree, fzf, ack

Join Newsletter
Get the latest news right in your inbox. We never spam!
Cui
Written by Cui Follow
Hi, I am Cui, the colourful coder for colourful.codes!