Skip to content

Instantly share code, notes, and snippets.

@garygsw
Last active October 3, 2023 04:01
Show Gist options
  • Save garygsw/c560465b03d9fb1777cac24516db62d7 to your computer and use it in GitHub Desktop.
Save garygsw/c560465b03d9fb1777cac24516db62d7 to your computer and use it in GitHub Desktop.

My setup script for Mac OS X version >= 11.6

Install XCode Command Line Tools

xcode-select --install

Install Homebrew

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Install CLI tools

brew install git
brew install pyenv
brew install pyenv-virtualenv
brew install pipx
brew install node
brew install wget
brew install z
brew install ag
brew install ack
brew install fd
brew install ffind
brew install fpp
brew install tmux
brew install watchman
brew install yarn
brew install duti
brew install ruby
brew install rbenv
brew install apache-spark
brew install docker

Setup PipX

pipx ensurepath

Install applications and plugins

brew install --cask iterm2
brew install --cask visual-studio-code
brew install --cask clipy
brew install --cask dropbox
brew install --cask rectangle
brew install --cask itsycal
brew install --cask notion
brew install --cask karabiner-elements
brew install --cask warp
brew install --cask mac-mouse-fix
brew install --cask raycast

Mark vscode as default editor for all text files, public.data

duti -s com.microsoft.VSCode public.plain-text all
duti -s com.microsoft.VSCode public.data all

Finder settings

Show status bar

defaults write com.apple.finder ShowStatusBar -bool true

Show hidden files by default

defaults write com.apple.finder AppleShowAllFiles -bool true

Show all file extensions by default

defaults write NSGlobalDomain AppleShowAllExtensions -bool true

Allow text selection in Quick Look

defaults write com.apple.finder QLEnableTextSelection -bool true

Disable the warning when changing a file extension

defaults write com.apple.finder FXEnableExtensionChangeWarning -bool false

Avoid creating .DS_Store files on network or USB volumes

defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true
defaults write com.apple.desktopservices DSDontWriteUSBStores -bool true

Mouse sensitivity setting

defaults write -g com.apple.mouse.scaling 25.0

Prevent Time Machine from prompting to use new hard drives as backup volume

defaults write com.apple.TimeMachine DoNotOfferNewDisksForBackup -bool true

Install oh-my-zsh

sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions

Install powerlevel10k

git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k

Configure powerlevel10

Edit ~/.zshrc:

  • Set ZSH_THEME="powerlevel10k/powerlevel10k"
  • Set plugins=(git colored-man-pages colorize pip python brew osx zsh-autosuggestions) Restart Zsh. Powerlevel10k will run a configuration wizard Install the recommended font (Meslo Nerd Font) Select other options according to your preference

Configure iterm2

  • Download Batman theme
  • Switch profile to preset
  • Set preferences to read from dropbox dotfiles

Setup pyenv

Edit ~/.zshrc:

echo 'eval "$(pyenv init -)"' >> ~/.zshrc
echo 'eval "$(pyenv virtualenv-init -)"' >> ~/.zshrc
echo 'PATH=$(pyenv root)/shims:$PATH' >> ~/.zshrc
pyenv install 3.9.7
pyenv global 3.9.7
python -m pip install --upgrade pip

Setup git

git config --global user.email "you@example.com" git config --global user.name "Your Name"

Setup airflow

airflow users create --role Admin --username admin --email admin --firstname admin --lastname admin --password admin

Setup virtalenv and virtualenvwrapper

Edit ~/.zshrc:

export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
export VIRTUALENVWRAPPER_PYTHON=~/.pyenv/shims/python
export VIRTUALENV_PYTHON=~/.pyenv/shims/python
export WORKON_HOME=~/.virtualenvs
source ~/.pyenv/versions/3.7.12/bin/virtualenvwrapper.sh


# Install from App Store
# Notion Web Clipper: https://apps.apple.com/us/app/notion-web-clipper/id1559269364?mt=12
# AdBlock Pro: https://apps.apple.com/sg/app/adblock-pro-for-safari/id1018301773
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment