167 lines
4.1 KiB
Bash
167 lines
4.1 KiB
Bash
export PATH=/usr/bin:$PATH
|
|
alias rc="vi ~/.bash_aliases && tail ~/.bash_aliases && source ~/.bash_aliases"
|
|
alias up="down && docker compose up -d --remove-orphans && log"
|
|
alias down="docker compose down"
|
|
inspect() { docker image inspect "$@" | jq ; }
|
|
alias d="docker"
|
|
alias c="docker compose"
|
|
alias i="sudo apt-get install -y"
|
|
alias build="docker build ."
|
|
alias run="docker build . -t temp && docker run --network host --rm temp"
|
|
alias debian="docker run -it --rm --gpus all pytorch/pytorch:2.4.0-cuda12.4-cudnn9-devel bash"
|
|
check() { curl -x "localhost:$1" -k https://httpbin.org/ip; }
|
|
redis-lastsave() { redis-cli "$@" --raw lastsave | xargs -I{} date -d @{} "+%Y-%m-%d %H:%M:%S"; }
|
|
redis-dump() { sudo rsync -a /var/lib/redis/dump.rdb ~/.backup/dump.rdb-$(date +%Y%m%d); }
|
|
alias systemctl="sudo systemctl"
|
|
|
|
cd() { clear; echo "$(pwd)/$*"; echo; command cd "$@" && ls -lh --color=auto; echo; }
|
|
alias ip="ip -4"
|
|
|
|
alias my="sudo chown -R $(id -u):$(id -g)"
|
|
alias l="clear; pwd; echo; command ls -lh --color=auto"
|
|
alias ls="clear; pwd; echo; command ls -alh --color=auto"
|
|
|
|
alias make="make -j"
|
|
alias ns="watch -n 0.1 nvidia-smi"
|
|
log() {
|
|
if [ $# -eq 0 ]; then
|
|
docker compose logs -f
|
|
else
|
|
docker logs -f "$@"
|
|
fi
|
|
}
|
|
|
|
alias download="huggingface-cli download"
|
|
alias journal="sudo journalctl -u"
|
|
|
|
export GGML_CUDA=1
|
|
export LLAMA_CURL=1
|
|
|
|
export LD_LIBRARY_PATH="/usr/local/cuda/lib64:/usr/local/lib:$LD_LIBRARY_PATH"
|
|
export PATH="/home/w/.venv/bin:/home/w/hub/llama.cpp:/usr/local/cuda/bin:$PATH"
|
|
alias rsync="rsync -avPh"
|
|
alias wg="sudo wg"
|
|
alias dpkg="sudo dpkg"
|
|
alias service="sudo service"
|
|
alias apt="sudo apt-get"
|
|
|
|
alias chwon="sudo chown"
|
|
alias bsah="bash" # common typing error
|
|
alias pyhton="python" # common typing error
|
|
alias soruce="source"
|
|
alias stauts="status"
|
|
alias stuats="status"
|
|
|
|
# alias stauts="status"
|
|
# alias stuats="status"
|
|
|
|
dash() { sudo docker run -it --rm --gpus all --entrypoint=bash "$1"; }
|
|
|
|
alpine() {
|
|
docker run -it --rm alpine ash
|
|
}
|
|
|
|
dsh() { sudo docker run -it --rm "$1" sh; }
|
|
alias nuc="ssh 192.168.12.2"
|
|
alias mac="ssh jaewooklee@192.168.12.45"
|
|
alias ip="ip -4"
|
|
alias ping="ping -c 2"
|
|
|
|
diff() {
|
|
if [[ $# -eq 0 ]]; then
|
|
clear
|
|
git status
|
|
echo
|
|
echo
|
|
git --no-pager diff --staged
|
|
else
|
|
diff -qr "$@"
|
|
fi
|
|
}
|
|
|
|
alias less="less -SEX"
|
|
|
|
docker() {
|
|
if [[ "$1" == "ps" ]]; then
|
|
command docker ps | less -SEX
|
|
elif [[ "$1" == "images" ]]; then
|
|
command docker images | less -SEX
|
|
elif [[ "$1" == "rm" ]]; then
|
|
command docker "$@" -f
|
|
else
|
|
command docker "$@"
|
|
fi
|
|
}
|
|
|
|
alias ..="cd .." # 상위 디렉토리로 이동
|
|
alias ...="cd ../.." # 두 단계 위로 이동
|
|
alias ~="cd ~" # 홈 디렉토리로 이동
|
|
alias mkdir="mkdir -p"
|
|
|
|
alias myip="curl ifconfig.me" # 내 IP 주소 확인
|
|
alias ports="netstat -tuln" # 열려 있는 포트 확인
|
|
alias free="free -h --si"
|
|
alias df="df -h"
|
|
|
|
alias status="git status ."
|
|
alias push="git push"
|
|
alias pull="git pull"
|
|
alias fetch="git fetch"
|
|
add() {
|
|
if [ $# -eq 0 ]; then
|
|
git add .
|
|
else
|
|
git add $@
|
|
fi
|
|
diff
|
|
}
|
|
alias remote="git remote -v"
|
|
alias stash="git stash"
|
|
alias vimrc="vi ~/.vimrc"
|
|
commit() {
|
|
git commit -m "$*" && git pull && git push
|
|
}
|
|
|
|
git() {
|
|
if [[ "$1" == "remote" ]]; then
|
|
shift
|
|
command git remote -v "$@"
|
|
elif [[ "$1" == "status" ]]; then
|
|
command git status .
|
|
command git diff --staged --stat
|
|
else
|
|
command git "$@"
|
|
fi
|
|
}
|
|
|
|
alias weather="curl ko.wttr.in"
|
|
alias sudo="sudo "
|
|
alias dryblack="clear; black --check --diff --color ."
|
|
alias compose="docker compose"
|
|
alias compsoe="compose"
|
|
|
|
alias ps="ps ux"
|
|
clone() { git clone "https://git.yauk.tv/$@"; }
|
|
|
|
ign() {
|
|
for item in "$@"; do
|
|
if [ -d "$item" ]; then
|
|
echo "$item/" >> .gitignore
|
|
echo "Added directory: $item/ to .gitignore"
|
|
elif [ -f "$item" ]; then
|
|
echo "$item" >> .gitignore
|
|
echo "Added file: $item to .gitignore"
|
|
else
|
|
echo "Warning: $item does not exist"
|
|
fi
|
|
done
|
|
}
|
|
|
|
alias r="redis-cli"
|
|
q() { "$@" > /dev/null 2>&1 & }
|
|
|
|
|
|
log() {
|
|
python -c "while log := __import__('redis').Redis().brpop('log'): print(log[1].decode())"
|
|
}
|