Skip to content

Instantly share code, notes, and snippets.

@nmn
Last active October 2, 2020 23:46
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nmn/beaf749544a62354ef3f to your computer and use it in GitHub Desktop.
Save nmn/beaf749544a62354ef3f to your computer and use it in GitHub Desktop.
Mac Set-up
#!/usr/bin/env bash
# install Xcode Command Line Tools
# https://github.com/timsutton/osx-vm-templates/blob/ce8df8a7468faa7c5312444ece1b977c1b2f77a4/scripts/xcode-cli-tools.sh
# touch /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress;
# PROD=$(softwareupdate -l |
# grep "\*.*Command Line" |
# head -n 1 | awk -F"*" '{print $2}' |
# sed -e 's/^ *//' |
# tr -d '\n')
# softwareupdate -i "$PROD" -v;
# Ask for the administrator password upfront
sudo -v
# Keep-alive: update existing `sudo` time stamp until `.osx` has finished
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &
# chown local directory
sudo chown -R $(whoami):admin /usr/local
# 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
###############################################################################
# Trackpad, mouse, keyboard, Bluetooth accessories, and input #
###############################################################################
# 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
# Enable full keyboard access for all controls
# (e.g. enable Tab in modal dialogs)
defaults write NSGlobalDomain AppleKeyboardUIMode -int 3
###############################################################################
# Screen #
###############################################################################
# Save screenshots to the desktop
defaults write com.apple.screencapture location -string "${HOME}/Desktop"
# Save screenshots in PNG format (other options: BMP, GIF, JPG, PDF, TIFF)
defaults write com.apple.screencapture type -string "png"
###############################################################################
# Finder #
###############################################################################
# Finder: show hidden files by default
defaults write com.apple.Finder AppleShowAllFiles -bool true
# Finder: show all filename extensions
defaults write NSGlobalDomain AppleShowAllExtensions -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
# Finder: allow text selection in Quick Look
defaults write com.apple.finder QLEnableTextSelection -bool true
# When performing a search, search the current folder by default
defaults write com.apple.finder FXDefaultSearchScope -string "SCcf"
# Disable the warning when changing a file extension
defaults write com.apple.finder FXEnableExtensionChangeWarning -bool false
# Show the ~/Library folder
chflags nohidden ~/Library
# Add iOS Simulator to Launchpad
sudo ln -sf "/Applications/Xcode.app/Contents/Developer/Applications/iOS Simulator.app" "/Applications/iOS Simulator.app"
###############################################################################
# Safari & WebKit #
###############################################################################
# Press Tab to highlight each item on a web page
defaults write com.apple.Safari WebKitTabToLinksPreferenceKey -bool true
defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2TabsToLinks -bool true
# Enable Safari’s debug menu
defaults write com.apple.Safari IncludeInternalDebugMenu -bool true
# Make Safari’s search banners default to Contains instead of Starts With
defaults write com.apple.Safari FindOnPageMatchesWordStartsOnly -bool false
# Enable the Develop menu and the Web Inspector in Safari
defaults write com.apple.Safari IncludeDevelopMenu -bool true
defaults write com.apple.Safari WebKitDeveloperExtrasEnabledPreferenceKey -bool true
defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2DeveloperExtrasEnabled -bool true
# Add a context menu item for showing the Web Inspector in web views
defaults write NSGlobalDomain WebKitDeveloperExtras -bool true
###############################################################################
# Terminal #
###############################################################################
# Only use UTF-8 in Terminal.app
defaults write com.apple.terminal StringEncodings -array 4
###############################################################################
# Brew #
###############################################################################
#install Brew
# ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# Make sure we’re using the latest Homebrew
brew update
# Upgrade any already-installed formulae
brew upgrade
#install stuff with brew
brew install \
caskroom/cask/brew-cask \
cmake \
ack \
automake \
flow \
postgresql \
mongodb \
mysql \
node \
npm \
openssl \
pssh \
redis \
homebrew/versions/swig304 \
;
# GNU core utilities (those that come with OS X are outdated)
# Don’t forget to add `$(brew --prefix coreutils)/libexec/gnubin` to `$PATH`.
brew install coreutils
brew install moreutils
# GNU `find`, `locate`, `updatedb`, and `xargs`, `g`-prefixed
brew install findutils
# GNU `sed`, overwriting the built-in `sed`
brew install gnu-sed --default-names
# generic colouriser http://kassiopeia.juls.savba.sk/~garabik/software/grc/
brew install grc
# Install wget with IRI support
brew install wget --enable-iri
# Install more recent versions of some OS X tools
brew install vim --override-system-vi
brew install homebrew/dupes/grep
brew install homebrew/dupes/screen
# Install other useful binaries
brew install sift
brew install git
brew install imagemagick --with-webp
brew install node # This installs `npm` too using the recommended installation method
brew install pv
brew install rename
brew install tree
brew install zopfli
brew install ffmpeg --with-libvpx
brew install terminal-notifier
brew install zsh
# For syntax highlighting in c (instead cat)
sudo easy_install Pygments
brew tap caskroom/versions
# daily
# brew cask install spectacle
brew cask install dropbox
# brew cask install gyazo
# brew cask install onepassword
# brew cask install rescuetime
# brew cask install flux
# dev
# brew cask install iterm2
# brew cask install sublime-text # this gets ST2, we want 3
brew cask install atom
brew cask install visual-studio-code
brew cask install imagealpha
brew cask install imageoptim
# fun
# brew cask install limechat
brew cask install miro-video-converter
brew cask install gifrocket
brew cask install skype
brew cask install transmission
brew cask install xld
brew cask install igetter
brew cask install jeromelebel-mongohub
brew cask install the-unarchiver
brew cask install paparazzi
brew cask install unrarx
brew cask install gitup
brew cask install cyberduck
brew cask install playback
brew cask install numi
# brew cask install horndis # usb tethering
# browsers
brew cask install google-chrome-canary
brew cask install firefox-nightly
brew cask install webkit-nightly
brew cask install google-chrome
brew cask install firefox
brew cask install chromium
# brew cask install torbrowser
# less often
# brew cask install disk-inventory-x
# brew cask install screenflow4 # 4 specifically not 5.
brew cask install vlc
brew cask install transmission
# brew cask install gpgtools
# brew cask install licecap
# brew cask install utorrent
# quicklook extensions
brew cask install betterzipql
brew cask install qlcolorcode
brew cask install qlimagesize
brew cask install qlmarkdown
brew cask install qlprettypatch
brew cask install qlstephen
brew cask install quicklook-csv
brew cask install quicklook-json
brew cask install suspicious-package
brew cask install webpquicklook
## NPM
npm install -g n npm-run serve-https
curl http://c758482.r82.cf2.rackcdn.com/Sublime%20Text%20Build%203083.dmg > $HOME/Downloads/sublimetext.dmg
open $HOME/Downloads/sublimetext.dmg
sleep 10
sudo cp -R /Volumes/Sublime\ Text/Sublime\ Text.app /Applications/Sublime\ Text.app
# sublime test cli tool
ln -sf "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" /usr/local/bin/subl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment