Macbook Setup
Follow the guide below to set up your new Macbook with necessary
tooling and other interesting packages. The content below is a dump from my personal notes wherein I attempted to keep my new Macbook deterministic (without using NixOS) by logging everything that I was installing, configuring and removing from the system. This is NOT a prescriptive guide, rather a collection of good suggestions - choose what fits you best. Have fun!
If any instruction is outdated or incorrect or if you have suggestions for a new entry, please open a PR here (under "page-src/notes").
Get started
- Set the keyboard from "System Preferences" - use Tab as "Ctrl" key.
- Set the keyboard from "System Preferences" - use English ABC Extended (or your preferred language).
- Clean up the desktop menu - remove stuff you don't need.
- Log in to the App Store with your new or existing Apple ID.
- Open Settings and update the computer name for access by outsiders. Something like "my-name.local" is recommended.
- Enable ssh as well.
Install brew:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Ensure brew is updated:
brew update brew tap homebrew/cask-versions brew upgrade
Install browsers
- Open Safari and install Firefox and/or Brave browsers.
- (Optional but not recommended) Install Chrome Dev with
brew install --cask google-chrome-dev
. - Install Tor Browser with
brew install tor
.
SSH Keys
Set up SSH keys as follows:
ssh-keygen -t ecdsa -b 521 -N '' -f ~/.ssh/id_ecdsa
ssh-add ~/.ssh/id_ecdsa
Optionally, if you need to add the public key to a host, run:
ssh-copy-id -f -i path/to/pubkey username@remote_host
Also, add ssh pub keys to Gitlab and/or Github. Don't forget to backup the private key safely.
Set up Git & other useful tooling
- First, install GNU Stow with
brew install stow
. mkdir -p ~/Workspace ~/Workspace/work ~/Workspace/play ~/Workspace/vendor
cd ~/Workspace/play
git clone https://github.com/bitsofparag/dotfiles.git
Symlink the git config files from the just-downloaded dotfiles repo:
dotfiles=/path/to/dotfiles stow -d $dotfiles -nvt ~ gitconfig # dry run stow -d $dotfiles -vRt ~ gitconfig
- Install git extras with
brew install git-extras
. See commands here. - Install fancy diffing with
brew install diff-so-fancy
. - Install fancy quick-to-read man pages utility with
brew install tldr
. - Install Cookiecutter with
brew install cookiecutter
. - (Optional) Install updated Gem from brew with
brew install gem
. Make sure the correct ruby version is picked up in $PATH. Normally brew installsgem
in/usr/local/opt/ruby
. - If you installed the ri docs as well, then remove all docs with
rm -r "$(gem env gemdir)"/doc/*
. - (Optional) Install Fastlane with
gem install --user-install fastlane -NV
. - Install make essentials with
brew install pkg-config automake
. - Install jq with
brew install jq
. - Install yq with
brew install yq
.
Shell setup
There are many good terminal emulators out there, such as ZSH, Fish, xTerm etc. Choose what you're most comfortable with. This guide will set up ZSH on top of iTerm2.
- Open Terminal and install
brew install --cask iterm2
. - Open
iterm2
and set to zsh by:chsh -s /bin/zsh
. Check
$PATH
. It should be something like/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
- Remove
/etc/paths
file. - Install a good, legible font. IBM Plex Mono and Jetbrains Mono are two of my favorites. Set the iTerm font as well.
- Install "Oh My Zsh" -
sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
. Install syntax highlighting plugin:
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git \ ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
Similarly, install and activate zsh autosuggestions:
git clone https://github.com/zsh-users/zsh-autosuggestions \ $ZSH_CUSTOM/plugins/zsh-autosuggestions
- Install fzf.
- Install fzf keybindings -
/usr/local/opt/fzf/install
. Symlink zsh config files with functions
stow -d $dotfiles -vRt $HOME zsh cat <<EOF > $HOME/.zshenv source $HOME/.zshenv.common EOF cat <<EOF > $HOME/.zshrc source $ZSH/oh-my-zsh.sh source ~/.zshrc.common EOF
- Install bat to replace cat:
brew install bat
. - Install CMatrix for fancy
clear
command (which should be aliased already in the dotfiles; see step 21.) - Install tree with
brew install tree
. - Install fswatch with
brew install fswatch
.
Node and NPM setup
I am not a big fan of NPM. But sometimes I have to use NPM in order to collaborate with other devs or run node packages. Therefore, to prevent me from hurling the laptop at the wall, I chose to work with pnpm and Volta - keeps things sane and simple. Alternatives to them would be either NVM or n.
Install Volta via brew:
curl https://get.volta.sh | bash
. The installation will automatically add entries to the shell profile, like so:export VOLTA_HOME="$HOME/.volta" export PATH="$VOLTA_HOME/bin:$PATH"
Install the lts and the latest versions of node:
volta install node@lts # installs lts volta pin node@lts volta list
- Install Deno with
brew install deno
. - Install pnpm with
curl -f https://get.pnpm.io/v6.16.js | node - add --global pnpm
. (Optional) Install global packages:
pnpm add -g @storybook/cli \ eslint \ js-beautify \ prettier \ import-js \ http-server \ typescript typescript-language-server \ dockerfile-language-server-nodejs \ bash-language-server \ @cloudflare/wrangler \ semver
Check the packages installed globally:
pnpm ls -depth=0 -g
(If n is installed) If you have other node versions, copy the same packages over with:
n install <version> --reinstall-packages-from=<prev version>
Pyenv setup
- Install with
brew install pyenv pyenv-virtualenv
Install updated python3 version with
pyenv install 3.10.2
. It should show the following output:Installing Python-3.10.2... python-build: use readline from homebrew python-build: use zlib from xcode sdk Installed Python-3.10.2 to /Users/parag/.pyenv/versions/3.10.2
- Set up python3 globally with
pyenv global 3.10.2
. Install some commonly used packages with pip:
pip install ansible 'python-lsp-server[all]' \ requests 'ptvsd>=4.2' flake8 autoflake \ importmagic epc
Rust setup
Taken from here.
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
To uninstall, run rustup self uninstall
cargo install cargo-edit cargo install cargo-audit cargo install cargo-outdated rustup component add rustfmt rustup component add clippy
To learn Rust with Rustlings, install as follows:
curl -L https://git.io/install-rustlings | bash -s ~/Workspace/vendor/rustlings
Or you can also learn on Repl.it
Golang setup
- Install golang with
brew install go
. Set the go workspace with
$GOPATH
. This should already be set from the shell setup above. If not, then:export GOPATH=$HOME/Workspace/vendor/go
Other languages
- Nim setup
- Install
choosenim
withcurl https://nim-lang.org/choosenim/init.sh -sSf | sh
- Nim should be available in the "$HOME/.local/bin" path (see personal dotfiles for path settings).
choosenim show
nimble install nimlsp
- Install
- C-C++ setup
- Ensure your emacs config is ready with correct C-C++ requirements.
- Install src code indexer RTags with
brew install rtags
.
Java setup
- Install java on Catalina with
brew tap AdoptOpenJDK/openjdk && brew install --cask adoptopenjdk8
. - Verify with
java -version
.
Emacs setup
Install emacs:
brew tap d12frosted/emacs-plus brew install emacs-plus brew linkapps emacs-plus # or ln -s /usr/local/Cellar/emacs-plus/26.3/Emacs.app/ /Applications
Install spacemacs:
git clone https://github.com/syl20bnr/spacemacs ~/.emacs.d
- Install Source Code font.
- Check out the develop branch:
cd ~/.emacs.d && git checkout develop
Symlink config files from your dotfiles: If using
stow
, then:dotfiles=path/to/dotfiles stow -d $dotfiles -vRt ~ emacs # links spacemacs and other dot configs stow -d $dotfiles -vRt ~/.emacs.d/private emacsd-private-snippets # links snippets stow -d $dotfiles -vRt ~/.emacs.d/private/local emacsd-private-local # links everything in local
If not using
stow
,ln -s $HOME/Workspace/play/dotfiles/.spacemacs $HOME/.spacemacs rm -rf $HOME/.emacs.d/private/snippets ln -s $HOME/Workspace/play/dotfiles/snippets $HOME/.emacs.d/private/snippets git checkout $HOME/.emacs.d/private/snippets/README.md
- Install iSpell for emacs with
brew install ispell
. - Install ag with
brew install ag
(for searching in emacs). - Install Pygments as a generic syntax highlighter.
Install Poppler, a PDF-rendering library with
brew install poppler
.Or open emacs and run
pdf-tools-install
- Install BasicTeX as the latex package with
brew install --cask basictex
.- Make sure
/Library/Tex/bin
is in the$PATH
. (With dotfiles, you should already have it so). - Update
tlmgr
withsudo tlmgr update --self
. Install additional latex packages with:
tlmgr install wrapfig capt-of catchfile tlmgr install dvipng titling hyphenat titlesec enumitem tlmgr install chemfig simplekv mhchem tlmgr install minted fvextra xstring framed # for minted
- Make sure
- Start emacs from the Applications.
- Enable markdown in
org-export-backends
(with Customize).
Postgres setup
- Install postgresql with
brew install postgresql
. - Start postgres (not as a background service) with
pg_ctl -D /usr/local/var/postgres start
. - Install TablePlus app (paid) as the GUI utility for all DBs with
brew install --cask tableplus
.
Devops setup
- Install aws-cli with
brew tap aws/tap && brew install awscli
. - Install AWS SAM:
brew tap aws/tap && brew install aws-sam-cli
. - Install aws session-manager-plugin with
brew install --cask session-manager-plugin
. You might need to manually run it once since the program is not verified. - Install Cloudman with
brew install dutchcoders/cloudman/cloudman
. - Set up Hashicorp tap for their products with
brew tap hashicorp/tap
. - Install Terraform with
brew install hashicorp/tap/terraform terraform-docs
. - Install Nomad with
brew install hashicorp/tap/nomad
. - Install Consul with
brew install hashicorp/tap/consul
. - Install Packer with
brew install hashicorp/tap/packer
. - Install Vault with
brew install hashicorp/tap/vault
. - Install Waypoint with
brew install hashicorp/tap/waypoint
. - Install Faas with
brew install faas-cli
. - Install Docker desktop for mac.
- Install Podman with
brew install podman
. - Install Virtualbox with
brew install --cask virtualbox
. - Install Vagrant with
brew install --cask vagrant
. - Install Gas Mask with
brew install --cask gas-mask
. - Install Postman app with
brew install --cask Postman
. - Install Parquet tools for AWS deser with
brew install parquet-tools
. - Install Skopeo with
brew install skopeo
. - Install Multipass with
brew install --cask multipass
. - Install xxh with
brew install xxh
. - Install dive with
brew install dive
.
Hardware and firmware setup
- Install Platformio with
brew install platformio
. More details on Platformio mode for emacs can be found here. - Install cask drivers
brew tap homebrew/cask-drivers
- Install USB to UART support
brew install --cask silicon-labs-vcp-driver
- Install protobuf for protobuf message compilations:
brew install protobuf
Password manager setup
- Install password managers:
brew install --cask keepassxc lastpass
. - If you installed keepassxc:
- open the app
- create a new password database (
.kbdx
) and save in Dropbox - set a new master password
- go to the app settings
- click on "Enable browser integration" and choose Firefox
- install the Firefox addon here
- go the addon settings and enable http connection (last option in the settings menu)
- this opens an authentication dialog where you enter the same details as in the app to enable autofill in browsers
Install Sketch app
Follow this link to download the app.
Mail setup
- Open Mail app and set up your accounts.
- Install Thunderbird with
brew install --cask thunderbird
. - If you use Protonmail, you'll need to add their Bridge app which sets up localhost as the IMAP and SMTP servers.
Music player setup
- Install Spotify app -
brew install --cask spotify
- Install Spotify CLI -
brew install shpotify
. - Log in to Spotify developer console and create an application.
- Note down the Client ID and Client Secret.
Create a new file in
$HOME/.shpotify.cfg
and enter the following:CLIENT_ID="<client id from 3 above>" CLIENT_SECRET="<client secret from 3 above>"
- Open Spotify app and play a song.
- Run
spotify next
from the command line. Or other commands from the cli. - Install Deezer with
brew install --cask deezer
. - Install Audius with
brew install --cask audius
.
Graphics software setup
- Install blender with
brew install --cask blender
.
Security setup
- Install Cryptomator for file encryption with
brew install --cask cryptomator
. - Install Lulu as the firewall to block unknown outgoing connections, with
brew install --cask lulu
. - Install Netiquette as a network tracker GUI utility:
brew install --cask netiquette
. - Install Oversight as webcam and mic monitoring utility:
brew install --cask oversight
. - Install Malwarebytes for malware detection with
brew install --cask malwarebytes
.
Wordpress and CMS setup
- Install Mamp with
brew install --cask mamp
.
Game development setup
- Install Unity package manager with
npm install -g openupm-cli
. Install Inkle Studio editor with
brew install --cask inky
.You can find the repo for developing Inkle games here.
Other useful utility packages:
- Install Glances with
brew install glances
. Run asglances
. - Install Dust - better du with
brew install dust
. Run asdust --reverse <folder>
. - Install Bottom with
brew install bottom
. Run withbtm --help
. - Install video player VLC with
brew install --cask vlc
. Install wireshark-like tool for the terminal (depends on go): [UPDATE 2021-02-13] Uninstalled
brew install termshark
See details on running it here.
Install a CI-Friendly tool for document a database, written in Go:
brew install k1LoW/tap/tbls
See details on running it here.
- Install MS Remote Desktop with
brew install --cask microsoft-remote-desktop
. - Install Spectacle app as the window manager with
brew install --cask spectacle
. - Install imageoptim-cli with
brew install imageoptim-cli
. - [REMOVED] Install iina as the movie player with
brew install --cask iina
. - (Optional) Install Zoom.us with
brew install --cask zoomus
. - Install Android File Transfer via the DMG file.
- Install inkscape with
brew install --cask inkscape
. - Install ADR Tools with
brew install adr-tools
. - Install Disk Usage/Free Utility (duf) with
brew tap muesli/tap && brew install duf
. - Install CSV query utility called q with
brew install q
. - Install Graphviz with
brew install graphviz
. - [REMOVED] Install All-in-one-messenger with
brew install --cask all-in-one-messenger
. - Install Video editing software, Openshot with
brew install --cask openshot-video-editor
. - Install Mailstudio app from their downloads page - https://mailstudio.app/
- Install ngrok with
brew install --cask ngrok
. - Install Bore with
cargo install bore-cli
. - Install livestreaming and screen recording tool OBS with
brew install --cask obs
. - Install imazing with
brew install --cask imazing
. - Install Dictionaries app with
brew install --cask dictionaries
. - Install Slack Desktop app with
brew install --cask slack
. - Install Alt Tab app with
brew install alt-tab
. - Install Signal desktop app with
brew install --cask signal
. - Install Telegram Desktop app with
brew install --cask telegram-desktop-beta
.