Skip to content

Instantly share code, notes, and snippets.

@aaronsmulktis
Created April 20, 2020 18:33
Show Gist options
  • Save aaronsmulktis/534c011af3917647565500cfc14021e2 to your computer and use it in GitHub Desktop.
Save aaronsmulktis/534c011af3917647565500cfc14021e2 to your computer and use it in GitHub Desktop.
# Helpful: https://www.freecodecamp.org/news/how-to-configure-your-macos-terminal-with-zsh-like-a-pro-c0ab3f3c1156/
# Helpful: https://github.com/alexramirez/mac-setup
# Helpful: https://github.com/mathiasbynens/dotfiles/blob/master/.macos
# Run this from ~/Library/Mobile\ Documents/com~apple~CloudDocs/Install-Everything.sh
# Ask for the administrator password upfront
# echo -n 'Your Password Sir: '
# sudo -v
# read -s password
# Keep-alive: update existing `sudo` time stamp until `.macos` has finished
# while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &
# Disable System Integrity Protection
# Shut down and restart in Recovery Mode (Cmd + R)
echo "Please shut down and run `csrutil disable`"
exit
# csrutil disable
echo "Installing Command Line Tools"
xcode-select —-install
echo "Unhiding ~/Library"
chflags nohidden ~/Library
echo "Copy ZSH config & plugins"
cp ~/Library/Mobile\ Documents/com~apple~CloudDocs/zshrc.sh ~/.zshrc
cp ~/Library/Mobile\ Documents/com~apple~CloudDocs/zsh-plugins.txt ~/.zsh_plugins.sh
echo "Installing Homebrew & cask, upgrade cask"
ruby -e "$(curl -o https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew cask
brew tap buo/cask-upgrade
echo "Installing iTerm2"
brew cask install iterm2
echo "Installing ASCIInema"
brew install asciinema
asciinema auth
echo "Installing ZSH / Oh My Zsh"
brew install zsh
brew install getantibody/tap/antibody
mkdir -p $HOME/.oh-my-zsh/custom/plugins/
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
zsh --version
upgrade_oh_my_zsh
echo "Installing Mackup & MacPrefs"
brew install Mackup
brew install clintmod/formulas/macprefs
echo "Installing VNC Client"
open \"curl -fsSL https://www.realvnc.com/download/file/viewer.files/VNC-Viewer-6.19.1115-MacOSX-x86_64.dmg\"
mv /Volumes/VNC\ Viewer.app ~/Applications/
diskutil unmount /Volumes/VNC-Viewer-6.19.1115-MacOSX-x86_64
# Install Python 3
brew install python3
mkdir ~/.virtualenvs
# Install Python
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python get-pip.py
python3 get-pip.py
# Set default Python
# (https://opensource.com/article/19/5/python-3-default-mac)
echo "\nalias python=/usr/local/bin/python3.7" >> ~/.zshrc
# Install How Do I
pip install howdoi
# exit
# Install Rust Lang
curl https://sh.rustup.rs -sSf | sh
#setup ssh config
# Duet iOS Display
# open "curl -o https://updates.duetdisplay.com/latestMac"
# mv ~/Downloads/duet.app /Applications/
# rm ~/Downloads/duet-*.zip
# Fonts?
# https://github.com/powerline/fonts
gem install gist
# essential
brew install ruby
brew install gnupg
# One of these:
gpg --keyserver hkp://pool.sks-keyservers.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
# gpg --keyserver hkp://pgp.mit.edu --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
# gpg --keyserver hkp://keyserver.pgp.com --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
# (↑ say 'no' to the zsh override)
\curl -sSL https://get.rvm.io | bash -s stable --ruby
rvm install ruby --latest
rvm install 2.5
# https://stackoverflow.com/a/30844709/2250505
gem install bundler
# Cocoa Pods for XCode
gem install cocoapods
brew install postgresql
mkdir -p ~/Library/LaunchAgents
cp /usr/local/Cellar/postgresql/11.5_1/homebrew.mxcl.postgresql.plist ~/Library/LaunchAgents/
launchctl load -w /System/Library/LaunchDaemons/com.apple.locate.plist
brew cask install lunchy
# gem install lunchy
lunchy start postgres
# NodeJS
brew install nvm
mkdir ~/.nvm
echo "\nexport NVM_DIR=~/.nvm" >> ~/.zshrc
echo "\nexport NVM_DIR=\"$HOME/.nvm\" [ -s \"$NVM_DIR/nvm.sh\" ] && . \"$NVM_DIR/nvm.sh\"" >> ~/.zshrc
echo "[[ -s $HOME/.nvm/nvm.sh ]] && . $HOME/.nvm/nvm.sh" >> ~/.zshrc
git clone http://github.com/creationix/nvm.git .nvm
nvm install 10.16
npm i -g yarn
# brew install yarn
# brew uninstall node --ignore-dependencies
brew install watchman
brew tap AdoptOpenJDK/openjdk
brew cask install adoptopenjdk8
npm install -g react-native-cli
# Python 2 & 3
# NOPE
# pip3 install awscli --upgrade --user
brew install awscli
aws configure
brew install gource
brew install mas
# iWork (lol)
mas install 409183694 # Keynote
mas install 409201541 # Pages
# Marked
mas install 448925439
# Dashlane
mas install 552383089
# Remote Desktop
mas install 409907375
# Logic Pro X
mas install 634148309
# Harvest
mas install 506189836
# Glyphs 2
mas install 1175857180
# Wifi Signal
mas install 525912054
# Irvue Wallpapers
mas install 1039633667
# Magnet
mas install 441258766
# Amphetamine (keeps awake during processes)
mas install 937984704
# Postico
open "curl -o https://eggerapps.at/postico/download/"
mv ~/Downloads/Postico.app /Applications
rm ~/Downloads/postico-*.zip
# TablePlus
open "curl -o https://tableplus.com/release/osx/tableplus_latest"
# Docker
brew install docker docker-compose docker-machine xhyve docker-machine-driver-xhyve
chown root:wheel $(brew --prefix)/opt/docker-machine-driver-xhyve/bin/docker-machine-driver-xhyve
chmod u+s $(brew --prefix)/opt/docker-machine-driver-xhyve/bin/docker-machine-driver-xhyve
# dev
brew install sqlite
brew install dnsmasq
brew cask install sequel-pro
# brew cask install virtualbox
# brew cask install vagrant
brew install tree
brew cask install visual-studio-code
# X Code
mas install 497799835
# VS Code Packages
code --install-extension be5invis.toml
code --install-extension dbaeumer.vscode-eslint
code --install-extension esbenp.prettier-vscode
code --install-extension mgmcdermott.vscode-language-babel
code --install-extension ms-azuretools.vscode-docker
code --install-extension ms-python.python
code --install-extension ms-vscode.cpptools
code --install-extension ms-vscode.Go
code --install-extension PKief.material-icon-theme
code --install-extension redhat.java
code --install-extension redhat.vscode-yaml
code --install-extension rust-lang.rust
code --install-extension serayuzgur.crates
code --install-extension vscjava.vscode-maven
code --install-extension xabikos.JavaScriptSnippets
code --install-extension octref.vetur
# utils
# Colorizer
brew install ccze
# brew cask install divvy
# brew cask install istat-menus
# brew cask install the-unarchiver
brew cask install vlc
# Dynamo - Speed-up Video Playback
# mas install
brew cask install postman
brew cask install ngrok
brew install composer
brew install imagemagick
# Meteor
# Gitlab Wiki
gem install gollum
gem install github-markdown
# Set default filetype apps
brew install duti
# Sets all markdown to open with Marked
# https://github.com/moretension/duti
# NOT WORKING
# set app_id to "osascript -e \"id of app \"Marked\"\""
# set app_id to "osascript -e 'id of app \"Marked\"'"
# set id_res to do shell script app_id
# echo id_res
# WORKING
duti -s com.brettterpstra.marky .md all
brew cask install suitcase-fusion
# Sets all fonts to open with Suitcase Fusion
# NOT WORKING
set app_id to "osascript -e \"id of app \"Suitcase\ Fusion\"\""
set id_res to do shell script app_id
echo id_res
duti -s id_res .otf all
duti -s id_res .ttf all
duti -s id_res .fnt all
duti -s id_res .woff all
open /Applications/Utilities/Terminal.app/Contents/Resources/Fonts/*
# browsers
brew cask install firefox
brew cask install google-chrome
# others
brew cask install dropbox
# brew cask install limechat
# LimeChat
mas install 414030210
brew cask install skype
brew cask install spotify
brew cask install whatsapp
brew cask install slack
brew cask install evernote
brew cask install google-photos-backup-and-sync
# quick look plugins (https://github.com/sindresorhus/quick-look-plugins)
brew cask install qlcolorcode qlstephen qlmarkdown quicklook-json qlimagesize webpquicklook suspicious-package quicklookase qlvideo betterzip provisionql quicklook-pat webpquicklook
brew tap heroku/brew && brew install heroku
heroku autocomplete
printf "$(heroku autocomplete:script bash)" >> ~/.zshrc
# QuickBooks Online
# open "curl -o ~/Downloads/QuickBooks.dmg https://http-download.intuit.com/http.intuit/CMO/qbo_client_web/static/release/mac/latest/QuickBooks.dmg"
# cp -R /Volumes/QuickBooks/QuickBooks.app /Applications/
# diskutil unmount /Volumes/QuickBooks/
# Figma
# open "curl -o https://www.figma.com/download/desktop/mac"
# Figma Fonts
open "curl -o ~/Downloads/FigmaUninstaller.pkg https://font-daemon.figma.com/FigmaUninstaller.pkg"
# OmniGraffle 6
open "curl -o ~/Downloads/OmniGraffle-6.6.2.dmg https://downloads.omnigroup.com/software/MacOSX/10.10/OmniGraffle-6.6.2.dmg"
cp -R /Volumes/OmniGraffle/OmniGraffle.app /Applications
diskutil unmount /Volumes/OmniGraffle/
# Dynamo / Design Script
open "curl -o ~/Downloads/DynamoCoreRuntime2.4.0.zip https://dyn-builds-data.s3-us-west-2.amazonaws.com/DynamoCoreRuntime2.4.0.zip"
# Matlab / Octave
brew install octave
# ChronoSync
open "curl -o ~/Downloads/CS4_Download.dmg https://downloads.econtechnologies.com/CS4_Download.dmg"
# Needs to tab or click "continue", then "close", then "move to trash"
# Games
open "curl -o ~/Downloads/steam.dmg https://steamcdn-a.akamaihd.net/client/installer/steam.dmg"
cp -R /Volumes/Steam/Steam.app /Applications
diskutil unmount /Volumes/Steam
# Mac OS X Defaults
# Mac System and App Preferences (e.g. defaults write)
# Uses ~/Dropbox/macprefs
macprefs restore
# https://github.com/clintmod/macprefs/issues/1
# sudo ls -la /private/var/root/Library/Preferences | grep -i case
# ls -la ~/Library/Preferences | grep -i case
# ls -la /Library/Preferences | grep -i case
# Keep your application settings in sync (OS X/Linux)
# Uses ~/Dropbox/Mackup
mackup restore
# Copy ZSH config
# cp ~/Library/Mobile\ Documents/com~apple~CloudDocs/zshrc.sh ~/.zshrc
# cp ~/Library/Mobile\ Documents/com~apple~CloudDocs/zsh-plugins.txt ~/.zsh_plugins.sh
# Sync ./dotfiles from $CLOD
###############################################################################
# General UI/UX #
###############################################################################
# Close any open System Preferences panes, to prevent them from overriding
# settings we’re about to change
osascript -e 'tell application "System Preferences" to quit'
# Increase window resize speed for Cocoa applications
defaults write NSGlobalDomain NSWindowResizeTime -float 0.001
# Expand save panel by default
defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode -bool true
defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode2 -bool true
# Expand print panel by default
defaults write NSGlobalDomain PMPrintingExpandedStateForPrint -bool true
defaults write NSGlobalDomain PMPrintingExpandedStateForPrint2 -bool true
# Save to disk (not to iCloud) by default
defaults write NSGlobalDomain NSDocumentSaveNewDocumentsToCloud -bool false
# Automatically quit printer app once the print jobs complete
defaults write com.apple.print.PrintingPrefs "Quit When Finished" -bool true
# Disable the “Are you sure you want to open this application?” dialog
defaults write com.apple.LaunchServices LSQuarantine -bool false
# Remove duplicates in the “Open With” menu (also see `lscleanup` alias)
# /System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -kill -r -domain local -domain system -domain user
# Display ASCII control characters using caret notation in standard text views
# Try e.g. `cd /tmp; unidecode "\x{0000}" > cc.txt; open -e cc.txt`
defaults write NSGlobalDomain NSTextShowsControlCharacters -bool true
# Disable Resume system-wide
defaults write com.apple.systempreferences NSQuitAlwaysKeepsWindows -bool false
# Disable automatic termination of inactive apps
defaults write NSGlobalDomain NSDisableAutomaticTermination -bool true
# Disable the crash reporter
#defaults write com.apple.CrashReporter DialogType -string "none"
# Set Help Viewer windows to non-floating mode
defaults write com.apple.helpviewer DevMode -bool true
# Reveal IP address, hostname, OS version, etc. when clicking the clock
# in the login window
defaults write /Library/Preferences/com.apple.loginwindow AdminHostInfo HostName
# Disable Notification Center and remove the menu bar icon
# launchctl unload -w /System/Library/LaunchAgents/com.apple.notificationcenterui.plist 2> /dev/null
# Disable automatic capitalization as it’s annoying when typing code
defaults write NSGlobalDomain NSAutomaticCapitalizationEnabled -bool false
# Disable smart dashes as they’re annoying when typing code
defaults write NSGlobalDomain NSAutomaticDashSubstitutionEnabled -bool false
# Disable automatic period substitution as it’s annoying when typing code
defaults write NSGlobalDomain NSAutomaticPeriodSubstitutionEnabled -bool false
# Disable smart quotes as they’re annoying when typing code
defaults write NSGlobalDomain NSAutomaticQuoteSubstitutionEnabled -bool false
# Disable auto-correct
defaults write NSGlobalDomain NSAutomaticSpellingCorrectionEnabled -bool false
# System Preferences > General > Click in the scrollbar to: Jump to the spot that's clicked
defaults write -globalDomain AppleScrollerPagingBehavior -bool true
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# System Preferences > Desktop & Screen Saver > Start after: Never
defaults -currentHost write com.apple.screensaver idleTime -int 0
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# System Preferences > Dock > Size:
defaults write com.apple.dock tilesize -int 38
# System Preferences > Dock > Minimize windows using: Scale effect
defaults write com.apple.dock mineffect -string "scale"
# System Preferences > Dock > Minimize windows into application icon
defaults write com.apple.dock minimize-to-application -bool true
# System Preferences > Dock > Automatically hide and show the Dock:
defaults write com.apple.dock autohide -bool true
# System Preferences > Dock > Automatically hide and show the Dock (duration)
defaults write com.apple.dock autohide-time-modifier -float 0.5
# System Preferences > Dock > Automatically hide and show the Dock (delay)
defaults write com.apple.dock autohide-delay -float 0
# System Preferences > Dock > Show indicators for open applications
defaults write com.apple.dock show-process-indicators -bool true
# Prevent Time Machine from prompting to use new hard drives as backup volume
defaults write com.apple.TimeMachine DoNotOfferNewDisksForBackup -bool true
# Use `sudo mdutil -i off "/Volumes/foo"` to stop indexing any volume.
sudo defaults write /.Spotlight-V100/VolumeConfiguration Exclusions -array "/Volumes"
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# System Preferences > Mission Controll > Automatically rearrange Spaces based on most recent use
defaults write com.apple.dock mru-spaces -bool false
# System Preferences > Mission Controll > Dashboard
defaults write com.apple.dock dashboard-in-overlay -bool true
###############################################################################
# Trackpad, mouse, keyboard, Bluetooth accessories, and input #
###############################################################################
# System Preferences > Keyboard >
defaults write NSGlobalDomain KeyRepeat -int 1
# System Preferences > Keyboard >
defaults write NSGlobalDomain InitialKeyRepeat -int 10
# System Preferences > Keyboard > Shortcuts > Full Keyboard Access
# defaults write -globalDomain AppleKeyboardUIMode -int 2
# Enable full keyboard access for all controls
# (e.g. enable Tab in modal dialogs)
defaults write NSGlobalDomain AppleKeyboardUIMode -int 3
# Disable “natural” (Lion-style) scrolling
defaults write NSGlobalDomain com.apple.swipescrolldirection -bool false
# System Preferences > Trackpad > Tap to click
defaults write com.apple.AppleMultitouchTrackpad Clicking -bool true
defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad Clicking -bool true
# Trackpad: enable tap to click for this user and for the login screen
defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad Clicking -bool true
defaults -currentHost write NSGlobalDomain com.apple.mouse.tapBehavior -int 1
defaults write NSGlobalDomain com.apple.mouse.tapBehavior -int 1
# System Preferences > Accessibility > Mouse & Trackpad > Trackpad Potions
# Use scroll gesture to zoom
defaults write com.apple.universalaccess closeViewScrollWheelToggle -bool true
defaults write com.apple.universalaccess HIDScrollZoomModifierMask -int 1048576
# defaults write com.apple.AppleMultitouchTrackpad HIDScrollZoomModifierMask -int 1048576
# defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad HIDScrollZoomModifierMask -int 1048576
defaults write com.apple.AppleMultitouchTrackpad TrackpadThreeFingerDrag -bool true
defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad TrackpadThreeFingerDrag -bool true
# defaults write com.apple.AppleMultitouchTrackpad Dragging -bool false
# defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad Dragging -bool false
# Increase sound quality for Bluetooth headphones/headsets
defaults write com.apple.BluetoothAudioAgent "Apple Bitpool Min (editable)" -int 40
# Completely Disable Dashboard
defaults write com.apple.dashboard mcx-disabled -bool true
# Stop iTunes from responding to the keyboard media keys
launchctl unload -w /System/Library/LaunchAgents/com.apple.rcd.plist 2> /dev/null
###############################################################################
# Energy saving #
###############################################################################
# Enable lid wakeup
pmset -a lidwake 1
# Restart automatically on power loss
pmset -a autorestart 1
# Restart automatically if the computer freezes
systemsetup -setrestartfreeze on
# Sleep the display after 15 minutes
pmset -a displaysleep 15
# Disable machine sleep while charging
pmset -c sleep 0
# Set machine sleep to 5 minutes on battery
pmset -b sleep 5
# Set standby delay to 24 hours (default is 1 hour)
pmset -a standbydelay 86400
# Never go into computer sleep mode
systemsetup -setcomputersleep Off > /dev/null
# Hibernation mode
# 0: Disable hibernation (speeds up entering sleep mode)
# 3: Copy RAM to disk so the system state can still be restored in case of a
# power failure.
pmset -a hibernatemode 0
# Remove the sleep image file to save disk space
rm /private/var/vm/sleepimage
# Create a zero-byte file instead…
touch /private/var/vm/sleepimage
# …and make sure it can’t be rewritten
chflags uchg /private/var/vm/sleepimage
exit
###############################################################################
# Screen #
###############################################################################
# Require password immediately after sleep or screen saver begins
defaults write com.apple.screensaver askForPassword -int 1
defaults write com.apple.screensaver askForPasswordDelay -int 0
# Save screenshots in PNG format (other options: BMP, GIF, JPG, PDF, TIFF)
# defaults write com.apple.screencapture type -string "png"
# Disable shadow in screenshots
defaults write com.apple.screencapture disable-shadow -bool true
# Enable subpixel font rendering on non-Apple LCDs
# Reference: https://github.com/kevinSuttle/macOS-Defaults/issues/17#issuecomment-266633501
defaults write NSGlobalDomain AppleFontSmoothing -int 1
# Enable HiDPI display modes (requires restart)
defaults write /Library/Preferences/com.apple.windowserver DisplayResolutionEnabled -bool true
exit
###############################################################################
# Finder #
###############################################################################
# Finder: allow quitting via ⌘ + Q; doing so will also hide desktop icons
# defaults write com.apple.finder QuitMenuItem -bool true
# Finder: disable window animations and Get Info animations
defaults write com.apple.finder DisableAllAnimations -bool true
# Show icons for hard drives, servers, and removable media on the desktop
defaults write com.apple.finder ShowExternalHardDrivesOnDesktop -bool true
defaults write com.apple.finder ShowHardDrivesOnDesktop -bool true
defaults write com.apple.finder ShowMountedServersOnDesktop -bool true
defaults write com.apple.finder ShowRemovableMediaOnDesktop -bool true
# Keep folders on top when sorting by name
defaults write com.apple.finder _FXSortFoldersFirst -bool true
# Finder > Preferences > Show all filename extensions
defaults write NSGlobalDomain AppleShowAllExtensions -bool true
# Finder > Preferences > Show warning before changing an extension
defaults write com.apple.finder FXEnableExtensionChangeWarning -bool false
# Finder > Preferences > Show warning before removing from iCloud Drive
defaults write com.apple.finder FXEnableRemoveFromICloudDriveWarning -bool false
# Finder > View > As List
# Use list view in all Finder windows by default
# Four-letter codes for the other view modes: `icnv`, `clmv`, `glyv`
defaults write com.apple.finder FXPreferredViewStyle -string "clmv"
# Finder > View > Show Path Bar
defaults write com.apple.finder ShowPathbar -bool true
# Finder: show status bar
defaults write com.apple.finder ShowStatusBar -bool true
# 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
# Disable disk image verification
defaults write com.apple.frameworks.diskimages skip-verify -bool true
defaults write com.apple.frameworks.diskimages skip-verify-locked -bool true
defaults write com.apple.frameworks.diskimages skip-verify-remote -bool true
# Enable snap-to-grid for icons on the desktop and in other icon views
/usr/libexec/PlistBuddy -c "Set :DesktopViewSettings:IconViewSettings:arrangeBy grid" ~/Library/Preferences/com.apple.finder.plist
/usr/libexec/PlistBuddy -c "Set :FK_StandardViewSettings:IconViewSettings:arrangeBy grid" ~/Library/Preferences/com.apple.finder.plist
/usr/libexec/PlistBuddy -c "Set :StandardViewSettings:IconViewSettings:arrangeBy grid" ~/Library/Preferences/com.apple.finder.plist
# Disable the warning before emptying the Trash
defaults write com.apple.finder WarnOnEmptyTrash -bool false
# Enable AirDrop over Ethernet and on unsupported Macs running Lion
defaults write com.apple.NetworkBrowser BrowseAllInterfaces -bool true
# Expand the following File Info panes:
# “General”, “Open with”, and “Sharing & Permissions”
defaults write com.apple.finder FXInfoPanesExpanded -dict \
General -bool true \
OpenWith -bool true \
Privileges -bool true
# Kill affected apps
for app in "Dock" "Finder"; do
killall "${app}" > /dev/null 2>&1
done
source ~/.zshrc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment