Last active
May 1, 2023 14:34
-
-
Save ignasbernotas/63d63c053e2f591e089f9c8c9911b14d to your computer and use it in GitHub Desktop.
MacBook setup script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" | |
brew install zsh zsh-syntax-highlighting terraform nvm wget ab wrk nano gpg | |
# nano highlighting | |
curl https://raw.githubusercontent.com/scopatz/nanorc/master/install.sh | sh | |
# Oh my ZSH | |
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" | |
# prepare dirs | |
mkdir -p $HOME/Code/Golang | |
# store aliases | |
read -r -d '' aliases <<-EOF | |
# ------------------ | |
# ENV vars | |
export GOPATH=$HOME/Code/Golang | |
# Terraform | |
alias tf="terraform" | |
# this is scary stuff, use -auto-approve when you're happy to screw things up | |
alias tfa="terraform apply -auto-approve" | |
alias tfd="terraform destroy -auto-approve" | |
# Docker compose | |
alias dc="docker-compose" | |
alias dup="dc up -d" | |
alias dop="dc stop" | |
# Random | |
# Set google DNS | |
alias google-dns="networksetup -setdnsservers Wi-Fi 8.8.8.8 8.8.4.4" | |
# Fix GPG agent bug which happens closing the password modal with ctrl+c | |
alias gpg-fix="gpgconf --kill gpg-agent" | |
# Laravel Sail | |
alias sail='[ -f sail ] && bash sail || bash vendor/bin/sail' | |
alias ca-sync-dev='cd ~/Code/CodeAwesome/infra/ansible && ansible-playbook -i production.ini -i dev.ini playbooks/sync/dev.yml' | |
export PATH="/usr/local/opt/openssl@1.1/bin:$GOPATH/bin:/Users/ignas/.composer/vendor/bin:$PATH" | |
# ------------------ | |
EOF | |
echo "$aliases" >> ~/.aliases | |
echo "source ~/.aliases" >> ~/.zshrc | |
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k | |
p10k configure | |
# ~/.zshrc config entries | |
ZSH_THEME="powerlevel10k/powerlevel10k" | |
source /usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh | |
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 | |
# Add spaces to Dock | |
defaults write com.apple.dock persistent-apps -array-add '{"tile-type"="spacer-tile";}'; killall Dock | |
defaults write com.apple.dock persistent-apps -array-add '{"tile-type"="spacer-tile";}'; killall Dock | |
defaults write com.apple.dock persistent-apps -array-add '{"tile-type"="spacer-tile";}'; killall Dock | |
# InteliJ IDE | |
# Settings -> Editor -> Smart Keys -> Use Camel Humps Words | |
# Settings -> Version Control -> Commit -> Use non-modal commit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment