Skip to content

Instantly share code, notes, and snippets.

@mhvelplund
Forked from steenkamby/README.md
Last active September 21, 2020 11:53
Show Gist options
  • Save mhvelplund/ffed2314840e14a32bf2b83df917aa2b to your computer and use it in GitHub Desktop.
Save mhvelplund/ffed2314840e14a32bf2b83df917aa2b to your computer and use it in GitHub Desktop.
Fresh mac install

install dev tools on a fresh mac

Run the script a couple of times to get through everything. Re-run later to update versions.

If you feel lucky:

bash <(curl -s https://gist.githubusercontent.com/steenkamby/e3ab7c35d2a08b1df1ef01c920999104/raw/1f3177546a3b31c857ae7d563dff0ec2d452ed93/install_mac.sh)
installDebug=false
function caskInstall() {
INSTALLSERVICE=$1
if brew cask info $INSTALLSERVICE | grep "Not installed" > /dev/null; then
echo "installing $INSTALLSERVICE ..."
brew cask install $INSTALLSERVICE
brew link --overwrite $INSTALLSERVICE 2>/dev/null 1>/dev/null
elif [ $installDebug = true ]; then
brew cask info $INSTALLSERVICE
fi
}
function brewInstall() {
INSTALLSERVICE=$1
if ! brew ls --versions $INSTALLSERVICE > /dev/null; then
echo "installing $INSTALLSERVICE ..."
brew install $INSTALLSERVICE
brew link --overwrite $INSTALLSERVICE 2>/dev/null 1>/dev/null
elif [ $installDebug = true ]; then
brew info $INSTALLSERVICE
fi
}
echo Checking for MacOs binaries to install
uname -a
if ! brew help > /dev/null; then
echo Installing homebrew ...
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
fi
brew --version
brew outdated
brew upgrade
brew outdated --cask
brew upgrade --cask
if ! pip3 help > /dev/null; then
echo "installing python & pip ..."
#brew install python2
brew install python3
fi
command -v python
command -v python2
command -v python3
#command -v pip
command -v pip3
brewInstall coreutils
brewInstall gcc
brewInstall go
brewInstall tree
brewInstall bat
brewInstall tmux
brewInstall terraform
brewInstall terraform-docs
brewInstall pre-commit
brewInstall tflint
brewInstall minikube
brewInstall hyperkit
minikube config set driver hyperkit 2>/dev/null
brewInstall helm
brewInstall kubectl
terraform -install-autocomplete 2>/dev/null
brewInstall jq
brewInstall yq
brewInstall gpg
brewInstall leiningen
if ! brew ls --versions nvm > /dev/null; then
echo "installing nvm ..."
brew install nvm
export NVM_DIR="$HOME/.nvm"
. "/usr/local/opt/nvm/nvm.sh"
fi
if ! npm help > /dev/null; then
echo "installing npm ..."
nvm install 14
nvm default default 14
fi
echo "node: $(command -v node) $(node -v)"
brewInstall packer
brewInstall watch
brewInstall watchman
brewInstall htop
brewInstall shellcheck
brewInstall openconnect
brewInstall zsh
brewInstall zsh-completions
brewInstall zsh-autosuggestions
brewInstall zsh-syntax-highlighting
brewInstall wtfutil
brewInstall awscli
aws --version
if [ $(echo $SHELL) != "/bin/zsh" ]; then
echo "Detected wrong shell [${SHELL}], setting default to zsh."
chsh -s /bin/zsh
fi
if [ ! -d $HOME/.oh-my-zsh ]; then
echo fetching oh-my-zsh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
fi
if [ ! -f $HOME/.oh-my-zsh/themes/bullet-train.zsh-theme ]; then
echo "fetching oh-my-zsh bullet theme"
curl -L http://raw.github.com/caiogondim/bullet-train-oh-my-zsh-theme/master/bullet-train.zsh-theme \
-o $HOME/.oh-my-zsh/themes/bullet-train.zsh-theme
fi
if [ ! -d $HOME/fonts ]; then
echo "fetching powerline fonts"
git clone https://github.com/powerline/fonts.git --depth=1
cd fonts
./install.sh
cd $HOME
fi
zsh --version
if ! command -v it2check > /dev/null; then
echo "installing iterm2 integrations ..."
curl -L https://iterm2.com/shell_integration/install_shell_integration_and_utilities.sh | bash
if [ $(echo $SHELL) = "/bin/zsh" ]; then
test -e "${HOME}/.iterm2_shell_integration.zsh" && source "${HOME}/.iterm2_shell_integration.zsh"
fi
if [ $(echo $SHELL) = "/bin/bash" ]; then
test -e "${HOME}/.iterm2_shell_integration.bash" && source ~/.iterm2_shell_integration.bash
fi
fi
#if ! ansible --version > /dev/null; then
# echo "installing ansible ..."
# /usr/local/bin/python3 -m pip install ansible
#fi
#ansible --version
# UFST
if ! aws-adfs --version > /dev/null; then
echo "installing aws-adfs ..."
/usr/local/bin/python3 -m pip install aws-adfs
fi
aws-adfs --version
# Application casks
caskInstall docker
echo "docker: $(command -v docker) $(docker --version)"
caskInstall iterm2
caskInstall authy
caskInstall visual-studio-code
caskInstall postman
brew tap adoptopenjdk/openjdk
caskInstall adoptopenjdk13-jre
# browsers
if [ ! -d "$~/Applications/Google Chrome.app" ]; then
caskInstall google-chrome
fi
caskInstall firefox
caskInstall brave-browser
caskInstall microsoft-edge
# collab tools
caskInstall slack
caskInstall microsoft-teams
# fun
caskInstall vlc
caskInstall deluge
caskInstall menumeters
if [ ! -d /Applications/Spectacle.app ]; then
echo fetching spectacle
mkdir $HOME/tmp > /dev/null
curl -L https://s3.amazonaws.com/spectacle/downloads/Spectacle+1.2.zip \
-o $HOME/tmp/Spectacle+1.2.zip
unzip $HOME/tmp/Spectacle+1.2.zip -d $HOME/tmp/
mv $HOME/tmp/Spectacle.app /Applications/
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment