Skip to content

Instantly share code, notes, and snippets.

@vinaysshenoy
Last active November 1, 2023 07:03
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vinaysshenoy/9d7d0d1ea1f7ed11be39e463e8088aa8 to your computer and use it in GitHub Desktop.
Save vinaysshenoy/9d7d0d1ea1f7ed11be39e463e8088aa8 to your computer and use it in GitHub Desktop.
Bootstrap file to setup a new account on macOS (10.15+)
#!/bin/zsh
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew install git
brew install jenv
brew install nvm
mkdir ~/.nvm
brew cask install gpg-suite
brew tap AdoptOpenJDK/openjdk
brew cask install adoptopenjdk8
jenv add /Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home
brew cask install adoptopenjdk13
jenv add /Library/Java/JavaVirtualMachines/adoptopenjdk-13.jdk/Contents/Home
jenv global 1.8
brew cask install jetbrains-toolbox
brew cask install db-browser-for-sqlite
# Setup the shell completions and aliases
# NOTE: This will OVERWRITE the current shell profile file
cat >~/.zshrc <<"EOL"
if type brew &>/dev/null; then
FPATH=$(brew --prefix)/share/zsh/site-functions:$FPATH
fi
export PATH="$HOME/.jenv/bin:$PATH"
eval "$(jenv init -)"
autoload -U compinit && compinit
export NVM_DIR="$HOME/.nvm"
[ -s "/usr/local/opt/nvm/nvm.sh" ] && . "/usr/local/opt/nvm/nvm.sh" # This loads nvm
[ -s "/usr/local/opt/nvm/etc/bash_completion.d/nvm" ] && . "/usr/local/opt/nvm/etc/bash_completion.d/nvm" #This loads nvm bash_completion
source $HOME/.aliases
EOL
# Aliases
cat >~/.aliases <<"EOL"
alias catchmeup="brew update && brew upgrade && brew upgrade --cask"
alias glog="git log --pretty=oneline"
alias gcp="git cherry-pick"
alias gcpx="git cherry-pick -x"
alias amend="git add . && git commit --am --no-edit"
alias gsquash="git rebase -i --autosquash"
alias purr="git pull --rebase"
alias slash="git remote prune origin"
alias vi="vim"
alias flipper="nohup ~/Dev/flipper/flipper &>/dev/null &"
alias python="python3"
alias pip="pip3"
alias unity3d="/Applications/Unity/Hub/Editor/2021.3.10f1/Unity.app/Contents/MacOS/Unity"
alias serve="python3 -m http.server"
EOL
git config --global user.name "Vinay Shenoy"
git config --global user.email "vinaysshenoy@gmail.com"
git config --global commit.gpgSign true
git config --global user.signingKey "390249BBF4881766"
ssh-add -D
ssh-keygen -t rsa -b 4096 -C "vinaysshenoy@gmail.com" -N '' -f ~/.ssh/id_rsa
cat >~/.ssh/config <<"EOL"
Host *
AddKeysToAgent yes
UseKeychain yes
IdentityFile ~/.ssh/id_rsa
EOL
cat >~/.gradle/gradle.properties <<"EOL"
org.gradle.caching=true
org.gradle.daemon=true
org.gradle.jvmargs=-Xmx4g -Xms4g
EOL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment