configs/.bash_aliases

124 lines
4.6 KiB
Bash
Executable File

# Detect distribution
if [ -f /etc/os-release ]; then
. /etc/os-release
fi
# Application management
case "$ID" in
ubuntu|debian|pop)
# 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)
# 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
;;
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
# General
# Get $HOME quick
alias ~='cd $HOME;clear'
# A Nice display of all files in a directory
alias ll='ls -hog'
# Above but...different I'm sure
alias lsa='ls -lah'
# List stuff sorted by size
alias lt='ls --human-readable --size -1 -S --classify'
# Grep command history fast-like
alias gh='history|grep'
# lol
alias please='sudo !!'
# sometimes it feels good
alias fucking='sudo'
# Install bat. It's better.
alias cat='bat'
# Source this very file
alias src='source $HOME/.bashrc'
# Big Boy edit something
alias svim='sudo vim'
# Ping but with sounds
alias ding='ping -i 5 -a'
# An extremely useful benchmark script
alias yabs='curl -sL yabs.sh | bash'
# Utilities
# 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
alias s='screen -X screen '
# Resume screen or create a new one named main
alias scr='screen -r || screen -S main'
# press enter to continue. Occasionally useful
alias cnfrm='read -p "Press enter to proceed" '
# A more intense ping for the professional on the go
alias pang='ping -i 10 -v -a'
# List the mounted things
alias mnts='mount | column -t'
# The history command but shorter
alias h='history'
# Misc
# Get the weather. Put your location after the command
alias wttr='ansiweather -u imperial -s false -l'
# A quick lil speedyboi
alias speedTest='curl -s https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py | python3 -'
# If you're runnng my exact mastodon setup, this will be useful
alias tootctl='docker exec -it -w /app/www mastodon bin/tootctl'
# HAHAHA Go for it. Hours of fun and profit or ruining all your stuff
alias hackingtool='docker run -it --net=host --security-opt seccomp=unconfined --privileged blackarchlinux/blackarch:latest'
# Do you need to reboot? Find out here!
alias needrs='[ -f /var/run/reboot-required ] && echo "You need to reboot"'
alias gitgraph='git log --graph --oneline --decorate'
## See open ports
alias ports='netstat -tuln '
# gping
alias gping='docker run --rm -ti --network host ghcr.io/orf/gping'
alias proxon='export http_proxy=socks5://socks5.distantserver.org:666; export https_proxy=socks5://socks5.distantserver.org:666; echo $https_proxy'
alias proxoff='unset http_proxy;unset https_proxy'