configuration files for various tools
- Include more other configurations such as vimrc
# install Homebrew
# In China, try: /bin/bash -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"
# or `git clone https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git /usr/local/Homebrew` and `echo 'export PATH="/usr/local/Homebrew/bin:$PATH"' >> ~/.zshrc`
# Refer: https://refblogs.com/article/748
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# install oh-my-zsh
/bin/sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
# install python3
brew install python3 Rust
pip3 install -U pip
pip3 install ansible
# after 2024, use brew to install ansible
brew install ansible
TIPS: run brew search <app>
to search formula in cask
, and then install it like brew install --cask adobe-acrobat-reader
First configure your global ansible hosts in /etc/ansible/hosts
, add two groups like this:
[all]
andyub
localhost
[mac]
localhost
[linux]
andyub
[dev]
andyub
Then run command like this to configure remote linux dev box: ansible-playbook linux.yml -K
.
If you don't want to input password for second run, just run ansible-playbook linux.yml -l dev --skip-tags sudo
.
For mac book: run command: ansible-playbook --connection=local mac.yml
under ansible/
folder
--connection=local
option is to fix error on mac: ssh: connect to host localhost port 22: Connection refused
ln -sf $(PWD)/vscode/user-setting.json "$HOME/Library/Application Support/Code/User/settings.json"
ln -sf $(PWD)/vscode/user-keybindings.json "$HOME/Library/Application Support/Code/User/keybindings.json"
ln -sf $(PWD)/vscode/flake8.ini "$HOME/.config/flake8"
ln -sf $(PWD)/vscode/pyproject.toml "$HOME/.config/pyproject.toml"
# ln -sf $(PWD)/vscode/golangci.yml "$(GOPATH)/.golangci.yml"
ln -sf $(PWD)/vscode/pycodestyle.ini "$HOME/.config/pycodestyle"
ln -sf $(PWD)/ansible/ansible.cfg ~/.ansible.cfg
ln -sf $PWD/vim/vimrc ~/.vimrc
ln -sf $PWD/tmux/tmux.conf ~/.tmux.conf
ln -sf $PWD/sh/zshrc ~/.zshrc
ln -sf $PWD/sh/common_profile.sh ~/.sh_profile
[[ -d ~/.profile.d ]] || mkdir ~/.profile.d
ln -sf $PWD/sh/functions.sh ~/.profile.d/function.sh
Install Karabiner-Elements
After installing, make sure to enable it both on general
and privacy
tab
Add mapping from caps_lock
to f10
, alsl switch command
and option
key for USB keyboard by adding mapping for that device
Install MenuMeters
Just run vim/setup_vim.sh
git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
# start tmux and then install plugins by pressing prefix + I (capital i, as in Install)
tmux
-
Add a new Profile called
Andy
and set it as default oneProfiles->Colors->Color Presets
: Loadcolor-scheme/base16-monokai.dark.256.itermcolors
and choose it -
Install powerline font
# clone
git clone https://github.com/powerline/fonts.git --depth=1
# install
cd fonts
./install.sh
# clean-up a bit
cd ..
rm -rf fonts
Then fix iterm2 following Profiles>Andy>Text>Font
to choose a font such as Noto Mono for Powerline
as discussed in this issue
- Install vscode extensions provided with the list with cli
for x in `cat vscode/ext.txt`; do code --install-extension $x; done
- Configure
black
for python formatter
# reference: https://black.readthedocs.io/en/stable/usage_and_configuration/the_basics.html#configuration-via-a-file
- Configure
Autocomplete and IntelliSense
for python
- Install Package Control
Open menu: View > Show Console menu, and then input the following script:
import urllib.request,os; pf = 'Package Control.sublime-package'; ipp = sublime.installed_packages_path(); urllib.request.install_opener( urllib.request.build_opener( urllib.request.ProxyHandler()) ); open(os.path.join(ipp, pf), 'wb').write(urllib.request.urlopen( 'http://sublime.wbond.net/' + pf.replace(' ','%20')).read())
NOTE: if that failed due to some dpendency issue such as openssl
issue, do that manually:
- download latest release from
https://github.com/wbond/package_control/releases
- rename it to Package Control.sublime-package
- place it to ST's Installed Packages directory (try
~/Library/Application Support/Sublime Text/
)
-
Manually install packages by
Package Control
for those listed in subl readme -
Configure sidebar for installed theme following subl readme
-
Configure user key mapping Use keymap.json
-
Configure user settings Use user-setting.json
- Change
Page Background
color inAccessibility
tab to RGB(246,245,216) - Enable
single-key accelerators
inGeneral
tab
- For python2, you can install
pyenv
, installv2.7.18
bypyenv install 2.7.18
, and configure this env with path like/Users/azhang/.pyenv/versions/2.7.18
.
- install mongodb community version
brew tap mongodb/brew
brew install mongodb-community@4.2
echo 'export PATH="/opt/homebrew/opt/mongodb-community@4.2/bin:$PATH"' >> ~/.zshrc