A "dotfiles" approach can help you set up a new machine much faster and more importantly keep a consistent system environment. So I join this big dotfiles family! :3
- What is xxx does dotfiles? Please read Getting Started With Dotfiles.
- The dotfiles community is so big. Github keeps a good list in https://dotfiles.github.io/.
- Current OS: macOS High Sierra 10.13.3
- Dev dir:
~/dev
- Dotfiles dir:
~/dev/dotfiles
- App/package managers:
- Mac AppStore for apps
brew cask
for more appsbrew
for cli toolsnvm
to managenode
andnpm
rbenv
andbundler
to manageruby
pyenv
andpip
to managepython
- Cask apps in customized directory:
/Applications/Cask
nvm alias default
isdubnium
(neitherstable
norlts/dubnium
)- Keep
rdoc
andri
forgem install
, but not keep forgem update
tt
andgg
to print my stupid note for some Terminal commands.. update_appstore.sh
to update Mac apps from AppStore.. update_brew.sh
to update brew and cask apps.. update_npm.sh
to update npm and packages (stable, lts/*). backup.sh
to backup a list to brew_leaves.txt, brew_cask_list.txt and app_list.txt, etc.npm check -gu
for each npm version to interactively upgrade npm packages.
-
Make sure your internet connection is stable.
-
Change your computer name and local host name:
computer_name="EddiMBP" # replace with your preferred name sudo scutil --set ComputerName "$computer_name" sudo scutil --set LocalHostName "$computer_name" dscacheutil -flushcache
-
Install Xcode command line tools or app:
xcode-select --install # then click "Install" for CLT only or "Get Xcode" for full Xcode.app
-
Health check:
xcode-select -p # expect return: /Applications/Xcode.app/Contents/Developer gcc --version # check if git and "osxkeychain helper" are already installed git credential-osxkeychain # expect return: "usage:..."
-
Install Homebrew:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" brew doctor # may need to fix some problems brew update
-
Install Caskroom:
export HOMEBREW_CASK_OPTS="--appdir=/Applications/Cask" brew tap caskroom/cask brew tap caskroom/fonts brew update
-
If it is the first time you do dotfiles, click the nice Fork button in this repo.
-
If the dotfiles directory does not exist in your dev directory, clone your own dotfiles repo to your local machine in
~/dev/dotfiles
:my_git_username="Edditoria" # replace with your git username dotfiles_dir="$HOME/dev/dotfiles" # change it if your want mkdir -p $dotfiles_dir git clone https://github.com/$my_git_username/dotfiles.git $dotfiles_dir cd $dotfiles_dir && git remote -v && ls
-
Initial install dotfiles:
cd ~/dev/dotfiles source setup_dotfiles.sh source ~/.bash_profile
-
Initial config Git and GitLab:
source setup_git.sh
note: Something wrong when you add a SSH key to GitLab? Here is some information you need:
- Copy SSH key to clipboard:
pbcopy < ~/.ssh/id_rsa.pub
- Paste the key to this URL: https://gitlab.com/profile/keys
- Copy SSH key to clipboard:
-
Install homebrew formulae and cask apps:
source setup_homebrew.sh
-
Check your brew leaves and cask apps:
brew leaves brew cask list
-
Config cask apps, especially Evernote.
-
Install npm using nvm, and install packages for each npm:
source ~/.bash_profile nvm --version # check cd $DOTFILES && source setup_nvm.sh
-
Do some checking:
nvm ls # check node -v # check node $DOTFILES/test/test_node.js # open browser to see Hello World
-
Install Meteor.js :
curl https://install.meteor.com/ | sh
-
Check current Ruby environment:
exec $SHELL -l # restart shell as a login shell rbenv -v which ruby-build # /Users/Edditoria/.rbenv/shims/gem
-
Install Ruby versions:
cd $DOTFILES && source setup_rbenv.sh gem install nokogirl # troubleshoot if problem exists gem install rails rails -v # better to check manually
note: In my experience, Rails installation failed every single time. Different error may occur in the different version of rails in different MacOS. Sorry that you may need to investigate the error by yourself.
extra note: You still need to
be {command}
(alias ofbundle exec
) andrbenv rehash
manually.
-
Check the current Python environment:
exec $SHELL -l # restart shell as a login shell pyenv -v
-
Install Python versions:
cd $DOTFILES && source setup_pyenv.sh
-
Setup symlink to
~/dev
ln -s $DEV $HOME/dev
-
Add Novel_customized theme to Terminal.
source setup_terminal.sh
-
Manually setup npm packages, login items according to backup files.
-
Manually install apps that are not in caskroom nor Apple AppStore:
- PushBullet.app (fade out by official)
- Tuxera NTFS (bundled in Toshiba external hard drive)
-
Manually config notification center.
-
Check Accessibility in Security & Privacy.
- Merge my Evernote: Setup Dev Env 2014.
- Build checking system:
- Check dotfiles directory.
- Compare installed things, and monitor them.
- Compare updated packages in npm, brew and etc. (using private log).
- A maintenance session in README to includes:
- Backup npm and meteorjs
- Update Accessibility in Security & Privacy.
- Update Login Items in Users & Groups.
Copyright (c) Edditoria. All rights reserved. Code released under the MIT License. Docs released under Creative Commons.
As human-readable summary (but not a substitute for the license):
You can use it, share it, modify the code and distribute your work for private and commercial uses. If you like, please share your work with me. 🍕