2023-04-01 14:19:02 -05:00
|
|
|
# Detect distribution
|
|
|
|
if [ -f /etc/os-release ]; then
|
|
|
|
. /etc/os-release
|
|
|
|
fi
|
|
|
|
|
2021-05-19 02:03:21 -05:00
|
|
|
# Application management
|
2023-04-01 14:19:02 -05:00
|
|
|
case "$ID" in
|
2024-02-06 23:45:29 -06:00
|
|
|
ubuntu|debian|pop)
|
2023-04-01 14:19:02 -05:00
|
|
|
# Install something bypassing the prompts
|
|
|
|
alias inst='sudo apt-get install -y'
|
|
|
|
# Do a basic update
|
|
|
|
alias update='sudo apt-get update -y && sudo apt-get upgrade -y'
|
|
|
|
# Upgrade everything
|
|
|
|
alias upgrade_all='sudo apt-get update -y && sudo apt-get upgrade -y && sudo apt-get dist-upgrade -y && sudo apt-get autoremove -y && sudo apt-get autoclean -y && sudo apt-get --with-new-pkgs upgrade -y'
|
|
|
|
# Search packages
|
|
|
|
alias pacs='apt-cache search'
|
|
|
|
# Uninstall
|
|
|
|
alias burn='sudo apt-get autoremove'
|
|
|
|
;;
|
|
|
|
arch|archlinux)
|
2023-04-01 15:11:44 -05:00
|
|
|
# Check if yay is installed
|
|
|
|
if command -v yay >/dev/null 2>&1; then
|
|
|
|
# Install something bypassing the prompts
|
|
|
|
alias inst='yay -S --noconfirm'
|
|
|
|
# Do a basic update
|
|
|
|
alias update='yay -Syu --noconfirm'
|
|
|
|
# Upgrade everything
|
|
|
|
alias upgrade_all='yay -Syu --noconfirm && yay -Rns $(pacman -Qdtq) --noconfirm && sudo paccache -r'
|
|
|
|
# Search packages
|
|
|
|
alias pacs='yay -Ss'
|
|
|
|
# Uninstall
|
|
|
|
alias burn='yay -Rns --noconfirm'
|
|
|
|
else
|
|
|
|
# Install something bypassing the prompts
|
|
|
|
alias inst='sudo pacman -S --noconfirm'
|
|
|
|
# Do a basic update
|
|
|
|
alias update='sudo pacman -Syu --noconfirm'
|
|
|
|
# Upgrade everything
|
|
|
|
alias upgrade_all='sudo pacman -Syu --noconfirm && sudo pacman -Rns $(pacman -Qdtq) --noconfirm && sudo paccache -r'
|
|
|
|
# Search packages
|
|
|
|
alias pacs='pacman -Ss'
|
|
|
|
# Uninstall
|
|
|
|
alias burn='sudo pacman -Rns --noconfirm'
|
|
|
|
fi
|
2023-04-01 14:19:02 -05:00
|
|
|
;;
|
|
|
|
alpine)
|
|
|
|
# Install something bypassing the prompts
|
|
|
|
alias inst='sudo apk add'
|
|
|
|
# Do a basic update
|
|
|
|
alias update='sudo apk update && sudo apk upgrade'
|
|
|
|
# Upgrade everything
|
|
|
|
alias upgrade_all='sudo apk update && sudo apk upgrade && sudo apk cache clean'
|
|
|
|
# Search packages
|
|
|
|
alias pacs='apk search'
|
|
|
|
# Uninstall
|
|
|
|
alias burn='sudo apk del'
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
# Add any other distribution-specific aliases here
|
|
|
|
;;
|
|
|
|
esac
|
2021-05-19 02:03:21 -05:00
|
|
|
# General
|
2023-01-13 01:16:48 -06:00
|
|
|
# Get $HOME quick
|
2024-02-24 23:38:57 -05:00
|
|
|
alias ~='cd $HOME;clear'
|
2023-01-13 01:16:48 -06:00
|
|
|
# A Nice display of all files in a directory
|
2023-01-12 00:17:23 -06:00
|
|
|
alias ll='ls -hog'
|
2023-01-13 01:16:48 -06:00
|
|
|
# Above but...different I'm sure
|
2021-05-18 13:14:51 -05:00
|
|
|
alias lsa='ls -lah'
|
2023-01-13 01:16:48 -06:00
|
|
|
# List stuff sorted by size
|
2021-05-18 13:14:51 -05:00
|
|
|
alias lt='ls --human-readable --size -1 -S --classify'
|
2023-01-13 01:16:48 -06:00
|
|
|
# Grep command history fast-like
|
2021-05-18 13:14:51 -05:00
|
|
|
alias gh='history|grep'
|
2023-01-13 01:16:48 -06:00
|
|
|
# lol
|
2023-11-25 15:33:48 -06:00
|
|
|
alias please='sudo !!'
|
2023-01-13 01:16:48 -06:00
|
|
|
# sometimes it feels good
|
2021-06-02 14:41:20 -05:00
|
|
|
alias fucking='sudo'
|
2023-01-13 01:16:48 -06:00
|
|
|
# Install bat. It's better.
|
2023-03-31 01:51:23 -05:00
|
|
|
alias cat='bat'
|
2023-01-13 01:16:48 -06:00
|
|
|
# Source this very file
|
2024-02-24 23:38:57 -05:00
|
|
|
alias src='source $HOME/.bashrc'
|
2023-01-13 01:16:48 -06:00
|
|
|
# Big Boy edit something
|
2022-08-01 13:03:26 -05:00
|
|
|
alias svim='sudo vim'
|
2023-01-13 01:16:48 -06:00
|
|
|
# Ping but with sounds
|
2021-06-22 13:45:35 -05:00
|
|
|
alias ding='ping -i 5 -a'
|
2023-01-13 01:16:48 -06:00
|
|
|
# An extremely useful benchmark script
|
2022-09-19 17:56:31 -05:00
|
|
|
alias yabs='curl -sL yabs.sh | bash'
|
2021-05-19 02:03:21 -05:00
|
|
|
# Utilities
|
2023-01-13 01:16:48 -06:00
|
|
|
# A faster way to do the thing it does
|
|
|
|
alias sysres='sudo systemctl restart'
|
|
|
|
# This one too
|
|
|
|
alias sysup='sudo systemctl enable --now'
|
|
|
|
# Also this one
|
|
|
|
alias sysdn='sudo systemctl disable --now'
|
|
|
|
#opens specified command in new window in screen session
|
2023-10-17 17:46:08 -05:00
|
|
|
alias s='screen -X screen '
|
2023-08-22 18:54:22 -05:00
|
|
|
# Resume screen or create a new one named main
|
|
|
|
alias scr='screen -r || screen -S main'
|
2023-01-14 15:41:50 -06:00
|
|
|
# press enter to continue. Occasionally useful
|
|
|
|
alias cnfrm='read -p "Press enter to proceed" '
|
2023-01-13 01:16:48 -06:00
|
|
|
# A more intense ping for the professional on the go
|
2021-05-19 02:03:21 -05:00
|
|
|
alias pang='ping -i 10 -v -a'
|
2023-01-13 01:16:48 -06:00
|
|
|
# List the mounted things
|
2021-05-19 02:03:21 -05:00
|
|
|
alias mnts='mount | column -t'
|
2023-01-13 01:16:48 -06:00
|
|
|
# The history command but shorter
|
2021-05-24 13:11:13 -05:00
|
|
|
alias h='history'
|
2021-05-19 02:03:21 -05:00
|
|
|
# Misc
|
2023-01-13 01:16:48 -06:00
|
|
|
# Get the weather. Put your location after the command
|
|
|
|
alias wttr='ansiweather -u imperial -s false -l'
|
|
|
|
# A quick lil speedyboi
|
2022-11-14 19:17:33 -06:00
|
|
|
alias speedTest='curl -s https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py | python3 -'
|
2023-01-13 01:16:48 -06:00
|
|
|
# If you're runnng my exact mastodon setup, this will be useful
|
2022-12-05 00:05:00 -06:00
|
|
|
alias tootctl='docker exec -it -w /app/www mastodon bin/tootctl'
|
2023-01-13 01:16:48 -06:00
|
|
|
# HAHAHA Go for it. Hours of fun and profit or ruining all your stuff
|
2023-03-05 19:47:32 -06:00
|
|
|
alias hackingtool='docker run -it --net=host --security-opt seccomp=unconfined --privileged blackarchlinux/blackarch:latest'
|
2023-01-14 15:38:14 -06:00
|
|
|
# Do you need to reboot? Find out here!
|
2023-01-13 00:47:07 -06:00
|
|
|
alias needrs='[ -f /var/run/reboot-required ] && echo "You need to reboot"'
|
2023-11-24 16:05:34 -06:00
|
|
|
alias gitgraph='git log --graph --oneline --decorate'
|
2024-02-24 23:17:25 +00:00
|
|
|
## See open ports
|
2023-11-02 01:05:55 -05:00
|
|
|
alias ports='netstat -tuln '
|
2024-02-29 14:46:28 -06:00
|
|
|
# gping
|
2024-02-29 14:55:02 -06:00
|
|
|
alias gping='docker run --rm -ti --network host ghcr.io/orf/gping'
|
2024-07-03 15:47:32 -05:00
|
|
|
alias proxon='export ALL_PROXY=socks5://brad:963852pop@distantserver.org:666; echo "IP: $(curl -s ifconfig.me)"'
|
|
|
|
alias proxoff='unset ALL_PROXY; echo "IP: $(curl -s ifconfig.me)"'
|