Personal setup for a new macOS install.
- Install the Xcode Command Line Tools
- Install Homebrew
- Install and set up Zsh
- Install GNU ls for better ls colors
- Install Emacs
- Install Go
- Install Node.js and npm
- Install MySQL
- Install PostgreSQL
- Install MongoDB
- Apps
- Git global configuration
- Set up Git SSH Keys
- Set up GPG Keys to sign commits
$ xcode-select -p # Check if the full Xcode package is already installed
$ xcode-select --install # Install Xcode Command Line Tools
Website: https://brew.sh
$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
More information on this wiki page from Oh-My-Zsh and this gist.
$ zsh --version # If installed, should be zsh 5.0 or more recent
$ echo $SHELL # Expected result should be /usr/bin/zsh or /bin/zsh
$ brew install zsh zsh-completions zsh-autosuggestions # Install zsh
$ zsh --version # Should be zsh 5.0 or more recent
$ chsh -s $(which zsh) # Make zsh the default shell
$ echo $SHELL # Expected result should be usr/bin/zsh or /bin/zsh
$ sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
$ curl https://gist.githubusercontent.com/imkh/db581924555a3a69f6be658a4c42d7bb/raw/d38d501bd9c9e60299d8fd96ac075873a8eacf44/refined-imkh --create-dirs -o $ZSH_CUSTOM/themes/refined-imkh.zsh-theme
And in ~/.zshrc
:
ZSH_THEME="refined-imkh"
$ brew install zsh-syntax-highlighting
And add this to the end of the ~/.zshrc
file:
# Add to end of the ~/.zshrc file
source /usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
In the .zshrc
file:
DISABLE_AUTO_TITLE="true"
function precmd () {
# window_title="\033]0;${PWD##*/}\007"
if [[ -n $SSH_CONNECTION ]]; then
window_title="\033]0;${USER}@${HOSTNAME%%.*}: ${PWD/#$HOME/~}\007"
else
window_title="\033]0;${PWD/#$HOME/~}\007"
fi
echo -ne "$window_title"
}
More information here:
- setting terminal tab title
- Set the title of the terminal window to the current directory
- Use PROMPT_COMMAND to set titles on iTerm tabs
GNU dircolors allows to use different colors theme when typing ls
in the terminal. More information here (make sure to read the quick note for macOS).
$ brew install coreutils
And add this alias in the ~/.zshrc
file:
alias ls="gls --color=auto"
$ brew install emacs
$ brew install go
$ brew install node
$ brew install mysql # Install MySQL
$ brew services list # List the Homebrew services
$ brew services start mysql # Start the MySQL service
$ mysql -uroot -p # Start a MySQL shell
$ mysqladmin -u root password 'yourpassword' # Change root password
Official guide: https://wiki.postgresql.org/wiki/Homebrew
$ brew install postgresql # Install PostgreSQL
$ brew services list # List the Homebrew services
$ brew services start postgresql # Start the PostgreSQL service
$ psql postgres # Start a PostgreSQL shell
Official guide: https://docs.mongodb.com/manual/tutorial/install-mongodb-on-os-x/
$ brew tap mongodb/brew
$ brew install mongodb-community@5.0 # Install MongoDB
$ brew services list # List the Homebrew services
$ brew services start mongodb-community@5.0 # Start the MongoDB service
$ mongosh # Start a MongoDB shell
Name | Description | Paid? | Settings |
---|---|---|---|
1Password | Password manager. | 💰 | |
Google Chrome | Web browser. | ||
Slack | Team communication app. | ||
Signal | Private messaging app. | ||
Spotify | Spotify desktop app. | ||
LyricsX | Synced lyrics app. | ||
MusicHarbor | New music release tracker. | 💰 | |
Magnet | Window manager. | 💰 | |
Moom | Windows layout manager. | 💰 | |
Wipr | Ad & tracker blocker for Safari. | 💰 | |
Amphetamine | Keep-awake app. | ||
Paste | Cloud clipboard history & snippets manager. | 💰 |
Name | Description | Paid? | Settings |
---|---|---|---|
Tower | Git desktop client. | 💰 | |
Kaleidoscope | File comparison app (diff tool). | 💰 | |
Paw | Full-featured HTTP client for API development (similar to Postman). | 💰 | |
iTerm2 | Terminal emulator for macOS. | Yes | |
Visual Studio Code | Source code editor. | Yes | |
Xcode | Official IDE for macOS, iOS, watchOS, and tvOS development. | ||
Android Studio | Official IDE for Android development. | ||
Docker | Create, deploy, and run applications by using containers. | ||
Sequel Pro | MySQL database management tool. | 💰 | |
Postico | PostgreSQL database management tool. | 💰 | |
Robo 3T | MongoDB database management tool. | ||
DB Browser for SQLite | SQLite database management tool. | ||
Red | Redis database management tool. | ||
Proxyman | Web Debugging Proxy app. | 💰 |
Name | Description | Paid? | Settings |
---|---|---|---|
Pixelmator Pro | Professional image editing tool. | 💰 | |
Parallels | Mac & Windows virtualization. | 💰 | |
IINA | Multimedia player. | ||
Discord | Voice & text chat app for gaming communities. | ||
Reflector | Android & iOS wireless screen mirroring. | 💰 | |
Tuxera | NTFS drives read and write support. | 💰 | |
CleanShot X | GIF recording and sharing. | 💰 | |
Sip | Color picker for macOS. | 💰 | |
LiveHome 3D | Home and Interior Design Software | 💰 | |
Ledger Live | Companion app for Ledger hardware wallet devices. | ||
Notion | The all-in-one workspace for your notes, tasks, wikis, and databases. | ||
Meta | Advanced Music Tag Editor for macOS. | 💰 | |
Cornerstone | SVN client for macOS. | 💰 | |
The Archive Browser | Browser for archive type files (zip, rar, 7-zip, tar, etc). | 💰 | |
Texpad | LaTeX editor. | 💰 | |
Leech | Lightweight download manager. | 💰 | |
Numi | Beautiful calculator app. | 💰 | |
Optimage | Advanced image optimization tool. | 💰 | |
SourceCodeSyntaxHighlight | Quick Look extension for highlight source code files. | ||
QLMarkdown | Quick Look extension for Markdown files. | ||
AppCleaner | Applications uninstaller. |
$ curl https://raw.githubusercontent.com/github/gitignore/main/Global/macOS.gitignore -o ~/.gitignore_global
$ git config --global user.name "John Doe"
$ git config --global user.email johndoe@example.com
$ git config --global core.editor emacs
$ git config --global core.excludesfile ~/.gitignore_global
🆕 With the new 1Password 8, we can generate & store SSH keys directly into 1Password. Follow the official guide instead of the instructions below.
Create a SSH config file:
$ touch ~/.ssh/config
And write in it:
# GitHub.com server
Host github.com
AddKeysToAgent yes
UseKeychain yes
IdentityFile ~/.ssh/id_rsa
# Private Enterprise GitLab server
Host <gitlab.company.com>
RSAAuthentication yes
IdentityFile ~/.ssh/id_rsa_gitlab_<company_name>
$ ls -al ~/.ssh # Lists the files in your .ssh directory, if they exist
$ ssh-keygen -t rsa -b 4096 -C "email@domain.com" # Generate a new SSH key
$ pbcopy < ~/.ssh/id_rsa.pub # Copies the contents of the id_rsa.pub file to your clipboard
Then paste the content of the clipboard in:
Download and install the GPG Suite from the official website.
$ gpg --full-gen-key
And follow the instructions. Recommended value for RSA keys is 4096 bits long (highest value). Pick a strong password when asked and type it twice to confirm.
$ gpg --list-secret-keys --keyid-format LONG <email_address>
# Copy the GPG key ID that starts with 'sec' and after 'rsa4096/'
$ gpg --armor --export <gpg_key_id> | pbcopy
Then paste the content of the clipboard in:
$ gpg --list-secret-keys --keyid-format LONG <email_address>
# Copy the GPG key ID that starts with 'sec' and after 'rsa4096/'
$ cd <your_git_project> # To associate GPG keys on a project-to-project basis rather than globally
$ git config user.signingkey <gpg_key_id>
$ git config commit.gpgsign true
Some helpful links:
$ git config --global gpg.program /usr/local/MacGPG2/bin/gpg2
$ echo no-tty >> ~/.gnupg/gpg.conf