major update of bashrc

This commit is contained in:
2025-09-30 18:52:56 +09:00
parent d14b0b1f09
commit 47dcfe0514

View File

@@ -1,144 +1,78 @@
alias nmap="nmap -p1-65535"
alias restart="docker restart"
alias down="docker compose down"
alias up="docker compose down && docker compose up -d --remove-orphans && docker compose logs -f"
alias prune="docker system prune -f"
alias i="sudo apt-get install -y"
alias cls="clear"
alias rc="vi ~/.bash_aliases && tail ~/.bash_aliases && source ~/.bash_aliases"
alias l='clear; echo "\x1b[92m$(pwd)\x1b[0m"; command ls -lh --color=auto'
alias ls='clear; echo "\x1b[92m$(pwd)\x1b[0m"; command ls -alh --color=auto'
alias ns="watch -n 0.1 nvidia-smi"
alias ping="ping -c 2"
alias rsync="rsync -avPh"
log() {
if [ $# -eq 0 ]; then
docker compose logs -f
else
docker logs -f "$@"
fi
}
alias wg="sudo wg"
alias systemctl="sudo systemctl"
alias service="sudo service"
alias apt="sudo apt-get"
alias chwon="sudo chown"
alias reboot='sudo reboot'
export HOMEBREW_NO_AUTO_UPDATE=1
export GOPATH=$HOME/go
# >>>> PATH
export CEF_PATH="$HOME/.local/share/cef"
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$CEF_PATH"
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:./build/bin
export PATH="$HOME/wsl:$HOME/go/bin:/usr/local/go/bin:$HOME/.zig:/Users/w/hub/wireguard-go/:/Users/w/.venv/bin:/usr/local/bin:/home/w/.cache/ms-playwright/chromium-1129/chrome-linux:$PATH:."
export PATH="/Users/w/.venv/bin:$PATH:$HOME/go/bin"
export PATH="/home/w/hub/llama.cpp/build/bin:$PATH"
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:./build/bin
export HF_TOKEN=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
export CLOUDFLARE_API_TOKEN=Pah8Q6hBUsQsKnKhaMJB2QvL-LHAWCcU8xti66Q3
dive(){ docker exec -it "$@" sh; }
export LLAMA_ARG_N_GPU_LAYERS=99
export HOMEBREW_NO_AUTO_UPDATE=1
export HOMEBREW_NO_ENV_HINTS=true
export GOPATH=$HOME/go
export LLAMA_ARG_HOST="0.0.0.0"
export PATH="$HOME/hub/llama.cpp/build/bin:/usr/local/bin:$HOME/.cache/ms-playwright/chromium-1129/chrome-linux:$PATH"
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 nuc="ssh w@192.168.12.5"
alias mac="ssh jaewooklee@10.0.0.2"
alias mac="ssh w@192.168.12.2"
# >>> Super useful
alias l='clear; echo "\x1b[92m$(pwd)\x1b[0m"; command ls -alh --color=auto'
alias nmap="nmap -p1-65535"
alias rc="vi ~/.bash_aliases && source ~/.bash_aliases && echo OK"
alias c="clear"
alias mac="ssh w@10.0.0.2"
alias ping="ping -c 2"
alias i="sudo dnf install -y"
alias ip="ip -4"
alias rsync="rsync -avPh"
alias ns="watch -n 0.1 nvidia-smi"
dive(){ docker exec -it "$@" sh; }
alias up="docker compose down; docker compose up -d --remove-orphans && docker compose logs -f"
alias down="docker compose down"
alias restart='docker restart'
pkill() { sudo command pkill -f "$@" && ps ux; }
log() { if [ $# -eq 0 ]; then docker compose logs -f; else docker logs -f "$@"; fi; }
build(){ git pull && cmake -B build -DBUILD_SHARED_LIBS=OFF -DGGML_CUDA=ON -DLLAMA_CURL=ON && cmake --build build --config Release -j ; }
docker() {
case "$1" in
ps) command docker ps --format 'table {{.Names}}\t{{.RunningFor}}\t{{.Networks}}\t{{.Ports}}\t{{.Image}}\t{{.Command}}\t{{.ID}}' | less -SEX;;
rm) command docker "$@" -f;;
*) command docker "$@";;
esac
}
# 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 ps="ps ux"
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
}
alias clone="git clone"
alias status="git status"
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
case "$1" in
remote) shift; command git remote -v "$@";;
status) command git status . && git diff --staged --stat;;
add) shift; command git add ${@:-.}; command git status;;
*) command git "$@";;
esac
}
alias wg="sudo wg"
alias wg-quick="sudo wg-quick"
alias weather="curl ko.wttr.in"
# >>> sudos
alias sudo="sudo "
alias dryblack="clear; black --check --diff --color ."
alias compose="docker compose"
alias compsoe="compose"
alias wg="sudo wg"
alias dnf="sudo dnf"
alias dpkg="sudo dpkg"
alias apt="sudo apt-get"
alias reboot="sudo reboot"
alias service="sudo service"
alias wg-quick="sudo wg-quick"
alias systemctl="sudo systemctl"
alpine() { docker run -it --rm alpine; }
# >>> SECRET
export HF_TOKEN=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
export CLOUDFLARE_API_TOKEN=Pah8Q6hBUsQsKnKhaMJB2QvL-LHAWCcU8xti66Q3
export ANTHROPIC_API_KEY=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