Skip to content

Instantly share code, notes, and snippets.

@rohithegde
Last active November 14, 2023 05:50
Show Gist options
  • Select an option

  • Save rohithegde/cf6a883a34c3e9803637d728e89e3451 to your computer and use it in GitHub Desktop.

Select an option

Save rohithegde/cf6a883a34c3e9803637d728e89e3451 to your computer and use it in GitHub Desktop.
#!/bin/zsh
green=$'\e[32m'
yellow=$'\e[1;33m'
white=$'\e[0m'
blue=$'\e[1;34m'
# Manual steps :
# Install Chrome : https://www.google.com/chrome/
# Customise System preferences (can use AppleScript to automate this too to some extent)
# - Keyboard for cursor speed and Touch Bar
# Select MesloLGS NF for Terminal font as its the only font we are installing here. Else Powerline icons will NOT load.
# 1. Homebrew
echo $yellow"---------------------------"
echo "INSTALLING Homebrew"
echo "---------------------------"$white
chmod u+w /usr/local/share/zsh /usr/local/share/zsh/site-functions
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
echo "export PATH=$PATH:/opt/homebrew/bin" >> ~/.zshrc
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"
sudo chown -R $(whoami) $(brew --prefix)/*
sudo chown -R $(whoami) /usr/local/share/zsh /usr/local/share/zsh/site-functions
echo $green
brew --version | head -n 1
echo $white
# Useful tools to upgrade your cli exp
echo $yellow"---------------------------"
echo "INSTALLING some miscellaneous tools"
echo "---------------------------"$white
brew install wget htop tmux jq ncdu task gitleaks
brew tap cantino/mcfly
brew install mcfly
npm install -g @microsoft/inshellisense
#inshellisense --shell zsh
inshellisense bind
echo 'eval "$(mcfly init zsh)"' >> ~/.zshrc
echo $green
wget --version
tmux --version
jq --version
ncdu --version
task --version
gitleaks --version
echo $white
# Prezto framework
echo $yellow"---------------------------"
echo "INSTALLING Prezto framework for Zsh"
echo "---------------------------"$white
rm -rf "${ZDOTDIR:-$HOME}/.zprezto"
git clone --recursive https://github.com/sorin-ionescu/prezto.git "${ZDOTDIR:-$HOME}/.zprezto"
setopt EXTENDED_GLOB
for rcfile in "${ZDOTDIR:-$HOME}"/.zprezto/runcoms/^README.md(.N); do
ln -sf "$rcfile" "${ZDOTDIR:-$HOME}/.${rcfile:t}"
done
# Zsh theme
# Install Fonts
echo $yellow"---------------------------"
echo "INSTALLING Powerlevel10k for Zsh"
echo "---------------------------"$white
wget --no-check-certificate -P ~/Library/Fonts https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Regular.ttf
wget --no-check-certificate -P ~/Library/Fonts https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Bold.ttf
wget --no-check-certificate -P ~/Library/Fonts https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Italic.ttf
wget --no-check-certificate -P ~/Library/Fonts https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Bold%20Italic.ttf
echo 'ZSH_THEME="powerlevel10k/powerlevel10k"' >> ~/.zshrc
setopt EXTENDED_GLOB
for rcfile in "${ZDOTDIR:-$HOME}"/.zprezto/runcoms/^README.md(.N); do
ln -s "$rcfile" "${ZDOTDIR:-$HOME}/.${rcfile:t}"
done
echo "zstyle ':prezto:module:prompt' theme 'powerlevel10k'" >> ~/.zpreztorc
# Vim
# Package manager : vim-plug
echo $yellow"---------------------------"
echo "INSTALLING Vim plug"
echo "---------------------------"$white
wget --no-check-certificate -P ~/.vim/autoload/ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
# Vim Plugins
mkdir -p ~/.vim/bundle
echo "call plug#begin('~/.vim/bundle')" >> ~/.vimrc
echo "Plug 'vim-airline/vim-airline'" >> ~/.vimrc
echo "Plug 'vim-airline/vim-airline-themes'" >> ~/.vimrc
echo "Plug 'preservim/nerdtree'" >> ~/.vimrc
echo "call plug#end()" >> ~/.vimrc
vim -E -s -u "$HOME/.vimrc" +PlugInstall +qall
echo $green
vim --version | head -n 1
echo $white
# Visual Studio code
echo $yellow"---------------------------"
echo "Installing Visual Studio Code"
echo "---------------------------"$white
brew install --cask visual-studio-code
# get ext list with code --list-extensions >> vs_code_extensions_list.txt and upload it to github
wget --no-check-certificate https://gist.github.com/rohithegde/cb440b87f890145663016963e91774ae/raw/vs-code-extensions-list-az-devops.txt
cat vs-code-extensions-list-az-devops.txt | xargs -n 1 code --install-extension
echo $green
code --version
echo $white
# 7. Azure
echo $yellow"---------------------------"
echo "Installing Azure CLI"
echo "---------------------------"$white
brew update && brew install azure-cli
# Azure cli installs Python3 newer version internally
# We need python2 fr powerline theme. So dont use python3 sym link for python.
#sudo ln -sf /opt/homebrew/bin/python3 /usr/local/bin/python
python3 -m pip install --upgrade pip
echo $green
python --version
python3 --version
pip3 --version
az --version
echo $white
# 8. Container mgmt
echo $yellow"---------------------------"
echo "Installing Podman"
echo "---------------------------"$white
#brew install --cask docker
brew install podman
podman machine init
podman machine start
echo $green
podman --version
echo $white
# 9. Tfenv
echo $yellow"---------------------------"
echo "Installing tfenv"
echo "---------------------------"$white
brew install terraform-docs
brew install tfenv
echo $green
tfenv --version
echo $white
# 10. Git
echo $yellow"---------------------------"
echo "Installing git"
echo "---------------------------"$white
brew install git
echo $green
git --version | head -n 1
echo $white
# 11. Kubernetes and related tools
echo $yellow"---------------------------"
echo "K8s related tools"
echo "---------------------------"$white
brew install kubectl
echo $green
kubectl version
echo $white
brew install derailed/k9s/k9s
echo $green
k9s version
echo $white
(
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
)
echo "export PATH=${KREW_ROOT:-$HOME/.krew}/bin:$PATH" >> ~/.zshrc
echo $green
kubectl krew version
echo $white
# 12. Golang
echo $yellow"---------------------------"
echo "Installing go"
echo "---------------------------"$white
mkdir -p $HOME/code/research/golang
echo "export GOPATH=$HOME/code/research/golang" >> ~/.zshrc
echo "export GOROOT=/usr/local/opt/go/libexec" >> ~/.zshrc
echo "export PATH=$PATH:$GOPATH/bin" >> ~/.zshrc
echo "export PATH=$PATH:$GOROOT/bin" >> ~/.zshrc
brew install go
echo $green
go version
echo $white
#13 Blog
echo $yellow"---------------------------"
echo "Installing Jekyll and upgrade Ruby for it"
echo "---------------------------"$white
curl -L https://get.rvm.io | bash -s stable
echo "source ~/.rvm/scripts/rvm" >> ~/.zshrc
rvm install 2.7.6
sudo gem install jekyll bundler
echo $green
rmv --version
echo $white
# 14. Miscellaneous
echo $yellow"---------------------------"
echo "Installing miscellaenous tools"
echo "---------------------------"$white
# TF support for Zsh
echo "zstyle ':prezto:load' pmodule-dirs $HOME/.zprezto-contrib" >> ~/.zpreztorc
git clone https://github.com/prezto-contributions/prezto-terraform.git ~/.zprezto-contrib/terraform
wget --no-check-certificate -P ~/ https://gist.github.com/rohithegde/7481ba88172233caa278969b4bb6605a/raw/aliases.txt
echo "source ~/aliases.txt" >> ~/.zshrc
echo $blue
echo "MANUAL : add git, terraform to pmodule list in Zsh Prezto"
echo $white
# 15. RSS Feed reader
echo $yellow"---------------------------"
echo "Installing netnewswire"
echo "---------------------------"$white
brew install --cask netnewswire
# 15. Draw.io ie diagrams.net desktop app
echo $yellow"---------------------------"
echo "Installing Draw.io"
echo "---------------------------"$white
wget --no-check-certificate https://github.com/jgraph/drawio-desktop/releases/download/v14.6.13/draw.io-14.6.13.dmg
echo "Please install the softwares present in the Downloads folder."
#NOTE : Your setup is present in files
#1. ~/.zshrc
#2. ~/.zpreztorc
#3. ~/aliases.txt
# 4. ~/.p10k.sh - will be created automatically once you start zsh for the first time and run through the p10k options.
# 16. Xcode from App Store
# Alternative is to install using Mac store CLI :
# brew install mas
# mas list
# mas search Xcode
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment