216 lines
5.6 KiB
Bash
216 lines
5.6 KiB
Bash
alias vite="npm run dev -- --host 0.0.0.0"
|
|
alias cls="clear"
|
|
export GGML_CUDA=1
|
|
export LLAMA_CURL=1
|
|
export LLAMA_ARG_N_GPU_LAYERS=99
|
|
export LLAMA_ARG_FLASH_ATTN=1
|
|
export LLAMA_ARG_HOST="0.0.0.0"
|
|
export LLAMA_ARG_HF_REPO="bartowski/Phi-3-medium-128k-instruct-GGUF"
|
|
export LLAMA_ARG_HF_FILE="Phi-3-medium-128k-instruct-Q4_K_S.gguf"
|
|
export LLAMA_ARG_CTX_SIZE=65536
|
|
|
|
|
|
# export LANG=C.UTF-8
|
|
# export LC_ALL=C.UTF-8
|
|
|
|
|
|
alias rerun="docker compose down && docker compose up -d --build && docker compose logs -f"
|
|
export PATH="/usr/local/bin:/home/w/.cache/ms-playwright/chromium-1129/chrome-linux:$PATH"
|
|
export OLLAMA_HOST=host.docker.internal:11434
|
|
|
|
alias rp=runpodctl
|
|
export PATH="/usr/local/bin:/home/w/.cache/ms-playwright/chromium-1129/chrome-linux:$PATH"
|
|
export COMPOSE_STOP_GRACE_PERIOD=0
|
|
export PATH=/usr/bin:$PATH
|
|
alias prune="docker system prune -f"
|
|
alias rc="vi ~/.bash_aliases && tail ~/.bash_aliases && source ~/.bash_aliases"
|
|
alias up="down && docker compose up --remove-orphans"
|
|
alias down="docker compose down"
|
|
pkill() { pkill -f "$@" ; ps ux ; }
|
|
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 py="python"
|
|
alias p="python"
|
|
|
|
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"
|
|
export PATH=$PATH:$HOME/minio-binaries/
|
|
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 LIBGL_ALWAYS_INDIRECT=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"
|
|
|
|
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 w@10.0.0.1"
|
|
alias mac="ssh jaewooklee@192.168.12.45"
|
|
alias ip="ip -4"
|
|
alias ping="ping -c 2"
|
|
|
|
|
|
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 diff="git diff --staged"
|
|
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
|
|
git status
|
|
}
|
|
parallel() {
|
|
if [ $# -lt 2 ]; then
|
|
echo "Usage: parallel <number_of_instances> <command>"
|
|
return 1
|
|
fi
|
|
|
|
count=$1
|
|
shift
|
|
command="$@"
|
|
|
|
for i in $(seq 1 $count); do
|
|
eval "$command" &
|
|
done
|
|
|
|
wait
|
|
}
|
|
|
|
repeat() {
|
|
if [ $# -lt 2 ]; then
|
|
echo "Usage: repeat <interval>[s|m|h] <command>"
|
|
return 1
|
|
fi
|
|
|
|
interval=$(echo $1 | sed 's/[smh]$//')
|
|
unit=${1##*[0-9]}
|
|
command="${@:2}"
|
|
|
|
case $unit in
|
|
s|'') seconds=$interval;;
|
|
m) seconds=$((interval * 60));;
|
|
h) seconds=$((interval * 3600));;
|
|
*) echo "Invalid time unit. Use 's' for seconds, 'm' for minutes, 'h' for hours, or no unit for seconds."; return 1;;
|
|
esac
|
|
|
|
while true; do
|
|
eval $command
|
|
sleep $seconds
|
|
done
|
|
}
|
|
alias remote="git remote -v"
|
|
alias stash="git stash"
|
|
alias branch="git branch"
|
|
alias checkout="git checkout"
|
|
alias vimrc="vi ~/.vimrc"
|
|
commit() {
|
|
git commit -m "$*" && 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 & }
|
|
|