Installing SF Mono

If you want to use the SF Mono font you can find it inside the Terminal app.

open /Applications/Utilities/Terminal.app/Contents/Resources/Fonts/

Disable GameKit

launchctl unload -w /System/Library/LaunchAgents/com.apple.gamed.plist

and

defaults write com.apple.gamed Disabled -bool true

Extract Audio from Youtube Videos

brew install youtube-dl
youtube-dl --ignore-errors -f mp4 https://www.youtube.com/watch?v=dQw4w9WgXcQ
afconvert -d aac input.mp4 output.m4a
				

If you want 1080p mp4 to be your default add the following line to ~/.config/youtube-dl/config.

-i -f 'bestvideo[height<=1080][ext=mp4]+bestaudio[ext=m4a]/best[height<=1080][ext=mp4]/best'

Disabling System Integrity Protection

To disable System Integrity Protection boot into the Recovery partition by pressing cmd+R at startup. Open Utilities > Terminal and run:

csrutil disable

Safari Enable Backspace

defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2BackspaceKeyNavigationEnabled -bool YES

Disable auto-correct

defaults write NSGlobalDomain NSAutomaticSpellingCorrectionEnabled -bool false

Remove Duplicates from the "Open With" Menu

/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -kill -r -domain local -domain user;killall Finder

Screencapture

Screenshot file format and change extension to lowercase

defaults write com.apple.screencapture type png

Screenshot name

defaults write com.apple.screencapture name ScreenShot

Screenshot Location

defaults write com.apple.screencapture location [path]

Turn Off Expose

defaults write com.apple.dock mcx-expose-disabled -bool false;killall Dock

Turn Off Dashboard

defaults write com.apple.dashboard mcx-disabled -boolean YES;killall Dock

Disable Notification Center

log out and log back in after

sudo defaults write /System/Library/LaunchAgents/com.apple.notificationcenterui KeepAlive -bool false

Remove Default Apps

sudo rm -rf /Applications/Chess.app
sudo rm -rf /Applications/DVD\ Player.app
sudo rm -rf /Applications/Stickies.app
sudo rm -rf /Applications/Launchpad.app

more nice Terminal tricks

Wakeup Reason

log show |grep -i "Wake reason"

gzip

tar -czf folder_name.tar.gz folder_name/

Open screen sharing

open vnc://computername.local

Enable screen sharing

sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.screensharing.plist

Open current folder in Finder

open .

Restart Finder

killall Finder

Restart Dock

killall Dock

Start a web server, publish the current directory

python -m SimpleHTTPServer
php -S 0.0.0.0:8000

Prevent Mac from falling asleep for an hour

caffeinate -u -t 3600

Network Monitor

lsof -ni -P

Display all locations of a binary

type -a git