# -----------------------------from file "alias2"-----------------------------
# alias is for shortening the full command
alias ls='ls --color=auto'
alias lsos='cat /etc/*release'
alias lsdisk='df -h'
alias lsmemory='free -h'
alias lsize='du -sh *|sort -h'
alias lsamd='rocm-smi --showproductname'
alias lsnv='nvidia-smi -q'
alias lsmount='findmnt -T .'
alias lsenv='python -m torch.utils.collect_env'
alias ls-cuda-cap='CUDA_VISIBLE_DEVICES=0 python -c "import torch; print(torch.cuda.get_device_capability())"'
alias ls-cuda-arch='python -c "import torch; print(torch.cuda.get_arch_list())"'
alias ls-cuda-memory-reserved='CUDA_VISIBLE_DEVICES=0 python -c "import torch; print(torch.cuda.memory_reserved(0))"'
alias ls-cuda-memory-allocated='CUDA_VISIBLE_DEVICES=0 python -c "import torch; print(torch.cuda.memory_allocated(0))"'
alias ls-cuda-memory-cached='CUDA_VISIBLE_DEVICES=0 python -c "import torch; print(torch.cuda.memory_cached(0))"'
alias ls-cuda-memory-free='CUDA_VISIBLE_DEVICES=0 python -c "import torch; print(torch.cuda.memory_free(0))"'
alias ls-cuda-memory-total='CUDA_VISIBLE_DEVICES=0 python -c "import torch; print(torch.cuda.memory_total(0))"'
alias ls-cuda-memory-max='CUDA_VISIBLE_DEVICES=0 python -c "import torch; print(torch.cuda.max_memory_allocated(0))"'
alias ls-cuda-memory-peak='CUDA_VISIBLE_DEVICES=0 python -c "import torch; print(torch.cuda.max_memory_reserved(0))"'
alias ls-cuda-memory-peak-allocated='CUDA_VISIBLE_DEVICES=0 python -c "import torch; print(torch.cuda.max_memory_allocated(0))"'
alias ls-cuda-memory-peak-cached='CUDA_VISIBLE_DEVICES=0 python -c "import torch; print(torch.cuda.max_memory_cached(0))"'
alias ls-cuda-memory-peak-free='CUDA_VISIBLE_DEVICES=0 python -c "import torch; print(torch.cuda.max_memory_free(0))"'
alias ls-cuda-memory-peak-total='CUDA_VISIBLE_DEVICES=0 python -c "import torch; print(torch.cuda.max_memory_total(0))"'
#-----------------this is for useful tools--------------------------
alias xr-cat="batcat"
alias rcat="lolcat"
alias xr-ps='ps auxf|peco' # process tree
alias xr-df='duf'
alias xr-pre-commit='pre-commit run --all-files'
alias xr-check-cuda='python -c "import torch; torch.zeros(1).cuda()"'
#-----------------this is for convinence----------------------------
alias pip='python -m pip'
alias pips='pip show'
alias pipi='pip install'
alias pipu='pip uninstall'
alias pipup='pip install --upgrade'
#-----------------this is for git-----------------------------------
alias gc='git clone'
alias gs='git status'
alias gl='git log'
# xr-sqush HEAD~2
alias xr-sqush='git rebase -i'
alias xr-init-submodule='git submodule update --init --recursive'
alias xr-update-submodule='git submodule update --remote --merge'
alias xr-unset-githook='git config --global --unset-all core.hooksPath'
alias xr-set-zhijiang-githook='git config --global core.hooksPath ~/.zhijiang/git_hooks'
#-----------------this is for cd-----------------------------------
alias ..='cd ..'
alias ...='cd ../..'
alias ~='cd ~'
alias -- -='cd -'
# -----------------------------end of file "alias2"-----------------------------
