Skip to content

Instantly share code, notes, and snippets.

@diegoluisi
Last active May 9, 2023 13:15
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save diegoluisi/84eb46631f51e92c4ed8e3c9ba2a1201 to your computer and use it in GitHub Desktop.
Save diegoluisi/84eb46631f51e92c4ed8e3c9ba2a1201 to your computer and use it in GitHub Desktop.

Mac DevOps Setup

Install Brew

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

(echo; echo 'eval "$(/opt/homebrew/bin/brew shellenv)"') >> /Users/diegoluisi/.zprofile
    eval "$(/opt/homebrew/bin/brew shellenv)"

Install iTerm2

brew install --cask iterm2

Install zsh

brew install zsh

zsh plugins

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

Create alias

.docker_aliases

alias dk='docker'
alias dka='docker kill $(docker ps -q)'
alias dkc='docker-compose'
alias dkcf='docker rm $(docker ps -aq)'
alias dkcn='docker ps --format "{{.Names}}"'
alias dkd='docker-compose down'
alias dkl='docker logs -f'
alias dkr='docker-compose run --rm'
alias dku='docker-compose up'

.terraform_aliases

alias tf='terraform'
alias tfa='terraform apply'
alias tfc='terraform console'
alias tfd='terraform destroy'
alias tff='terraform fmt'
alias tfg='terraform graph'
alias tfim='terraform import'
alias tfin='terraform init'
alias tfo='terraform output'
alias tfp='terraform plan'
alias tfpr='terraform providers'
alias tfr='terraform refresh'
alias tfsh='terraform show'
alias tft='terraform taint'
alias tfut='terraform untaint'
alias tfv='terraform validate'
alias tfw='terraform workspace'
alias tfs='terraform state'
alias tffu='terraform force-unlock'
alias tfwst='terraform workspace select'
alias tfwsw='terraform workspace show'
alias tfssw='terraform state show'
alias tfwde='terraform workspace delete'
alias tfwls='terraform workspace list'
alias tfsls='terraform state list'
alias tfwnw='terraform workspace new'
alias tfsmv='terraform state mv'
alias tfspl='terraform state pull'
alias tfsph='terraform state push'
alias tfsrm='terraform state rm'
alias tfay='terraform apply -auto-approve'
alias tfdy='terraform destroy -auto-approve'
alias tfinu='terraform init -upgrade'
alias tfpde='terraform plan --destroy'

.terragrunt_aliases

alias tg='terragrunt'
alias tga='terragrunt apply'
alias tgc='terragrunt console'
alias tgd='terragrunt destroy'
alias tgf='terragrunt fmt'
alias tgg='terragrunt graph'
alias tgim='terragrunt import'
alias tgin='terragrunt init'
alias tgo='terragrunt output'
alias tgp='terragrunt plan'
alias tgpr='terragrunt providers'
alias tgr='terragrunt refresh'
alias tgsh='terragrunt show'
alias tgt='terragrunt taint'
alias tgut='terragrunt untaint'
alias tgv='terragrunt validate'
alias tgw='terragrunt workspace'
alias tgs='terragrunt state'
alias tgfu='terragrunt force-unlock'
alias tgwst='terragrunt workspace select'
alias tgwsw='terragrunt workspace show'
alias tgssw='terragrunt state show'
alias tgwde='terragrunt workspace delete'
alias tgwls='terragrunt workspace list'
alias tgsls='terragrunt state list'
alias tgwnw='terragrunt workspace new'
alias tgsmv='terragrunt state mv'
alias tgspl='terragrunt state pull'
alias tgsph='terragrunt state push'
alias tgsrm='terragrunt state rm'
alias tgay='terragrunt apply -auto-approve'
alias tgdy='terragrunt destroy -auto-approve'
alias tginu='terragrunt init -upgrade'
alias tgpde='terragrunt plan --destroy'

~/.zshrc

alias k=kubectl


[ -f ~/.docker_aliases ] && source ~/.docker_aliases
[ -f ~/.terraform_aliases ] && source ~/.terraform_aliases
[ -f ~/.terragrunt_aliases ] && source ~/.terragrunt_aliases

oh-my-zsh

sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

Install kubectl

brew install kubectl

vim ~/.zshrc

alias k=kubectl

Install krew plugin manager

(
  set -x; cd "$(mktemp -d)" &&
  OS="$(uname | tr '[:upper:]' '[:lower:]')" &&
  ARCH="$(uname -m | sed -e 's/x86_64/amd64/' -e 's/\(arm\)\(64\)\?.*/\1\2/' -e 's/aarch64$/arm64/')" &&
  KREW="krew-${OS}_${ARCH}" &&
  curl -fsSLO "https://github.com/kubernetes-sigs/krew/releases/latest/download/${KREW}.tar.gz" &&
  tar zxvf "${KREW}.tar.gz" &&
  ./"${KREW}" install krew
)
export PATH="${KREW_ROOT:-$HOME/.krew}/bin:$PATH"
brew install kubectx
kubectl krew install ctx
kubectl krew install ns

Download and Install Docker Desktop

Download Docker Desktop

Install ArgoCD cli

brew install argocd
brew install argocd-autopilot

Install awscli

brew install awscli

Install tiles (reorder/resize windows)

brew install --cask tiles

Configure Visual Studio Code Path

  • Open Visual Studio Code
  • Open the command pallette with Command + Shift + P (or F1)
  • Type Shell in command palette
  • Select Shell Command: Install code in PATH from suggested list
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment