mirror of
https://github.com/ItsDrike/dotfiles.git
synced 2024-12-27 05:34:35 +00:00
Update aliases
This commit is contained in:
parent
18e5f8b7ea
commit
10e6c267fd
|
@ -7,7 +7,7 @@ alias soruce='source'
|
||||||
alias souce='source'
|
alias souce='source'
|
||||||
alias suod='sudo '
|
alias suod='sudo '
|
||||||
|
|
||||||
# Directories
|
# Files/Directories
|
||||||
alias ..='cd ..'
|
alias ..='cd ..'
|
||||||
alias ...='cd ../../'
|
alias ...='cd ../../'
|
||||||
alias ....='cd ../../../'
|
alias ....='cd ../../../'
|
||||||
|
@ -16,8 +16,12 @@ alias .2='cd ../../'
|
||||||
alias .3='cd ../../../'
|
alias .3='cd ../../../'
|
||||||
alias .4='cd ../../../../'
|
alias .4='cd ../../../../'
|
||||||
alias .5='cd ../../../../../'
|
alias .5='cd ../../../../../'
|
||||||
alias mkdir='mkdir -p' # Mkdir with automatic creation of parent directories
|
alias mkdir='mkdir -p'
|
||||||
alias md='mkdir'
|
alias md='mkdir'
|
||||||
|
alias rr='rm -r'
|
||||||
|
alias rf='rm -f'
|
||||||
|
alias rrf='rm -rf'
|
||||||
|
alias fhere='find . -name'
|
||||||
|
|
||||||
# Aliases for piping directly (f.e.: history G ssh)
|
# Aliases for piping directly (f.e.: history G ssh)
|
||||||
alias -g G='| grep'
|
alias -g G='| grep'
|
||||||
|
@ -82,9 +86,11 @@ alias reg_ipv4='echo "([0-9]{1,3}\.){3}[0-9]{1,3}"'
|
||||||
alias reg_ipv6='echo "\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*"' # Also catches loopbacks (::1), (for valid matching, it needs to be this long...)
|
alias reg_ipv6='echo "\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*"' # Also catches loopbacks (::1), (for valid matching, it needs to be this long...)
|
||||||
alias reg_ip='echo "(`reg_ipv4`|`reg_ipv6`)"' # Match both IPv4 and IPv6
|
alias reg_ip='echo "(`reg_ipv4`|`reg_ipv6`)"' # Match both IPv4 and IPv6
|
||||||
|
|
||||||
|
# Grep aliases
|
||||||
alias grep_email='grep -E `reg_email`'
|
alias grep_email='grep -E `reg_email`'
|
||||||
alias grep_ip='grep -E `reg_ip`'
|
alias grep_ip='grep -E `reg_ip`'
|
||||||
alias grep_mac='grep -E `reg_mac`'
|
alias grep_mac='grep -E `reg_mac`'
|
||||||
|
alias massgrep='grep -rni'
|
||||||
|
|
||||||
# Network
|
# Network
|
||||||
alias ip-show='curl https://ipinfo.io/ip' # Show public IP address
|
alias ip-show='curl https://ipinfo.io/ip' # Show public IP address
|
||||||
|
@ -120,6 +126,7 @@ alias cpu-stress='for i in $(seq $(getconf _NPROCESSORS_ONLN)); do yes > /dev/nu
|
||||||
alias nvidia='__NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia' # Run app with nvidia (on hybrid mode with optimus)
|
alias nvidia='__NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia' # Run app with nvidia (on hybrid mode with optimus)
|
||||||
alias swapout='sudo swapoff -a; sudo swapon -a' # Reset swap (move everything to RAM)
|
alias swapout='sudo swapoff -a; sudo swapon -a' # Reset swap (move everything to RAM)
|
||||||
alias mount-ram='mount -t tmpfs tmpfs' # Mount RAM disk for fast filesystem
|
alias mount-ram='mount -t tmpfs tmpfs' # Mount RAM disk for fast filesystem
|
||||||
|
alias sv='systemctl'
|
||||||
|
|
||||||
# Processes
|
# Processes
|
||||||
alias psmem='ps auxf | sort -nr -k 4' # Top memory eaters
|
alias psmem='ps auxf | sort -nr -k 4' # Top memory eaters
|
||||||
|
@ -183,23 +190,12 @@ alias vuln='arch-audit' # Show vulnerable packages that can be upgraded (Arch Li
|
||||||
alias vuln-upgrade="pacman -Sy \"\$(arch-audit --upgradable --quiet | awk '{sub(/>=.+/, \"\"); print}' | paste -s -d ' ')\"" # Upgrade all vulnerable packages, with released fixes
|
alias vuln-upgrade="pacman -Sy \"\$(arch-audit --upgradable --quiet | awk '{sub(/>=.+/, \"\"); print}' | paste -s -d ' ')\"" # Upgrade all vulnerable packages, with released fixes
|
||||||
alias create_mirror_list='reflector --country Slovakia --country Czechia --country Poland --country Hungary --country Ukraine --country Germany --country US --latest 800 --protocol https --sort rate --save mirrorlist'
|
alias create_mirror_list='reflector --country Slovakia --country Czechia --country Poland --country Hungary --country Ukraine --country Germany --country US --latest 800 --protocol https --sort rate --save mirrorlist'
|
||||||
|
|
||||||
# Other CLI aliases
|
# Shell aliases
|
||||||
alias rr='rm -r'
|
alias reload="exec \$SHELL" # Reload the shell (i.e. invoke as a login shell)
|
||||||
alias sv='systemctl'
|
|
||||||
alias massgrep='grep -rni'
|
|
||||||
alias unsudo='sudo -k' # Reset sudo timeout (sudo will require password)
|
|
||||||
alias reload="exec \$SHELL" # Reload the shell (i.e. invoke as a login shell
|
|
||||||
alias path='echo -e ${PATH//:/\\n}' # Print each PATH entry on a separate line
|
alias path='echo -e ${PATH//:/\\n}' # Print each PATH entry on a separate line
|
||||||
alias fhere='find . -name' # Find file/dir from currrent dir
|
alias unsudo='sudo -k' # Reset sudo timeout (sudo will require password)
|
||||||
alias colors-256='curl -s https://gist.githubusercontent.com/HaleTom/89ffe32783f89f403bba96bd7bcd1263/raw/ | bash' # Show color table
|
|
||||||
alias metasploit='msfconsole'
|
|
||||||
|
|
||||||
# Graphical custom aliases
|
|
||||||
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$//'\'')"'
|
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$//'\'')"'
|
||||||
alias sound_control='alsamixer' # Sound control tool in alsa_utils package
|
alias colors-256='curl -s https://gist.githubusercontent.com/HaleTom/89ffe32783f89f403bba96bd7bcd1263/raw/ | bash' # Show color table
|
||||||
alias firefox='GTK_USE_PORTAL=1 firefox'
|
|
||||||
alias pdf-reader='mupdf' # Open pdf file
|
|
||||||
alias md-to-pdf='pandoc -s -o' # Convert markdown to pdf
|
|
||||||
|
|
||||||
# If user is not root, pass all commands via sudo
|
# If user is not root, pass all commands via sudo
|
||||||
if [ $UID -ne 0 ]; then
|
if [ $UID -ne 0 ]; then
|
||||||
|
|
Loading…
Reference in a new issue