Skip to content

Instantly share code, notes, and snippets.

@naotone
Last active July 16, 2023 18:28
Show Gist options
  • Save naotone/d2cbb30cd8d54d34869f to your computer and use it in GitHub Desktop.
Save naotone/d2cbb30cd8d54d34869f to your computer and use it in GitHub Desktop.
My Macbook settings

OS X For Hackers

Run osxForHackers.sh
System Preferences

  • General
    • Highlight color: Graphite
    • Recent items: 50
  • Mission Control
    • All Hot Croners: Shift + Desktop
  • Security & Privacy
    • Turn on FileVault
    • Turn on Firewall
  • Spotlight
    • Disable all shortcuts
  • Keyboard
    • Change caps lock to Control
  • Sound
    • Turn off alert volume
  • Acceessibility
    • ZOOM - Use scroll gesture with modifier key to zoom: Control
    • AUDIO - Flash the screen when an alert sound occurs

Install Prezto

https://github.com/sorin-ionescu/prezto

installApps.sh

Run installApps.sh

Restore from Mackup

  • $ mackup restore

Manually install apps

  • quartz composer link
  • vdmx
  • resolume
  • blackmagic
  • Ablton Live
  • apple prores codec
  • menuanddockless link

Sync with Dropbox

From Mac App Store

  • iWork
  • sip
  • FolderWatch
  • growl
  • hardware growler
  • jpegmini
  • slicy
  • network radar
  • dash
  • transmit
  • daisydisk
  • simplify
  • wifi explorer
  • wifi siginal
  • miltipinger
  • reeder
  • pocket

Xcode

xcode-select --install
sudo xcodebuild -license
# Hacker's Guide to Setting up Your Mac
# http://lapwinglabs.com/blog/hacker-guide-to-setting-up-your-mac
echo "Installing homebrew..."
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew update
binaries=(
boot2docker
curl
docker
ffmpeg
findutils
git
jq
mackup
node
rbenv
pyenv
the_silver_searcher
tree
wget
youtube-dl
zsh
)
echo "installing binaries..."
brew install ${binaries[@]}
brew install caskroom/cask/brew-cask
brew tap caskroom/versions
coreApps=(
iterm2
dropbox
1password
karabiner
google-japanese-ime
clipmenu
bartender
alfred
divvy
google-chrome
google-chrome-canary
spotify
skype
slack
atom
mailbox
tower
virtualbox
vagrant
sketch
istat-menus
)
echo "installing apps..."
brew cask install ${coreApps[@]}
brew cask alfred link
apps=(
# 1password
adobe-creative-cloud
# alfred
appcleaner
arduino
# atom
# bartender
bathyscaphe
blender
blu-ray-player
camtasia
## chefdk
chrome-remote-desktop-host
cleanmymac2
# clipmenu
cloud
## codebox
coderunner
diskaid
# divvy
# dropbox
duet
ember
firefox
firefox-nightly
firefoxdeveloperedition
flash
gfxcardstatus
github
goofy
# google-chrome
# google-chrome-canary
## google-hangouts
# google-japanese-ime
google-photos-backup
hex-fiend
hipchat
# istat-menus
# iterm2
kaleidoscope
# karabiner
keyboard-cleaner
kobito
leap-motion
lighttable
## little-snitch
macpaw-gemini
## macvim
movist
mplayerx
nike-plus-connect
objektiv
opera
packet-peeper
parallels-desktop
poedit
processing
reflector
ripit
sequel-pro
shades
silverlight
# sketch
sketchup
skitch
# skype
# slack
soundcleod
soundflower
sourcetree
# spotify
supercollider
the-unarchiver
torbrowser
# tower
uninstallpkg
unity
unpkg
utorrent
# vagrant
# virtualbox
visual-studio-code
vivaldi
vlc
xtrafinder
)
# Install apps to /Applications
# Default is: /Users/$user/Applications
echo "installing apps..."
#brew cask install --appdir="/Applications" ${apps[@]}
brew cask install ${apps[@]}
## osx-for-hackers.sh https://gist.github.com/brandonb927/3195465
# https://gist.github.com/MatthewMueller/e22d9840f9ea2fee4716
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
echo ""
echo "Disable Spotlight indexing for any volume that gets mounted and has not yet been indexed before?"
sudo defaults write /.Spotlight-V100/VolumeConfiguration Exclusions -array "/Volumes"
echo ""
echo "Automatically quit printer app once the print jobs complete"
defaults write com.apple.print.PrintingPrefs "Quit When Finished" -bool true
# echo ""
# echo "Displaying ASCII control characters using caret notation in standard text views"
# defaults write NSGlobalDomain NSTextShowsControlCharacters -bool true
echo ""
echo "Save to disk, rather than iCloud, by default?"
defaults write NSGlobalDomain NSDocumentSaveNewDocumentsToCloud -bool false
echo ""
echo "Reveal IP address, hostname, OS version, etc. when clicking the clock in the login window"
sudo defaults write /Library/Preferences/com.apple.loginwindow AdminHostInfo HostName
echo ""
echo "Check for software updates daily, not just once per week"
defaults write com.apple.SoftwareUpdate ScheduleFrequency -int 1
# echo ""
# echo "Removing duplicates in the 'Open With' menu"
# /System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -kill -r -domain local -domain system -domain user
echo ""
echo "Disable smart quotes and smart dashes?"
defaults write NSGlobalDomain NSAutomaticQuoteSubstitutionEnabled -bool false
defaults write NSGlobalDomain NSAutomaticDashSubstitutionEnabled -bool false
echo ""
echo "Disable the menubar transparency?"
defaults write com.apple.universalaccess reduceTransparency -bool true
echo ""
echo "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
###############################################################################
echo ""
echo "Increasing sound quality for Bluetooth headphones/headsets"
defaults write com.apple.BluetoothAudioAgent "Apple Bitpool Min (editable)" -int 40
echo ""
echo "Enabling full keyboard access for all controls (enable Tab in modal dialogs, menu windows, etc.)"
defaults write NSGlobalDomain AppleKeyboardUIMode -int 3
echo ""
echo "Disabling press-and-hold for special keys in favor of key repeat"
defaults write NSGlobalDomain ApplePressAndHoldEnabled -bool false
# echo ""
# echo "Setting a blazingly fast keyboard repeat rate"
# defaults write NSGlobalDomain KeyRepeat -int 0
echo ""
echo "Disable auto-correct?"
defaults write NSGlobalDomain NSAutomaticSpellingCorrectionEnabled -bool false
echo ""
echo "Turn off keyboard illumination when computer is not used for 30 sec"
defaults write com.apple.BezelServices kDimTime -int 30
echo ""
echo "Disable keyboard from automatically adjusting backlight brightness in low light?"
sudo defaults write /Library/Preferences/com.apple.iokit.AmbientLightSensor "Automatic Keyboard Enabled" -bool false
###############################################################################
# Screen
###############################################################################
echo ""
echo "Requiring password immediately after sleep or screen saver begins"
defaults write com.apple.screensaver askForPassword -int 1
defaults write com.apple.screensaver askForPasswordDelay -int 0
echo ""
echo "Disable shadow in screenshots"
defaults write com.apple.screencapture disable-shadow -bool true
echo ""
echo "What format should screenshots be saved as jpg"
defaults write com.apple.screencapture type -string "jpg"
echo ""
echo "Enabling subpixel font rendering on non-Apple LCDs"
defaults write NSGlobalDomain AppleFontSmoothing -int 2
# echo ""
# echo "Enabling HiDPI display modes (requires restart)"
# sudo defaults write /Library/Preferences/com.apple.windowserver DisplayResolutionEnabled -bool true
###############################################################################
# Finder
###############################################################################
echo ""
echo "Show icons for hard drives, servers, and removable media on the desktop?"
defaults write com.apple.finder ShowExternalHardDrivesOnDesktop -bool true
echo ""
echo "Show all filename extensions in Finder by default?"
defaults write NSGlobalDomain AppleShowAllExtensions -bool true
echo ""
echo "Show status bar in Finder by default?"
defaults write com.apple.finder ShowStatusBar -bool true
echo ""
echo "Finder: show path bar"
defaults write com.apple.finder ShowPathbar -bool true
#echo ""
#echo "Display full POSIX path as Finder window title?"
#defaults write com.apple.finder _FXShowPosixPathInTitle -bool true
echo ""
echo "Disable the warning when changing a file extension?"
defaults write com.apple.finder FXEnableExtensionChangeWarning -bool false
echo ""
echo "Use column view in all Finder windows by default?"
defaults write com.apple.finder FXPreferredViewStyle Clmv
echo ""
echo "Avoid creation of .DS_Store files on network volumes?"
defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true
echo ""
echo "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
echo ""
echo "Allowing text selection in Quick Look/Preview in Finder by default"
defaults write com.apple.finder QLEnableTextSelection -bool true
###############################################################################
# Dock & Mission Control
###############################################################################
echo "Wipe all (default) app icons from the Dock?"
echo "(This is only really useful when setting up a new Mac, or if you don't use the Dock to launch apps.)"
defaults write com.apple.dock persistent-apps -array
echo ""
echo "Speeding up Mission Control animations and grouping windows by application"
defaults write com.apple.dock expose-animation-duration -float 0.1
defaults write com.apple.dock "expose-group-by-app" -bool true
echo ""
echo "Set Dock to auto-hide and remove the auto-hiding delay?"
defaults write com.apple.dock autohide -bool true
# defaults write com.apple.dock autohide-delay -float 0
# defaults write com.apple.dock autohide-time-modifier -float 0
###############################################################################
# Chrome, Safari, & WebKit
###############################################################################
echo ""
echo "Privacy: Don’t send search queries to Apple"
defaults write com.apple.Safari UniversalSearchEnabled -bool false
defaults write com.apple.Safari SuppressSearchSuggestions -bool true
echo ""
echo "Hiding Safari's bookmarks bar by default"
defaults write com.apple.Safari ShowFavoritesBar -bool false
echo ""
echo "Hiding Safari's sidebar in Top Sites"
defaults write com.apple.Safari ShowSidebarInTopSites -bool false
echo ""
echo "Disabling Safari's thumbnail cache for History and Top Sites"
defaults write com.apple.Safari DebugSnapshotsUpdatePolicy -int 2
echo ""
echo "Enabling Safari's debug menu"
defaults write com.apple.Safari IncludeInternalDebugMenu -bool true
echo ""
echo "Making Safari's search banners default to Contains instead of Starts With"
defaults write com.apple.Safari FindOnPageMatchesWordStartsOnly -bool false
# echo ""
# echo "Removing useless icons from Safari's bookmarks bar"
# defaults write com.apple.Safari ProxiesInBookmarksBar "()"
echo ""
echo "Enabling 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
echo ""
echo "Adding a context menu item for showing the Web Inspector in web views"
defaults write NSGlobalDomain WebKitDeveloperExtras -bool true
echo ""
echo "Disabling the annoying backswipe in Chrome"
defaults write com.google.Chrome AppleEnableSwipeNavigateWithScrolls -bool false
defaults write com.google.Chrome.canary AppleEnableSwipeNavigateWithScrolls -bool false
echo ""
echo "Using the system-native print preview dialog in Chrome"
defaults write com.google.Chrome DisablePrintPreview -bool true
defaults write com.google.Chrome.canary DisablePrintPreview -bool true
echo ""
echo "Allow hitting the Backspace key to go to the previous page in history"
defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2BackspaceKeyNavigationEnabled -bool true
echo ""
echo "Show the full URL in the address bar (note: this still hides the scheme)"
defaults write com.apple.Safari ShowFullURLInSmartSearchField -bool true
###############################################################################
# Terminal
###############################################################################
# echo ""
# echo "Enabling UTF-8 ONLY in Terminal.app and setting the Pro theme by default"
# defaults write com.apple.terminal StringEncodings -array 4
# defaults write com.apple.Terminal "Default Window Settings" -string "Pro"
# defaults write com.apple.Terminal "Startup Window Settings" -string "Pro"
echo ""
echo "Don’t display the annoying prompt when quitting iTerm"
defaults write com.googlecode.iterm2 PromptOnQuit -bool false
###############################################################################
# Time Machine
###############################################################################
echo ""
echo "Prevent Time Machine from prompting to use new hard drives as backup volume?"
defaults write com.apple.TimeMachine DoNotOfferNewDisksForBackup -bool true
echo ""
echo "Disable local Time Machine backups? (This can take up a ton of SSD space on <128GB SSDs)"
hash tmutil &> /dev/null && sudo tmutil disablelocal
###############################################################################
# atom
###############################################################################
echo ""
echo "Setting Git to use Sublime Text as default editor"
git config --global core.editor "atom -n -w"
###############################################################################
# Kill affected applications
###############################################################################
for app in "Activity Monitor" "Address Book" "Calendar" "Contacts" "cfprefsd" \
"Dock" "Finder" "Mail" "Messages" "Safari" "SizeUp" "SystemUIServer" \
"Terminal" "Transmission" "Twitter" "iCal"; do
killall "${app}" > /dev/null 2>&1
done
echo "Done. Note that some of these changes require a logout/restart to take effect."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment