About once a year, my machine gets pretty sluggish and it's time to start fresh. Here's the process I use to update it with everything I need.
TODO: Add info about dotfiles set up and zsh (possible settings file?)
- Save all dotfiles to a repo for easy transfer
- Back up all photos, music, apps, iTunes library, keychains, etc.
- Deauthorize iTunes and Photoshop.
- Deactivate CleanMyMac 3 license.
- 1Password, Dropbox, Evenote sync
- Get a list of currently install brew packages and casks:
brew list
- Get a list of installed App Store apps:
mas list
- Get a list of NPM packages:
npm list -g --depth=0
- Copy settings/preferences for any other apps in a safe place (IDE, Adobe apps, key bindings, FTP favorites, email account info, app licenses/serials, browser bookmarks, etc. etc. etc.)
When you're ready to take the plunge:
- Restart your Mac from the Apple menu and hold down Cmd+R as soon as the reboot starts
- Click on Disk Utility then Continue first of all to get your Mac's hard drive wiped. Select your startup drive on the left (typically Macintosh HD), switch to the Erase tab and choose Mac OS Extended (Journaled) from the Format drop-down menu. Select Erase and then confirm your choice.
- Quit out of the Disk Utility app, and this time choose Reinstall OS X and Continue. Follow the instructions that appear on screen, license agreements and all, and choose the hard drive to use (in most cases it'll be the only one available). Along the way you can sign in with your Apple credentials to get your apps and iCloud links back again.
2. Install XCode and Command Line Tools
- Open the App Store and search for XCode
- Open XCode after it finishes installing and accept the "Terms of Service"
- Install Command Line Tools:
sudo xcode-select --install
- or visit the link for Command Line Tools
# Show hidden files
defaults write com.apple.finder AppleShowAllFiles -boolean true
killall Finder
# Show the ~/Library folder
chflags nohidden ~/Library
# Finder: show all filename extensions
defaults write NSGlobalDomain AppleShowAllExtensions -bool true
# Disable the warning when changing a file extension
defaults write com.apple.finder FXEnableExtensionChangeWarning -bool false
# Show Path bar in Finder
defaults write com.apple.finder ShowPathbar -bool true
# Show Status bar in Finder
defaults write com.apple.finder ShowStatusBar -bool true
# Show absolute path in finder's title bar.
defaults write com.apple.finder _FXShowPosixPathInTitle -bool YES
# Symlink directories with parentheses
# https://stackoverflow.com/a/39029259
# cd to your home folder and create a symlink of the directory that has the parentheses:
ln -s '/Users/username/Dropbox (Personal)/' DropboxPersonal
# Change screenshots from PNG to JPG
defaults write com.apple.screencapture type jpg
killall SystemUIServer
# Specify a directory for screenshots
# https://twitter.com/sarah_edo/status/802545188279197696
# Use symlink created above if directory has parentheses
defaults write come.apple.screencapture location ~/screenshot-directory-path
killall SystemUIServer
# Use plain text mode for new TextEdit documents
defaults write com.apple.TextEdit RichText -int 0
Other commands for preferences here.
Many apps can be installed through Homebrew, homebrew-bundle, and mas-cli which makes the process way simpler.
This will clone and install Homebrew. This includes Homebrew-Cask now.
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
After installing git, set your user info. Then, enable Git password caching
git config --global user.name "Your Name Here"
git config --global user.email [email protected]
git config --global credential.helper osxkeychain
Visit GitHub's official guide for instructions. Visit git-scm.com for more info on first time git setup. Visit pksunkara/config for a good sample config.
Be sure to set proper permissions for your /home/<user>
, ~/.ssh
, and ~/.ssh/authorized_keys
, or you'll get a "Permission denied (publickey)." error:
chmod go-w ~/
chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keys
If you saved your dotfiles, now is the time to install them on your clean machine.
7. If not already part of your dotfiles, create a Brewfile
or brew.sh
or clone/modify the one below.
cd ~/ && curl -O https://gist.githubusercontent.com/germanny/7642823/raw/a500b112cd769835796e5531e2bb95f233ff5723/brew.sh
sh brew.sh
To install or update nvm, you can use the install script using cURL:
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash
Open a new terminal window to start using NVM.
To download, compile, and install the latest release of node, do this:
nvm install node
And then in any new shell just use the installed version:
nvm use node
Or you can just run it:
nvm run node --version
When you install node.js, npm is automatically installed. However, npm gets updated more frequently than Node.js, so be sure you have the latest version.
To test, run npm -v
and compare to latest release.
To update, run:
npm install npm@latest -g
Then install global packages:
npm install -g live-server npm npm-check-updates npx prettier
Node versions older than 15 do not work on Apple silicon machines (ARM) because ARM architecture is not supported. To install versions of Node < v15, you will need to install Node using Rosetta 2:
- In Applications, right-click on Terminal.app
- Click Get Info.
- Check "Open using Rosetta".
- Restart Terminal.
Now you will able to install any version of node (even multiple versions).
Follow the Installation guide to install the command-line interface for WordPress.
See also CLI Handbook
My current preferred color scheme: https://draculatheme.com/
My previous color scheme:
cd ~/ && curl -O https://raw.githubusercontent.com/germanny/OSX-Terminal-Monokai-Dark-Theme/master/Monokai%20Dark.terminal && open ./Monokai%20Dark.terminal
Open Terminal > Preferences (or CMD + ,) and select "Default" to make your new theme the default theme
10. Log into NPM registry
$ npm config set registry https://registry.npmjs.org/
$ npm login --registry=https://registry.npmjs.org/
11. Install Alfred Workflows
Many of these no longer work on Macs with the silicon chip, but here's the list anyway.
Caffeine toggle- Caffeinate
- CanIUse
- CircleCI
- Colors
- Dash
- Domainr
- Eject Disks.
- Emoji
- Encode/Decode
- Faker
- Font Awesome
- GitHub
- iOS Simulator
- IP Address
- Kill Process
- Open with Sublime Text
- Package Managers
- Shorten URL
- Transmit Favorites
- Unicode Symbols Search
Can use Alfred Workflow Searcher to get many of these.
This process has been borrowed from here, here, here, here, here, here, and of course, here.