New Mac Setup
Table of Contents
Two large commands to pretty much automatically install everything I need on a new Macbook using Homebrew
Install homebrew #
To install homebrew enter this in terminal
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew tap homebrew/cask-versions
Note: if you find any failures with installation, or issues with a previously installed brew on a non-new machine, try running brew doctor
to see some ways to fix:
sudo chown -R $(whoami) /usr/local/share/zsh /usr/local/share/zsh/site-functions
chmod u+w /usr/local/share/zsh /usr/local/share/zsh/site-functions
brew install
#
This installs ‘formulae’ which are mostly CLI apps and tools like node
, kubectl
, etc.
These will usually be installed in a local homebrew folder with symbolic links placed in /usr/local/bin
Note: go through and remove any tools you know you wont need, e.g. specific node / postgres versions, before blindly copy/pasting/running the command
# necessary step if mongo is required
brew tap kong/kong
brew tap mongodb/brew
brew tap homebrew/cask-fonts
brew install brew-cask-completion certbot consul fastlane gnu-sed go google-java-format goplus gotests grpcurl helm hugo imagemagick jq kompose kong kubernetes-cli kustomize liquibase macos-term-size maven minikube mongodb-community mongodb-database-tools mysql node node@14 openjdk openjdk@8 openjdk@11 postgresql protobuf redis starship thefuck tree vault vegeta yq
brew install --cask
#
This installs full-blown, native MacOS programs (called ‘casks’)and places them in your Applications
folder
Before using this, you would have to go to the 1Password download page, the Alfred page, the Brave page individually, then download each of the applications, then open the .dmg
files and move them to the Applications
folder manually
All of that is now replaced with a single command (and maybe typing your password and hitting the enter key a few times)!!!
Note: go through and remove any applications you know you wont need, e.g. you might not need ALL of the IDEs and only need visual-studio-code
or you need intellij-idea-ce
instead of intellij-idea
(Ultimate).
brew install --cask 1password 1password-cli alfred amethyst anaconda android-studio beyond-compare blender boom-3d brackets brainfm brave-browser burp-suite calibre caffeine ccleaner chromium cleanmymac cyberduck dataspell diffmerge discord docker emacs evernote firefox flutter font-fantasque-sans-mono-nerd-font font-go-mono-nerd-font font-hack-nerd-font font-iosevka-nerd-font font-jetbrains-mono-nerd-font font-roboto-mono-nerd-font font-ubuntu-mono-nerd-font goland google-assistant google-cloud-sdk graphql-playground hacker-menu harmony hazel intellij-idea kitty odbc-manager plex-media-server postico postman pycharm rescuetime scroll-reverser send-to-kindle shellcheck steam studio-3t sublime-text unity-hub virtualbox visual-studio-code vlc vlc-webplugin vscodium warp waterfox webstorm ytmdesktop-youtube-music
Note: To avoid any permission errors when creating / removing conda environments, change the owner of ~/.conda
from root
to yourself:
sudo chown -R $USER ~/.conda
Additional Installs #
Maildev: npm install --global maildev
Running / tweaking installations #
- Run
brew services
to see what is currently running - MySQL
- Start with
brew services start mysql
- Connect with
mysql -u root
- To secure with a password, run
mysql_secure_installation
- Start with
- Postgres
- Start with
brew services start postgresql
- Connect with
psql postgres
- Start with
- Redis
- Start with
brew services start redis
- Connect with
redis-cli
- Start with
- Mongo
- Start with
brew services start mongodb/brew/mongodb-community
- Connect with
mongosh
- Start with
- Consul
- Start with
brew services start consul
- Connect with
consul
- Start with
- Java 11
sudo ln -sfn /usr/local/opt/openjdk@11/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk-11.jdk
Oh My ZSH #
OMZ is a great utility to configure the Z Shell (zsh) which has been shipping with newer Macs
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
After installation, open in a text editor (e.g. vi ~/.zshrc
), and refer to some of my configurations here
SSH Setup #
To do any meaningful work, you’ll probably need to setup your SSH key. I typically run the keygen and spam the enter key, choosing all the defaults, and then copy the key to paste wherever necessary (e.g. Gitlab, Github, store it in 1password, etc.)
# spam enter until you see the ASCII art
# auto copies public key for Gitlab / Github
ssh-keygen -t rsa -b 4096 -o -a 100 -f ~/.ssh/id_rsa -q -N '' && cat ~/.ssh/id_rsa.pub | pbcopy
# copy private key for 1Password
cat ~/.ssh/id_rsa | pbcopy
System Preferences #
- Displays
- Manually align external monitors
- Drag menu bar to monitor that will not ever be screen shared
- Mouse
- Scroll direction: Natural - ON (Need Scroll Reverser to fix)
- Secondary click - ON
- Smart zoom - ON
- Tracking speed - 7
- More Gestures: ALL ON
- Trackpad
- Tracking speed - 7
- Scroll & Zoom - ALL ON
- More Gestures - ALL ON
- General
- Appearance - DARK
- Show scroll bars - WHEN SCROLLING
- Click in the scroll bar to: JUMP TO THE SPOT THAT’S CLICKED
- Dock & Menu Bar
- Dock Size - 70%
- Dock Magnification - ON / MAX
- Remaining dock settings - ALL ON
- Menu Bar - ALL OFF
- Mission Control
- Hot Corners
- Top Left - Launchpad
- Top Right - Notification Center
- Bottom Left - Mission Control
- Bottom Right - Quick Note
- Hot Corners
- Language & Region
- Add Hindi
- Notifications - TURN OFF ALL
- Sound
- Play user interface sound effects – OFF
- Show Sound in menu bar – ALWAYS
- Touch ID
- Register additional fingers to make logging in / security checks easier (at least both pointer fingers)
- Keyboard
- Modifier Keys
- Swap Caps Lock and Control Key (for all keyboards)
- Shortcuts > Spotlight - UNCHECK Show Spotlight search
- Input Sources
- Add languages:
- Devanagri - QWERTY
- Hindi
- Hindi (a -> अ)
- Show Input menu in menu bar - ON
- Add languages:
- NOTE: If input switcher doesn’t display in the menu bar, run the following command in Terminal:
sudo killall -9 PAH_Extension TextInputMenuAgent TextInputSwitcher
- Modifier Keys
Dock #
- Remove everything from the dock except for:
- Finder
- Launchpad
- Settings
- Add to the dock:
- Brave & Company Browser
- IntelliJ
- Goland
- VSCodium
- Postico
- Studio 3T
- Postman
- Warp
- Terminal
Finder #
- Open Finder > Finder Preferences (or
⌘,
)- General
- Show these items on the dekstop: Hard disks, External disks, CDs DVDs, and iPods – ON
- New Finder windows show: User folder
- Open folders in tabs instead of new windows – ON
- Sidebar
- Show these items in the sidebar – ALL ON
- Advanced
- Show all filename extensions – ON
- When performing a search – Search the Current Folder
- General
- Navigate to User’s home folder in Finder
- Turn on hidden files:
⌘⇧.
(⌘ + shift + .
) - Change to Icon View, then choose
... > Sort By > Snap to Grid
- Change to List View, right click > View Options
- Always open in list view – ON
- Browse in list view – ON
- Sort by: Date Modified
- Show columns:
- Date Modified
- Date Created
- Size
- Kind
- Tags
- Calculate all sizes – ON
- Click
Use as Defaults
- Change
Sort By
back to Name (just for this folder) and close View Options
App Setup #
Screenshots #
Move default location for screenshots from ~/Desktop to ~/Pictures/Screenshots
- Open the Screenshot app > Options > Save to – Other location
- Navigate to ~/Pictures and create a new folder named
Screenshots
- Choose this folder
Brave #
Pre-requisite: On old laptop, update Brave to latest version && start sync chain / copy chain code
- Add laptop to sync chain
- Regroup tabs
- Import “Better OneTab” (JSON file)
1Password #
- Login with both company / personal accounts
Alfred setup #
Pre-requisite: On old laptop, save alfred.preferences file (or sync with Dropbox, GDrive, Git), and load on new laptop
- Set command + space as shortcut
- See additional Alfred setup and config details in this post
Scroll Reverser #
Scrolling Axes:
- Reverse Vertical - ON
- Reverse Horizontal - ON
Scrolling Devices:
- Reverse Trackpad - OFF
- Reverse Mouse - ON
RescueTime #
Pre-requisite: RescueTime account
-
Launch RescueTime and log in.
-
Enable Security & Privacy > Accessibility > RescueTime
-
For each window, will have to approve RescueTime monitoring
-
Setup RescueTime Integrations
- Git integration
-
Create
.git_template/hooks
folder (I have mine in~/Programming/__mine/dotfiles/.git_template/hooks
) -
In the Git Integration page, copy the API Key, and add to your
.zshrc
file or your secret.zsh file:EXPORT RESCUETIME_API_KEY=pasteInApiKeyHere
-
Copy my post-commit file to your
.git_template/hooks
folder -
Make sure the
post-commit
file is executable:chmod +x git_template/hooks/post-commit
-
Edit your .gitconfig with a
[init]
section withtemplatedir
pointing to.git_template
folder:[init] templatedir = ~/Programming/__mine/dotfiles/git_template defaultBranch = master
-
- Git integration
-
Results:
- in every newly cloned git repo, it should have have the RescueTime hook added
- for existing repos, running
git init
should copy over the hook
Launchpad / Applications folder #
Mac Default #
- App Store
- Safari
- Contacts
- Calendar
- Reminders
- Notes
- Facetime
- Messages
- Maps
- Find My
- Mission Control
- Music
- Photo Booth
- Photos
- Podcasts
- TV
- Voice Memos
- News
- Stocks
- Books
- Dictionary
- Home
- Siri
Mac Util (renamed from Other) #
This has all of the “Other” default Mac apps (e.g. Terminal, Activity Monitor, Automator, Audio MIDI Setup, etc.)
CompanyName Bloatware #
This has any preloaded company specific software (e.g. VPN, App store, trackers, etc.)
M$ #
This has all Microsoft apps (e.g. Outlook, Word, Excel, Powerpoint, etc.)
No Folder #
- Calculator
- Preview
- System Pref
Browsers #
- Chrome
- Chromium
- Brave
- Firefox
- Min
- Waterfox
Database Tools #
- GraphQL Playground
- ODBC Manager
- Postico
- Studio 3T
Dev Tools #
- Beyond Compare
- Brackets
- Burp Suite Community Edition
- Cyberduck
- DiffMerge
- Docker
- Kitty
- Postman
- VirtualBox
- Warp
Efficiency & Productivity #
- 1Password
- Alfred
- Amethyst
- Caffiene
- Hazel
Entertainment #
- Blender
- Boom3D
- BrainFM
- Discord
- Harmony
- Plex
- Unity hub
- VLC
- Youtube Music Desktop App
- Snap Camera
- Steam
- iMovie
- Garage Band
- Logic
Graphics & Design #
- Adobe: Photoshop, XD, Illustrator, Lightroom Classic, Lightroom
Finance #
- Bitcoin
IDE #
- Anaconda
- Android Studio
- CLion
- Dataspell
- Emacs
- Goland
- IDLE
- IntelliJ IDEA
- Pycharm
- Python Launcher
- Sublime Text
- VS Code
- VSCodium
- Webstorm
Read #
- calibre
- Evernote
- Hacker Menu
- Send to Kindle
Util #
- CCleaner
- Clean My Mac
- Rescue Time
- Scroll Reverser
- Google Assistant
- Entrust
- Winzip
- Authy Desktop
- Tiny Stopwatch