Skip to content

Instantly share code, notes, and snippets.

@louisguitton
Last active July 18, 2022 07:46
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save louisguitton/1f97640d7398fa9e251a679c1360e8e4 to your computer and use it in GitHub Desktop.
Save louisguitton/1f97640d7398fa9e251a679c1360e8e4 to your computer and use it in GitHub Desktop.
## install homebrew
echo "Installing Homebrew.."
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
echo "Homebrew successfully installed"
## install brew cask
echo "Installing brew cask.."
brew tap homebrew/cask
echo "Homebrew cask successfully installed"
## install google chrome
brew install --cask google-chrome docker visual-studio-code iterm2
## install git
echo "Installing git.."
brew install git
echo "git successfully installed"
## install git completion
echo "Installing git completion.."
curl https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.bash > ~/.git-completion.bash
echo "git completion successfully installed"
## install iterm2
echo "Installing iTerm2.."
cd ~/Downloads
curl https://iterm2.com/downloads/stable/iTerm2-3_1_7.zip > iTerm2.zip
unzip iTerm2.zip &> /dev/null
mv iTerm.app/ /Applications/iTerm.app
spctl --add /Applications/iTerm.app
rm -rf iTerm2.zip
echo "iTerm2 successfully installed.. Adding colors.."
cd ~/Downloads
mkdir -p ${HOME}/iterm2-colors
cd ${HOME}/iterm2-colors
curl https://github.com/mbadolato/iTerm2-Color-Schemes/zipball/master > iterm2-colors.zip
unzip iterm2-colors.zip
rm iterm2-colors.zip
echo "iTerm2 + Colors installed"
## zsh
brew install zsh zsh-completions zsh-syntax-highlighting &&\
curl -L https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh | sh &&\
chsh -s /bin/zsh
## Copying bash_rc
cat <<'EOF' >> ~/.zshrc
export EDITOR="code"
plugins=(aws docker git kubectl python zsh-autosuggestions zsh-completions colored-man-pages colorize brew macos)
if [ -f ~/.path ]; then
. ~/.path
fi
if [ -f ~/.bash_aliases ]; then
. ~/.bash_aliases
fi
source /usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
fpath=(/usr/local/share/zsh-completions $fpath)
EOF
cat <<'EOF' >> ~/.bash_aliases
alias open_dbt_docs='dbt docs generate && dbt docs serve'
alias gl_open="git remote -v | awk '/fetch/{print $2}' | sed -Ee 's#(git@|git://)#http://#' -e 's@com:@com/@' | head -n1 | xargs open"
alias ls='ls -G'
alias grep='grep --color=auto'
alias glog='git la'
alias cat='bat'
EOF
cat <<'EOF' >> ~/.gitconfig
[alias]
l = log --decorate --oneline --graph # like glog
la = !sh -c 'PAGER=cat git l -10 $*' --
#fancy log
lg = log --graph --full-history --all --color --date=short --pretty=format:\"%x1b[33m%h%x09%x1b[35m%ad%x1b[32m %d%x1b[0m%x20%s\"
br = !sh -c 'PAGER=cat git branch --sort=-committerdate $*' --
EOF
## terminal awesomeness
git clone https://github.com/zsh-users/zsh-completions ${ZSH_CUSTOM:=~/.oh-my-zsh/custom}/plugins/zsh-completions
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
brew install tree
brew install htop
brew cask install ngrok
curl https://raw.githubusercontent.com/oskarkrawczyk/honukai-iterm/master/honukai.zsh-theme > ~/.oh-my-zsh/custom/themes/honukai.zsh-theme
git clone https://github.com/romkatv/powerlevel10k.git $ZSH_CUSTOM/themes/powerlevel10k
brew install jq
brew install node
npm install -g tldr
brew install bat
brew install tig
brew install exa
## install vscode
echo "Installing VSCode.."
brew cask install visual-studio-code
## this might ask you for your password
code --version
echo "VSCode successfully installed"
code --install-extension code-settings-sync
## useful VSCode extensions that I sync with code-settings-sync
## code --install-extension vscode-icons-team.vscode-icons
## code --install-extension visualstudioexptteam.vscodeintellicode
## code --install-extension davidanson.vscode-markdownlint
## code --install-extension eamodio.gitlens
## install bash completion
echo "Installing bash competion.."
brew install bash-completion
echo "bash completion successfully installed"
## update terminal prompt
echo "Updating terminal prompt.."
curl https://raw.githubusercontent.com/git/git/master/contrib/completion/git-prompt.sh >> ~/.git-prompt.sh
echo "Terminal prompt successfully updated"
## create global gitignore
echo "Creating a global gitignore.."
git config --global core.excludesfile ~/.gitignore
touch ~/.gitignore
curl https://www.gitignore.io/api/macos,visualstudiocode >> ~/.gitignore
echo "Global gitignore created"
## SSH Key setup
ssh-keygen -t rsa -b 4096 -C "louisguitton93@gmail.com" -q -N "" -f ~/.ssh/id_rsa &&\
eval "$(ssh-agent -s)" &&\
ssh-add ~/.ssh/id_rsa
cat ~/.ssh/id_rsa.pub | pbcopy &&\
open https://github.com/settings/ssh/new
## configure git
brew install git-lfs &&\
git config --global user.name "Louis Guitton" &&\
git config --global user.email "louisguitton93@gmail.com" &&\
git config --global push.default matching &&\
git config --global core.editor nano
## install the repo
echo "Installing a repo.."
mkdir ~/workspace/
cd ~/workspace/
git clone git@github.com:louisguitton/awesome-tutos.git
echo "Repo successfully installed"
## install python3
brew install python3
## install python libraries at system level
pip3 install awscli pgcli pylama yapf
## install docker
brew cask install docker
## install kubectl
brew install kubectl
## install terraform
brew install terraform
## install heroku CLI
brew tap heroku/brew && brew install heroku
## install spotify
brew cask install spotify
## install dbt
echo "Installing dbt.."
brew update
brew tap fishtown-analytics/dbt
brew install dbt
echo "dbt successfully installed.. Printing version.."
dbt --version
echo "Seting up dbt profile.."
mkdir ~/.dbt
touch ~/.dbt/profiles.yml
curl https://gitlab.com/gitlab-data/analytics/raw/master/admin/sample_profiles.yml >> ~/.dbt/profiles.yml
echo "dbt profile created.. You will need to edit this file later."
## you will need to edit this file
## install the dbt completion script
echo "Installing dbt completion script.."
curl https://raw.githubusercontent.com/fishtown-analytics/dbt-completion.bash/master/dbt-completion.bash > ~/.dbt-completion.bash
echo 'autoload -U +X compinit && compinit' >> ~/.zshrc
echo 'autoload -U +X bashcompinit && bashcompinit' >> ~/.zshrc
echo 'source ~/.dbt-completion.bash' >> ~/.zshrc
echo "dbt completion script successfully installed"
## install SQL clients
brew cask install postico
brew cask install sequel-pro
## install spark
brew cask install java
brew cask install homebrew/cask-versions/adoptopenjdk8
brew install apache-spark
pip3 install pyspark jupyter
cat <<'EOF' >> ~/.zshrc
export SPARK_HOME=/usr/local/Cellar/apache-spark/2.4.3/libexec
export PATH=$SPARK_HOME/bin:$PATH
export PYSPARK_DRIVER_PYTHON=jupyter
export PYSPARK_DRIVER_PYTHON_OPTS=console
EOF
## Jumpcloud AWS
brew tap versent/homebrew-taps
brew install saml2aws
## MacOs defaults, inspired by https://github.com/mathiasbynens/dotfiles/blob/master/.macos
# Finder show hidden files
defaults write com.apple.finder AppleShowAllFiles YES && killall Finder
# Finder: allow quitting via ⌘ + Q; doing so will also hide desktop icons
defaults write com.apple.finder QuitMenuItem -bool true
# Finder: show all filename extensions
defaults write NSGlobalDomain AppleShowAllExtensions -bool true
# Display full POSIX path as Finder window title
defaults write com.apple.finder _FXShowPosixPathInTitle -bool true
# Keep folders on top when sorting by name
defaults write com.apple.finder _FXSortFoldersFirst -bool true
# Disable smart quotes as they’re annoying when typing code
defaults write NSGlobalDomain NSAutomaticQuoteSubstitutionEnabled -bool false
@johndpope
Copy link

johndpope commented Oct 1, 2019

fyi - https://gist.github.com/johndpope/1f8a0f119f94ee1d3f3c98753c744d9a

checkout miniconda for python 2/3 environments (as opposed to virtual environments).
checkout rvm for ruby environment managemnt
nvm for node version manager

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment