Skip to content

Instantly share code, notes, and snippets.

@albertorestifo
Last active March 6, 2021 00:24
Show Gist options
  • Save albertorestifo/35098633cf773c2a22a3 to your computer and use it in GitHub Desktop.
Save albertorestifo/35098633cf773c2a22a3 to your computer and use it in GitHub Desktop.
New Mac setup and bootstrapping
# Path to the Oh-my-zsh install
export ZSH=$HOME/.oh-my-zsh
# Add all the required portions to the PATH
export PATH="/usr/local/opt/ruby/bin:$HOME/bin:$PATH";
# Source NVM
source ~/.nvm/nvm.sh
# ZSH Configurations
ZSH_THEME="wezm"
COMPLETION_WAITING_DOTS="true"
plugins=(git)
source $ZSH/oh-my-zsh.sh
# Antigen
# -------
source "$HOME/.antigen/antigen.zsh"
antigen-use oh-my-zsh
antigen-bundle arialdomartini/oh-my-git
antigen theme arialdomartini/oh-my-git-themes oppa-lana-style
antigen-apply
# Hide desktop icons
sudo defaults write com.apple.finder CreateDesktop -bool false
# Expand Save screen by default
defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode -bool true
defaults write NSGlobalDomain PMPrintingExpandedStateForPrint -bool true
defaults write NSGlobalDomain PMPrintingExpandedStateForPrint2 -bool true
# Automagically quit printer app once job finished
defaults write com.apple.print.PrintingPrefs "Quit When Finished" -bool true
# Save to disk, rather than iCloud, by default
defaults write NSGlobalDomain NSDocumentSaveNewDocumentsToCloud -bool false
# 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
# Check for software updates daily, not just once per week
defaults write com.apple.SoftwareUpdate ScheduleFrequency -int 1
# Disable smart quotes and smart dashes
defaults write NSGlobalDomain NSAutomaticQuoteSubstitutionEnabled -bool false
defaults write NSGlobalDomain NSAutomaticDashSubstitutionEnabled -bool false
# Disable system-wide resume
defaults write com.apple.systempreferences NSQuitAlwaysKeepsWindows -bool false
# Enabling full keyboard access for all controls (enable Tab in modal dialogs, menu windows, etc.)
defaults write NSGlobalDomain AppleKeyboardUIMode -int 3
# Disabling press-and-hold for special keys in favor of key repeat
defaults write NSGlobalDomain ApplePressAndHoldEnabled -bool false
# Setting a blazingly fast keyboard repeat rate
defaults write NSGlobalDomain KeyRepeat -int 0
# Disable auto-correct
defaults write NSGlobalDomain NSAutomaticSpellingCorrectionEnabled -bool false
# Setting trackpad & mouse speed to a reasonable number
defaults write -g com.apple.trackpad.scaling 2
defaults write -g com.apple.mouse.scaling 2.5
# Disable keyboard from automatically adjusting backlight brightness in low light
sudo defaults write /Library/Preferences/com.apple.iokit.AmbientLightSensor "Automatic Keyboard Enabled" -bool false
# 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
# Show hidden files in Finder by default
defaults write com.apple.Finder AppleShowAllFiles -bool true
# Show dotfiles in Finder by default
defaults write com.apple.finder AppleShowAllFiles TRUE
# Show all filename extensions in Finder by default
defaults write NSGlobalDomain AppleShowAllExtensions -bool true
# Show status bar in Finder by default
defaults write com.apple.finder ShowStatusBar -bool true
# Display full POSIX path as Finder window title
defaults write com.apple.finder _FXShowPosixPathInTitle -bool true
# Disable the warning when changing a file extension
defaults write com.apple.finder FXEnableExtensionChangeWarning -bool false
# Use column view in all Finder windows by default
defaults write com.apple.finder FXPreferredViewStyle Clmv
# Avoid creation of .DS_Store files on network volumes
defaults write com.apple.desktopservices DSDontWriteNetworkStores -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
# Allowing text selection in Quick Look/Preview in Finder by default
defaults write com.apple.finder QLEnableTextSelection -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
# Fuck-off all the Dock icons
defaults write com.apple.dock persistent-apps -array
# Setting the icon size of Dock items to 36 pixels for optimal size/screen-realestate
defaults write com.apple.dock tilesize -int 36
# 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
# 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
# Disabling the annoying backswipe in Chrome
defaults write com.google.Chrome AppleEnableSwipeNavigateWithScrolls -bool false
defaults write com.google.Chrome.canary AppleEnableSwipeNavigateWithScrolls -bool false
# Disable automatic emoji substitution in Messages.app? (i.e. use plain text smileys)
defaults write com.apple.messageshelper.MessageController SOInputLineSettings -dict-add "automaticEmojiSubstitutionEnablediMessage" -bool false
# Disable smart quotes in Messages.app? (it's annoying for messages that contain code)
defaults write com.apple.messageshelper.MessageController SOInputLineSettings -dict-add "automaticQuoteSubstitutionEnabled" -bool false
# Kill affected systems
killall Finder
killall Dock

Setting up a new Mac the Hacker way

Last updated: August 2015

Formatting

  1. Restart with + R
  2. Erase drive, 3x rewirte in second-hand
  3. Reinstall OS X

First Boot

Command Line

Run the attached bash script and restart.

Homebrew

Install Homebrew and then run:

sudo chown $USER /usr/local
brew doctor
brew update
brew install zsh

Git

Follow the instructions to download and configure Git: Github: Install and configure git

Additional Configurations:

git config --global core.editor "atom --wait"

ZSH Configuration

Download and install ZSH - Official Repository

Download in the user root the repository https://github.com/albertorestifo/dotfiles

NPM

Install nvm

Configure nvm and install basic globals

nvm install iojs
nvm use iojs
nvm alias default iojs
npm install -g peerflix bower gulp

Ruby

Install latest version of Ruby. Only do that once the .zshrc file has been sourced correctly.

brew install ruby
gem update --system
gem install sass
gem install git-up

Redis and MongoDB

brew install redis

Folllow MongoDB Installation instructions

Dock

The following app live in the dock in order:

  • Finder
  • Settings
  • Popcorn Time
  • iMessage
  • iWriter
  • Spotify
  • Feedly
  • Sunrise Calendar
  • Chrome
  • Chrome Canary
  • Firefox Developer Editon
  • Chrome App Launcher
  • iTerm
  • Atom
  • Slack
  • Sketch
  • Photoshop
  • Illustrator
  • Bridge
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment