Skip to content

Instantly share code, notes, and snippets.

@tchayintr
Last active July 11, 2025 04:33
Show Gist options
  • Select an option

  • Save tchayintr/af903fa46026a1cca2c246ba2ca5d0b8 to your computer and use it in GitHub Desktop.

Select an option

Save tchayintr/af903fa46026a1cca2c246ba2ca5d0b8 to your computer and use it in GitHub Desktop.
# Install Homebrew and prioritize linuxbrew binaries
mkdir ~/.linuxbrew && curl -L https://github.com/Homebrew/brew/tarball/master | tar xz --strip 1 -C ~/.linuxbrew
eval "$(~/.linuxbrew/bin/brew shellenv)"
brew update --force --quiet
chmod -R go-w "$(brew --prefix)/share/zsh"
echo -e "\n# linuxbrew" >> ~/.zshrc
echo eval '"$($HOME/.linuxbrew/bin/brew shellenv)"' >> ~/.zshrc
echo export 'PATH="$HOME/.linuxbrew/bin:$PATH"' >> ~/.zshrc
echo export 'BREW_PREFIX=$(brew --prefix)' >> ~/.zshrc
# Install Antidote
git clone --depth=1 https://github.com/mattmc3/antidote.git ${ZDOTDIR:-~}/.antidote
echo -e "\n# Antidote" >> ~/.zshrc
echo source '$HOME/.antidote/antidote.zsh' >> ~/.zshrc
echo 'antidote load' >> ~/.zshrc
echo PROMPT="'%n@%m %~ %# '" >> ~/.zshrc
# Install nvm and node
brew install nvm
echo -e "\n# nvm" >> ~/.zshrc
echo export 'NVM_DIR="$HOME/.nvm"' >> ~/.zshrc
echo '[ -s $HOMEBREW_PREFIX/opt/nvm/nvm.sh ] && \. $HOMEBREW_PREFIX/opt/nvm/nvm.sh' >> ~/.zshrc
echo '[ -s $HOMEBREW_PREFIX/opt/nvm/etc/bash_completion.d/nvm ] && \. $HOMEBREW_PREFIX/opt/nvm/etc/bash_completion.d/nvm' >> ~/.zshrc
nvm install --lts
nvm use --lts --default
# Install fzf
brew install fzf
echo -e "\n# fzf" >> ~/.zshrc
echo source '<(fzf --zsh)' >> ~/.zshrc
# Install miniconda
mkdir -p ~/miniconda3
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda3/miniconda.sh
bash ~/miniconda3/miniconda.sh -b -u -p ~/miniconda3
rm ~/miniconda3/miniconda.sh
source ~/miniconda3/bin/activate
conda init zsh
conda config --set auto_activate_base true
# Install common packages
brew install nvim
cat << 'EOF' >> ~/.zshrc
# Locale
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
# less command charset
export LESSCHARSET=utf-8
# bat
export BAT_THEME="ansi"
# pythainlp corpus
PYTHAINLP_DATA_DIR="$HOME/pythainlp-data"
# Alias
alias sl='ls'
alias ks='ls'
alias l='ls -lvhoX --color=auto'
alias ls='ls --color=auto'
alias ll='ls -alvhoX --color=auto'
alias rm='rm -i' # Remove Confirmation
alias htm='htop -u $(whoami)'
alias nvi='nvidia-smi'
alias nviw='watch nvidia-smi'
alias tmux='tmux -2' # tmux 256-color
alias t="tmux"
alias ta="t a -t"
alias tls="t ls"
alias tn="t new -s"
alias tk="t kill-session -t"
alias mux="tmuxinator"
alias condaa="conda activate"
alias condad="conda deactivate"
alias cprs="rsync -ah --inplace --no-whole-file --info=progress2"
alias cls=clear
alias ckear=clear
alias cls=clear
alias gpu="gpustat -cpu"
alias gpuw="gpustat -cpu --watch"
alias lvim="/usr/bin/vim"
alias dfm="df -h | grep yacht"
alias jpt="jupyter-lab --ip 127.0.0.1 --no-browser --port"
alias tbh="tensorboard --logdir . --port 6060"
alias tb="tensorboard --logdir $1 --port $2"
alias dfm="df -h | grep /dev/nvme0n1p2"
EOF
@tchayintr
Copy link
Author

To change from bash to zsh

chsh -s $(which zsh)

@tchayintr
Copy link
Author

Recommended .zsh_plugins.txt

# Bash
rupa/z

# OMZ plugins
getantidote/use-omz
ohmyzsh/ohmyzsh path:lib
ohmyzsh/ohmyzsh path:plugins/extract
ohmyzsh/ohmyzsh path:plugins/git

# OMZ Theme
ohmyzsh/ohmyzsh path:themes/simple.zsh-theme

# fish-like features
zsh-users/zsh-syntax-highlighting
zsh-users/zsh-autosuggestions
zsh-users/zsh-history-substring-search

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment