Some aliases moved to utils

This commit is contained in:
2025-12-08 17:04:11 +08:00
parent 9ca95f6353
commit 94df267831
21 changed files with 99 additions and 62 deletions

View File

@@ -13,6 +13,8 @@ alias g='git'
alias hosts="sudo nano /etc/hosts"
alias shrug="echo '¯\_(ツ)_/¯' | xclip -selection c"
alias up='cd ..'
alias back='cd -'
alias ..='cd ..' # zsh builtin
alias ~='cd ~' # zsh builtin
alias -- -='cd -' # zsh builtin
@@ -34,43 +36,20 @@ alias where='whereis' # zsh builtin
alias ps='ps auxf'
alias psg='ps aux | grep -v grep | grep -i -e VSZ -e'
alias is='type -a'
alias upgrade='sudo apt update && sudo apt upgrade -y && sudo snap refresh'
alias wine='LANG=ru_RU.utf8 wine'
alias wine64='LANG=ru_RU.utf8 wine64'
alias untargz='tar -czf'
alias mkcd="mkdir -p $1 && cd $1"
alias cl="cd $1 && ll"
alias myip='curl http://ipecho.net/plain; echo'
alias ports='netstat -tulpan'
# alias pubkey="more ~/.ssh/id_ed25519.pub | xclip -selection clipboard | echo '=> Public key copied to pasteboard.'"
alias ssh.pub="cat ~/.ssh/*.pub"
alias gpg.new="gpg --full-generate-key"
alias gpg.pub="gpg --armor --export"
alias gpg.list='gpg --list-keys --keyid-format SHORT'
# alias pubkey="more ~/.ssh/id_ed25519.pub | xclip -selection clipboard | echo '=> Public key copied to pasteboard.'"
alias wine='LANG=ru_RU.utf8 wine'
alias wine64='LANG=ru_RU.utf8 wine64'
# Add an "alert" alias for long running commands. Use like so:
# sleep 10; alert
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'
# https://obsproject.com/forum/threads/how-to-start-virtual-camera-without-sudo-privileges.139783/
alias obscam="sudo modprobe v4l2loopback video_nr=2 card_label='OBS Virtual Camera'"
curltime() {
curl -w @- -o /dev/null -s "$@" <<'EOF'
time_namelookup: %{time_namelookup} sec\n
time_connect: %{time_connect} sec\n
time_appconnect: %{time_appconnect} sec\n
time_pretransfer: %{time_pretransfer} sec\n
time_redirect: %{time_redirect} sec\n
time_starttransfer: %{time_starttransfer} sec\n
---------------\n
time_total: %{time_total} sec\n
EOF
}
# alias obscam="sudo modprobe v4l2loopback video_nr=2 card_label='OBS Virtual Camera'"
# Download music from Youtube or Youtube Music
# and save as top quality flac file without video
@@ -88,7 +67,6 @@ ytm() {
"$@"
}
docker.ip() {
if [ "$1" ]; then
if [ "$1" = "-a" ]; then