Skip to content

Instantly share code, notes, and snippets.



Last active Jan 8, 2020
What would you like to do?
#!/usr/bin/env bash
# many settings from
# many settings from
# previous install notes at:
fancy_echo() {
local fmt="$1"; shift
# shellcheck disable=SC2059
printf "\n$fmt\n" "$@"
# handle failures
trap 'ret=$?; test $ret -ne 0 && printf "failed\n\n" >&2; exit $ret' EXIT
# Things I don't know how to do from the command line:
# * use caps lock as esc for all keyboards
# * increase screen resolution to retina
# set the computer name:
sudo scutil --set ComputerName "nina"
sudo scutil --set HostName "nina"
sudo scutil --set LocalHostName "nina"
sudo defaults write /Library/Preferences/SystemConfiguration/ NetBIOSName -string "nina"
# speed up key repeat
defaults write NSGlobalDomain KeyRepeat -int 1
defaults write NSGlobalDomain InitialKeyRepeat -int 20
# Disable “natural” (Lion-style) scrolling
defaults write NSGlobalDomain -bool false
# Disable Notification Center and remove the menu bar icon
launchctl unload -w /System/Library/LaunchAgents/ 2> /dev/null
# I don't think this worked; instead I went into system preferences and
# set do not disturb to run from 3:01AM to 3:00AM
# Disable auto-correct
defaults write NSGlobalDomain NSAutomaticSpellingCorrectionEnabled -bool false
# Set the icon size of Dock items to 16 pixels
defaults write tilesize -int 16
# Set the magnification to true
defaults write magnification -int 1
# Wipe all (default) app icons from the Dock
defaults write persistent-apps -array
# Show only open applications in the dock
defaults write static-only -bool true
# remove autohide delay
defaults write autohide-delay -float 0
# Automatically hide and show the Dock
defaults write autohide -bool true
# show batter percentage
defaults write ShowPercent -bool true
# show the date in the toolbar
defaults write DateFormat -string 'EEE MMM d H:mm'
# Disable the sound effects on boot
sudo nvram SystemAudioVolume=" "
# Disable sound effects when changing volume
defaults write NSGlobalDomain -integer 0
# Disable sounds effects for user interface changes
defaults write NSGlobalDomain -int 0
# Set alert volume to 0
defaults write NSGlobalDomain -float 0.0
# Show volume in the menu bar
defaults write "NSStatusItem Visible" -int 0
# Show Bluetooth in the menu bar
defaults write "NSStatusItem Visible" -int 0
# Avoid creating .DS_Store files on network or USB volumes
defaults write DSDontWriteNetworkStores -bool true
defaults write DSDontWriteUSBStores -bool true
# don't hide files
defaults write AppleShowAllFiles true
# Show the ~/Library folder
chflags nohidden ~/Library
# Show the /Volumes folder
sudo chflags nohidden /Volumes
# mouse to max tracking speed
defaults write -g -int 3
# disable shake to locate mouse pointer
defaults write ~/Library/Preferences/.GlobalPreferences CGDisableCursorLocationMagnification -bool YES
# disable pinch to zoom
defaults write TrackpadPinch -int 0
# disable trackpad rotate
defaults write TrackpadRotate -int 0
# disable double tap to zoom
defaults write MouseOneFingerDoubleTapGesture -int 0
defaults write TrackpadTwoFingerDoubleTapGesture -int 0
# fix key repeat in vs code. I don't use it that often, but this is necessary when I do
defaults write ApplePressAndHoldEnabled -bool false
# speed up window opening by disabling animation
defaults write NSGlobalDomain NSAutomaticWindowAnimationsEnabled -bool NO
# reboot systemUIServer to enable defaults to take effect
killall SystemUIServer
if ! command -v brew >/dev/null; then
fancy_echo "Installing Homebrew ..."
curl -fsS \
'' | ruby
# Seems to be necessary to install some base libs like zlib. Requires you to
# enter your password
sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target /
brew install mas
# install Xcode, seems like some things depend on it. Unfortunately this
# required me to open app store and log in; `mas signin` did not work
fancy_echo 'you may need to log in to app store for this to work'
mas install `mas search Xcode | grep -E '\d\s*Xcode\s*\(' | awk '{print $1}'`
mas install `mas search Monosnap | grep -E '\d\s*Monosnap' | awk '{print $1}'`
brew install awscli
brew install autoconf
brew install automake
brew install bash
brew install cmake
brew install colordiff
brew install coreutils
brew install curl
brew install dep
brew install devd
brew install direnv
brew install dos2unix
brew install findutils
brew install fzf && /usr/local/opt/fzf/install --all
brew install gcc
brew install git
brew install gnu-sed
brew install gpg
brew install go
brew install gpg-agent
brew install grep
brew install htop
brew install hub
brew install jq
brew install md5sha1sum
brew install modd
brew install neovim
brew install nginx
brew install nmap
brew install node
brew install numpy
brew install oath-toolkit
brew install openconnect
brew install openssl
brew install postgres && brew services start postgresql
brew install python
brew install pyenv --HEAD
brew install rbenv
brew install reattach-to-user-namespace
brew install ripgrep
brew install sqlite
brew install tmux
brew install tree
brew install vim
brew install wget
brew install yarn
brew install youtube-dl
# install dotfiles
mkdir code
cd code
git clone
cd ..
cp -r code/personal_code/homedir/.* .
git clone ~/.vim/bundle/Vundle.vim
fancy_echo "now open vim and run :VundleInstall"
fancy_echo "then quit and mkdir ~/.vim/colors; cp .vim/bundle/Base2Tone-vim/colors/*.vim ~/.vim/colors"
# now set the updated bash as your login shell
sudo chsh -s /usr/local/bin/bash llimllib
brew tap caskroom/cask
brew cask install alfred
brew cask install chromium
brew cask install docker
brew cask install firefox
brew cask install google-chrome
brew cask install hipchat
brew cask install iterm2
brew cask install java
brew cask install karabiner-elements # and copy karabiner config folder into ~/.config
brew cask install keepingyouawake
brew cask install keybase
brew cask install kindle
brew cask install macvim
brew cask install slack
brew cask install spotify
brew cask install vagrant
brew cask install virtualbox
brew cask install vlc
# install chrome extensions: lastpass and ublock origin
# tell git to use the osx keychain
git config --global credential.helper osxkeychain
# create a personal access token to allow git to work on your computer
# copy ~/.ssh to the new computer and chown to your user
# copy ~/.gnupg to the new computer
# * set iTerm ctrl-tab and ctrl-shift-tab to "next term" and "prev term" rather
# than cycle
# install base2tone space-dark
fancy_echo "open iterm -> preferences -> profiles -> color presets and import base2tone-space-dark.itermcolors"
# download iosevka and install it
TEMP=$(mktemp -d)
cd $TEMP
cp ttf/* /Library/Fonts/
cd -
rm -rf $TEMP
# download hack and install it
TEMP=$(mktemp -d)
cd $TEMP
unzip *.zip
cp ttf/* /Library/Fonts/
cd -
rm -rf $TEMP
# install fira code
TEMP=$(mktemp -d)
cd $TEMP
unzip *.zip
cp ttf/* /Library/Fonts/
cd -
rm -rf $TEMP
pyenv install -v 3.7.2
pyenv global 3.7.2
pip install ipython
rbenv install 2.6.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.