Before doing anything, make sure you know what are you doing!
Before doing anything, make sure you know what are you doing!
Before doing anything, make sure you know what are you doing!
Settings applied by this repository are very personal and definitely not for everyone. I suggest to create your own set of dotfiles based on this repo.
If you are NOT Ernest Chiang, please fork it before doing anything, then modify it, then use it. Some files you need to modify to fit your cases:
- scripts/setup-macos.sh: ComputerName, HostName, LocalHostName, etc...
If you are Ernest Chiang, please follow it step by step.
- Make sure the macOS software is up to date:
sudo softwareupdate -i -a --restart
- Install Apple Xcode Command Line Tools:
xcode-select --install
- If you are using Apple Silicon (e.g M1), Install Rosetta:
softwareupdate --install-rosetta
- Install brew and brew install:
- It may require enter user password couple times in this step.
- It may spend coupld hours to install all the softwares.
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/dwchiang/dotfiles/master/scripts/setup-brew.sh)"
- Now, we can run iTerm2.
- Setup SSH.
Setup SSH and place personal keys at a right place for git clone on next step.
- Have a copy of
~/.ssh
- Make sure
~/.ssh/config
points the ssh key file to be able to access GitHub. Test method:ssh -vT git@github.com
- Clone this repo:
Clone it for future easier maintainance.
git clone git@github.com:dwchiang/dotfiles.git ~/.dotfiles
- Init & Setup macOS:
Init by installing Oh My Zsh, and setup macOS defaults.
Please remember to change the computer name
in ./scripts/setup-macos.sh
.
source ~/.dotfiles/scripts/init-macos.sh
source ~/.dotfiles/scripts/setup-macos.sh
- Setup symlinks:
Create symlinks for dotfiles (e.g. .zshrc
, .gitconfig
, etc).
- Edit your own
.gitconfig.local
which can be duplicated from.gitconfig.local.example
. - Edit your own
.aliases.local
which can be duplicated from.aliases.local.example
.
source ~/.dotfiles/scripts/setup-symlinks.sh
- After setting computer name.
System Preferences pane → Sharing applet → check the Remote Login checkbox. This will enable SSH, and in turn, SCP.
❯ scp -r ~/Pictures/Desktop\ Pictures dwchiang@10.0.0.115:"~/Pictures"
Advanced
>Set preferences folder...
(path = //(storage)/Sync/Alfrad)
- Set
Preferences
>General
>Preferences
>Load preferences from a custom folder or URL
.
❯ ln -is /Users/dwchiang/Dropbox/projects ~/projects
- Before using git commit.
- Run GPG Keychain and import key(s) into GPG Keychain.
- Reference: gpg —list-keys command outputs uid [ unknown ] after importing private key onto a clean install
gpg --list-secret-keys --keyid-format LONG
- GNUPG has a trust database stored at
~/.gnupg/trustdb.gpg
- backup this trust database:
gpg --export-ownertrust > file.txt
, import them later into a new environment, the trust database is no longer present. gpg --edit-key user@useremail.com
gpg> trust
-->Your decision? 5
-->gpg> save
- How to test:
echo "test" | gpg --clearsign
- Reference: 利用 GPG 簽署 git commit
brew install pinentry-mac
- Add
no-tty
into~/.gnupg/gpg.conf
- Add
pinentry-program /usr/local/bin/pinentry-mac
into~/.gnupg/gpg-agent.conf
killall gpg-agent
- Test again:
echo "test" | gpg --clearsign
- Using
pyenv
. - Ref: The right and wrong way to set Python 3 as default on a Mac
source ~/.dotfiles/scripts/setup-python.sh
- nvm is a version manager for node.js, designed to be installed per-user, and invoked per-shell. nvm works on any POSIX-compliant shell (sh, dash, ksh, zsh, bash), in particular on these platforms: unix, macOS, and windows WSL.
Install latest node.js version:
# Install latest version
nvm install node
# Install latest LTS version
nvm install --lts
# jEnv Configurations
export PATH="$HOME/.jenv/bin:$PATH"
eval "$(jenv init -)"
# ensure that JAVA_HOME is correct
jenv enable-plugin export
# make Maven aware of the Java version in use (and switch when your project does)
jenv enable-plugin maven
Find your JDK versions and locations:
/usr/libexec/java_home -V
Add the library you want:
jenv add <jdk_path>
# For example:
# jenv add /Library/Java/JavaVirtualMachines/openjdk-14.0.2.jdk/Contents/Home
# openjdk64-14.0.2 added
# 14.0.2 added
# 14.0 added
# 14 added
jenv versions
jenv <scope> <jdk-version>
# For example:
# jenv global 14.0
# jenv local 14.0
java -version
- Android Studio (installed by homebrew)
- Android SDK Location:
~/Library/Android/sdk
- Flutter SDK Location:
~/Library/flutter
ln -is /Users/___userNameHere___/Dropbox/Apps/Byword/notes ~/notes
# Launch it and back up your files
mackup backup
# Launch it and restore your files
mackup restore
- pawelgrzybek's dotfiles (https://github.com/pawelgrzybek/dotfiles)
- Mathias’s dotfiles (https://github.com/mathiasbynens/dotfiles)
- holman does dotfiles
- Paul Irish's dotfiles (https://github.com/paulirish/dotfiles)
- (中文) Amo Wu's dotfiles (https://github.com/amowu/dotfiles)
- zero.sh: Radically simple personal bootstrapping tool for macOS.
- apply-user-defaults is a small utility to set macOS user defaults declaratively from a YAML file.
- Homebrew Bundle