The below information is current as of 2019-09-02 and applies to MacOS 10.14.x (Mojave).
This document is meant to serve as an aid and reference in preparing a MacOS system, the process and .dotfiles are completed manually. Note that the default Terminal is replaced with iTerm2 and Bash v5.
For additional information or help please feel free to ping via https://www.coreygo.com.
uptime
displays current system uptimesystem_profiler SPHardwareDataType
displays hardware overviewsystem_profiler -listDataTypes
lists available system_profiler optionssystem_profiler -detailLevel basic > ~/system_profile.txt
outputs to text document for sharing
Review the macOS Security and Privacy Guide and Stronghold.
- Set root password
sudo passwd -u root
- For Development (disable macOS Gatekeeper)
sudo spctl --master-disable
softwareupdate -l
sudo softwareupdate -iaR --verbose
- Set login screen message
sudo defaults write /Library/Preferences/com.apple.loginwindow LoginwindowText "coreygo.com"
- Disable screenshot drop shadow
defaults write com.apple.screencapture disable-shadow -bool true && killall SystemUIServer
- Hide Desktop
defaults write com.apple.finder CreateDesktop false && killall Finder
- Show All Files
defaults write com.apple.finder AppleShowAllFiles YES
- CMD+SHIFT+.
-
Set computer name (System Preferences → Sharing)
sudo scutil --set ComputerName "entropy" sudo scutil --set HostName "entropy" sudo scutil --set LocalHostName "entropy" sudo defaults write /Library/Preferences/SystemConfiguration/com.apple.smb.server NetBIOSName $(scutil --get LocalHostName)
-
Disable .DS_Store on network shares
defaults write com.apple.desktopservices DSDontWriteNetworkStores true
-
Speed up SMB client to Synology NAS by disabling packet signing
sudo -s echo "[default]" >> /etc/nsmb.conf echo "signing_required=no" >> /etc/nsmb.conf exit
-
Xcode Command Line Tools
xcode-select --install
-
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew config
-
brew tap caskroom/cask
brew tap caskroom/versions
brew tap caskroom/drivers
brew tap caskroom/fonts
brew tap homebrew/services
brew tap buo/cask-upgrade
(brew cu)brew install vitorgalvao/tiny-scripts/cask-repair
(cask-repair)
-
brew update-reset && brew update
brew upgrade && brew cu
brew cleanup -s
rm -rf $(brew --cache)
brew missing
andbrew doctor
andbrew config
brew uninstall {{package name}}
to uninstall a Homebrew packagebrew cask uninstall {{cask name}}
to uninstall a Homebrew cask packagebrew untap {{cask name}}
to untap a Homebrew cask
Post Install
cat << 'EOF' >> ~/.secrets # Set Homebrew's GitHub access token export HOMEBREW_GITHUB_API_TOKEN= EOF
Additional Post Install
cat << 'EOF' >> ~/.bashrc # Export Homebrew environment variables export HOMEBREW_FORCE_VENDOR_RUBY=1 export HOMEBREW_FORCE_BREWED_GIT=1 export HOMEBREW_FORCE_BREWED_CURL=1 # Set alias bup to update Homebrew alias bup="brew update-reset && brew update && brew upgrade && brew cu && brew cleanup -s && rm -rf $(brew --cache) && brew missing && brew config && brew doctor" EOF
-
brew search google
(includes formulae and casks)
-
Search installed fonts:
system_profiler SPFontsDataType | grep Fura
-
Search Homebrew fonts:
brew search /roboto/
-
Install (via brew or source): Fira Code, Hack, Nerd Fonts, Source Code Pro, Roboto, additional "cloud" fonts can be installed via the Adobe Creative Cloud app
brew cask install font-roboto
brew cask install font-firacode-nerd-font
brew cask install font-fira-code
brew cask install font-meslo-nerd-font
brew cask install font-sourcecodepro-nerd-font
brew cask install font-source-code-pro
-
Create ~/.bash_profile if needed and source ~/.bashrc
if [ ! -f ~/.bash_profile ]; then echo '[ -r ~/.bashrc ] && . ~/.bashrc' >> ~/.bash_profile; fi;
-
brew cask install iterm2-beta
or —brew cask install iterm2
Post Install
- Run iTerm2 then make it the default Terminal
- Install iTerm2 shell integration and utilities and update ~/.bashrc with tmux export
curl -L https://iterm2.com/shell_integration/install_shell_integration_and_utilities.sh | bash cat << 'EOF' >> ~/.bashrc # Enable iTerm2 Shell Integrations export ITERM_ENABLE_SHELL_INTEGRATION_WITH_TMUX=1 test -e "${HOME}/.iterm2_shell_integration.bash" && source "${HOME}/.iterm2_shell_integration.bash" EOF
- Change default profile: 160x48, Solarized Dark, Fira Code 14pt Regular (use ligatures, anti-aliased), Terminal.app compatibility
- Additional key mapping changes may be required for natural editing (like keyboard shortcuts for cursor movement in Terminal and vim)
⌥← # Send escape sequence b ⌥→ # Send escape sequence f ⌘←Delete # Send hex code 0x15 ⌥←Delete # Send hex code 0x1b 0x7f Del→ # Send hex code 0x4- ⌥Del→ # Send escape sequence d
-
brew install bash
Post Install
# Switch to using brew-installed bash as default shell if ! fgrep -q '/usr/local/bin/bash' /etc/shells; then echo '/usr/local/bin/bash' | sudo tee -a /etc/shells; chsh -s /usr/local/bin/bash; fi;
echo $BASH_VERSION
-
Set default language and source imports
cat << 'EOF' >> ~/.bashrc # Set Language export LANG="en_US.UTF-8" export LC_ALL="$LANG" # Imports test -e "${HOME}/.secrets" && source "${HOME}/.secrets" EOF
-
Set default editors
cat << 'EOF' >> ~/.bashrc # Set default editors export EDITOR="$(which vim)" export VISUAL="$EDITOR" # Set editors for Git and Homebrew export GIT_EDITOR="$EDITOR" export HOMEBREW_EDITOR="$EDITOR" EOF
-
brew install bash-completion@2
Post Install
cat << 'EOF' >> ~/.bashrc # Enable bash tab completion export BASH_COMPLETION_COMPAT_DIR="/usr/local/etc/bash_completion.d" [[ -r "/usr/local/etc/profile.d/bash_completion.sh" ]] && . "/usr/local/etc/profile.d/bash_completion.sh" EOF
-
Bash Static Analysis, Linting, and Testing
- ShellCheck
brew install shellcheck
- Bash Automated Testing System
brew install bats
- ShellCheck
-
brew install vim --with-override-system-vi --with-python3
-
brew install coreutils
Post Install coreutils (optional, will cause warning from
brew doctor
)# All commands have been installed with the prefix 'g'. # If you really need to use these commands with their normal names: cat << 'EOF' >> ~/.bashrc # Set local opt coreutils bin $PATH export PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH" EOF
-
brew install curl
Post Install curl
cat << 'EOF' >> ~/.bashrc # Set local opt curl bin $PATH export PATH="/usr/local/opt/curl/bin:$PATH" EOF
-
brew install diffutils
-
brew install findutils
or —brew install findutils --with-default-names
(optional, will cause warning frombrew doctor
) -
brew install gawk
-
brew install gnu-sed --with-default-names
-
brew install gnu-tar --with-default-names
-
brew install gnu-which --with-default-names
-
brew install gnutls
-
brew install grep --with-default-names
-
brew install gzip
-
brew install htop
-
brew install openssh --with-ldns
-
brew install rsync
-
brew install screen
-
brew install tmux
-
brew install tree
-
brew install watch
-
brew install wdiff
-
brew install wget
Post Install command line binaries
cat << 'EOF' >> ~/.bashrc # Set local system bin $PATH export PATH="$PATH:/usr/local/sbin" EOF
-
brew install nmap
— nmap — network mapper -
brew install youtube-dl
— youtube-dl -
brew cask install emacs
— emacsPost Install emacs (optional)
-
brew install pandoc
— pandoc -
brew install basictex
— basictexPost Install pandoc and basictex
sudo tlmgr update --self sudo tlmgr install collection-fontsrecommended
brew install librsvg
— librsvg
-
brew install git
-
brew install git-lfs
&&git lfs install
Post Install
git config --global user.name "Corey Gouker" git config --global user.email [email protected] git config --global user.signingkey F8189720240A11D1 git config --global github.user coreygo git config --global core.editor vim git config --global color.ui auto git config --global commit.gpgsign true git config --global credential.helper osxkeychain
Additional Post Install
cat << 'EOF' >> ~/.secrets # Set GitHub's hub user and access token # https://github.com/settings/tokens export GITHUB_USER=coreygo export GITHUB_TOKEN= EOF
- Google Chrome
brew cask install google-chrome-beta
or/and for side by side installation —brew cask install google-chrome
- Google Drive File Stream
brew cask install google-drive-file-stream
- Google Android File Transfer
brew cask install android-file-transfer
- Firefox Developer Edition
brew cask install firefox-developer-edition
or/and for side by side installation —brew cask install firefox
- Microsoft Edge Dev
brew cask install microsoft-edge-dev
- ProtonVPN
brew cask install protonvpn
- Tor Browser
brew cask install tor-browser
- OnionShare
brew cask install onionshare
- Magic-Wormhole
brew install magic-wormhole
- Bitwarden
brew cask install bitwarden
- 1Password
brew cask install 1password-beta
or for non-beta version —brew cask install 1password
- GPG Suite
brew cask install gpg-suite
- Irssi
brew install irssi
- Mosh
brew install mosh
- Tunnelblick
brew cask install tunnelblick
- Slack
brew cask install slack
- Discord
brew cask install discord
- Signal
brew cask install signal
- Keybase
(requires KEXT - System Preferences → Security & Privacy → General)brew cask install keybase
- Yubico YubiKey Manager
brew cask install yubico-yubikey-manager
- Yubico YubiKey Personalization GUI
brew cask install yubico-yubikey-personalization-gui
- WireShark
brew cask install wireshark
-
brew cask install visual-studio-code-insiders
or for non-Insiders build —brew cask install visual-studio-code
Post Install Visual Studio Code — Insiders (extensions list and settings information)
- To reinstall all extensions from a terminal
curl -fsSL https://git.io/fjpD1 | bash
-
brew cask install jetbrains-toolbox
-
brew cask install eclipse-installer
-
brew cask install postman
-
VirtualBox
(requires KEXT - System Preferences → Security & Privacy → General)brew cask install virtualbox
brew cask install virtualbox-extension-pack
-
brew cask install docker-edge
https://download.docker.com/mac/edge/Docker.dmg
or for stable —brew cask install docker
https://download.docker.com/mac/stable/Docker.dmg
Post Install (using stable or edge Docker Desktop for Mac)
etc=/Applications/Docker.app/Contents/Resources/etc ln -s $etc/docker.bash-completion $(brew --prefix)/etc/bash_completion.d/docker ln -s $etc/docker-machine.bash-completion $(brew --prefix)/etc/bash_completion.d/docker-machine ln -s $etc/docker-compose.bash-completion $(brew --prefix)/etc/bash_completion.d/docker-compose
- or if not using the "Docker Desktop for Mac" app (VirtualBox based install, not using the HyperKit hypervisor) consider installation using the non-cask formulae, details for this option have not been provided or tested
-
Kubernetes — (k8s docs)
Post Install (via edge release of Docker Desktop for Mac)
- Docker → Preferences → Kubernetes → check all three boxes to enable → Apply
- For kubectl bash completion
kubectl completion bash > $(brew --prefix)/etc/bash_completion.d/kubectl
-
brew install kubernetes-helm
-
brew install skaffold
-
brew cask install vagrant
-
brew install packer
-
brew install terraform
-
brew cask install now
-
brew install dnsmasq
Post Install
# Backup example dnsmasq.conf cp $(brew --prefix)/etc/dnsmasq.conf $(brew --prefix)/etc/dnsmasq.conf.example # Create and enable dnsmasq.d configuration directory mkdir -p $(brew --prefix)/etc/dnsmasq.d echo -e "\n# Include all files in a directory which end in .conf\nconf-dir=/usr/local/etc/dnsmasq.d/,-.conf" >> $(brew --prefix)/etc/dnsmasq.conf # Create and enable configuration(s) # Networking Note: 10.254.254.254 for Docker/K8s support, otherwise 127.0.0.1 echo -e "address=/.lo/fdff::1\naddress=/.lo/10.254.254.254" >> $(brew --prefix)/etc/dnsmasq.d/lo.conf echo -e "address=/local.coreygo.dev/fdff::1\naddress=/local.coreygo.dev/10.254.254.254" >> $(brew --prefix)/etc/dnsmasq.d/local.coreygo.dev.conf # Start dnsmasq with launchd now and restart at startup sudo brew services start dnsmasq # Create and enable DNS resolver(s) for dnsmasq sudo mkdir -p /etc/resolver sudo bash -c 'echo -e "nameserver ::1\nnameserver 127.0.0.1" >> /etc/resolver/lo' sudo bash -c 'echo -e "nameserver ::1\nnameserver 127.0.0.1" >> /etc/resolver/local.coreygo.dev'
- Create persistent lo0 alias
cat << 'EOF' | sudo tee -a /Library/LaunchDaemons/com.coreygo.lo0.plist <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>Label</key> <string>com.coreygo.lo0</string> <key>RunAtLoad</key> <true/> <key>ProgramArguments</key> <array> <string>bash</string> <string>-c</string> <string>/sbin/ifconfig lo0 alias 10.254.254.254 && /sbin/ifconfig lo0 inet6 alias fdff::1</string> </array> </dict> </plist> EOF
- Enable the launchd service to activate persistent lo0 alias
sudo launchctl load /Library/LaunchDaemons/com.coreygo.lo0.plist
- Mac App Store CLI
brew install mas
- Microsoft OneNote
mas install 784801555
(AppID for com.microsoft.onenote.mac)
- Transmission Remote GUI
brew cask install transmission-remote-gui
- ImageOptim
brew cask install imageoptim
- Keka
brew cask install keka
- CyberDuck
brew cask install cyberduck
- Radio Silence
brew cask install radio-silence
- OverSight
(requires KEXT - System Preferences → Security & Privacy → General)brew cask install oversight
Workaround for installer hang
- Open GUI and activate run in 'headless' mode
- LuLu
brew cask install lulu
- TaskExplorer
brew cask install taskexplorer
- KnockKnock
brew cask install knockknock
- ClamAV
brew install clamav
Review the (somewhat accurate) MacOS installation guide and FAQ for additional details before starting the process
- For latest definitions
freshclam -v
- For an on-demand directory/file scan
clamscan -r -i --bell ~/
- For an on-demand "complete" scan
clamscan -r -i --bell --cross-fs=no --detect-pua=yes /
- Open Broadcaster Software
brew cask install obs
Post Install
- OBS-NDI plugin
for streaming from networked systems
- Soundflower
for loopback audio from desktop output (requires KEXT - System Preferences → Security & Privacy → General)brew cask install soundflower
- Avidemux
brew cask install avidemux
- Kap
brew cask install kap
- VLC
brew cask install vlc
- Plexamp
brew cask install plexamp
- MusicBrainz Picard
brew cask install musicbrainz-picard
Post Install
brew install flac mp3gain
- MusicBrainz Picard Preferences → Plugins → Install ReplayGain → Enable → Make It So
- Path to metaflac
/usr/local/bin/metaflac
- Path to mp3gain
/usr/local/bin/mp3gain
- XLD
brew cask install xld
- Calibre
brew cask install calibre
Post Install
- Amazon Kindle
brew cask install kindle
Post Install
chmod -x /Applications/Kindle.app/Contents/MacOS/renderer-test
- Adobe Digital Editions
brew cask install adobe-digital-editions
- Adobe Creative Cloud
brew cask install adobe-creative-cloud
Post Install
open '/usr/local/Caskroom/adobe-creative-cloud/latest/Creative Cloud Installer.app'
- RealVNC Viewer
brew cask install vnc-viewer
- Microsoft Remote Desktop
brew cask install microsoft-remote-desktop-beta
- TeamViewer
brew cask install teamviewer
- ZoomUS
brew cask install zoomus
-
export NVM_DIR="$HOME/.nvm" && ( git clone https://github.com/nvm-sh/nvm.git "$NVM_DIR" cd "$NVM_DIR" git checkout `git describe --abbrev=0 --tags --match "v[0-9]*" $(git rev-list --tags --max-count=1)` ) && \. "$NVM_DIR/nvm.sh"
Post Install
cat << 'EOF' >> ~/.bashrc # Enable Node Version Manager export NVM_DIR="$HOME/.nvm" [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion EOF
source ~/.bashrc
or restart terminal session
NVM Default Global Packages
cat << 'EOF' >> "$NVM_DIR/default-packages" create-react-app eslint gatsby-cli gulp-cli netlify-cli npm npm-check prettier terser tslint typescript EOF
NVM Manual Upgrade
( cd "$NVM_DIR" git fetch --tags origin git checkout `git describe --abbrev=0 --tags --match "v[0-9]*" $(git rev-list --tags --max-count=1)` ) && \. "$NVM_DIR/nvm.sh"
-
Node.js — via NVM
nvm install lts/*
for latest active LTS Node or for a specific versionnvm install v10.16.3
nvm install lts/* --reinstall-packages-from=node
install latest active LTS Node and reinstall packages from current Nodenvm version-remote lts/-
display latest available LTS Node versionnvm ls-remote --lts
list latest available LTS Node versionsnvm install node --reinstall-packages-from=node
install latest non-LTS Node and reinstall packages from current Node
Global Node.js Packages
npm i -g eslint npm npm-check prettier terser tslint typescript
npm ls -g --depth=0
display top level global packagesnvm_npm_global_modules $(nvm current)
display top level global packages via NVMnpm-check -gu
check for and/or install latest global packages
Additional Global Node.js Packages
npm i -g create-react-app gatsby-cli gulp-cli netlify-cli
brew install yarn
note, will currentlybrew install node
as a dependency
-
Python — review additional details prior to installing Python via Homebrew to avoid potential issues.
brew install python
or/and for Python 2 —brew install python@2
Post Install (optional, will supersede system Python and python@2)
cat << 'EOF' >> ~/.bashrc # Set Python 3 $PATH export PATH="/usr/local/opt/python/libexec/bin:$PATH" EOF
-
brew install pipenv
Post Install for pipenv
cat << 'EOF' >> ~/.bashrc # Set Python 3 pipenv to create .venv in project path export PIPENV_VENV_IN_PROJECT=true EOF
mkdir -p {{project name}} && cd "$_"
to create a new Python project directory andpipenv install
to create a new pipfile and virtualenv thenpipenv shell
to activate the virtualenv, you are now ready topip3 install {{package name}}
(use pip3 to avoid issues), and remember to deactivate the shell withexit
- See
pipenv --help
or go here for advanced usage details - If Python 2 is required for pipenv and virtualenv usage
brew install python@2
, for a Python 2 projectpipenv install --two
, remember to review the Python via Homebrew link above before installing Python 2
-
Ruby — via rbenv, also review here for Rails and additional information
brew install rbenv
Post Install
rbenv init
cat << 'EOF' >> ~/.bashrc # Enable rbenv Ruby environment manager if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi # This loads rbenv EOF
source ~/.bashrc
or restart terminal sessionrbenv --version
curl -fsSL https://github.com/rbenv/rbenv-installer/raw/master/bin/rbenv-doctor | bash
rbenv install 2.6.3
or to list available versionsrbenv install -l
rbenv global 2.6.3
or to get current active versionrbenv global
ruby -v
gem env
for RubyGems environment detailsgem env home
check the location where gems are being installedgem outdated
andgem update --force
gem cleanup
gem install bundler
-
brew install go
Post Install
cat << 'EOF' >> ~/.bashrc # Go Language export PATH="$PATH:/usr/local/opt/go/libexec/bin" EOF
source ~/.bashrc
or restart terminal sessionbrew install dep
brew install gox
-
brew cask install java
-
brew cask install adoptopenjdk
- Processing
brew cask install processing
-
brew cask install google-cloud-sdk
Post Install
cat << 'EOF' >> ~/.bashrc # Enable Google Cloud SDK test -e "/usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/path.bash.inc" && source "/usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/path.bash.inc" test -e "/usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/completion.bash.inc" && source "/usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/completion.bash.inc" EOF
-
AWS CLI & Python SDK — first follow steps above to install Python 3 including pipenv via Homebrew
cd ~ && mkdir -p .aws && cd "$_" && pipenv install awscli boto3 && pipenv run aws --version
cd ~/.aws && pipenv run aws --version
to confirm the AWS CLI version, for help seepipenv run aws help
- or run a command like
aws configure
after activating the shellcd ~/.aws && pipenv shell
remember toexit
-
brew install azure-cli
az login
az help
brew cask install wacom-tablet
- ftdi-vcp-driver
brew cask install ftdi-vcp-driver
- OpenBCI GUI
brew cask install openbci-gui