My Manjaro cheatsheet in a menu form

I just added 3 more or less logically interconnected network tools.
If you notice high network traffic you can see which process is causing it with nethogs (has to be installed before that)…than you copy the name or pid of the culprit and paste it as input for ss to see where it connects…and you can then check with whois what exactly is an ip address

Version 3.7.24 :)
#!/bin/bash
# Creator: Todor Uzunov a.k.a. Teo
# License: GNU - free like free speech and free beer for everybody!
VERSION=03.07.2024
# Changelog: added generation of hashes for my separate boot verifier project; pacman -Qo; formatting

MODE=Xdialog
# check if dependencies are present and fall back to dialog. You can also change the variable manually above
if ! [[ "$(which dialog)" =~ (dialog) ]] &>/dev/null; then
if ! [[ "$(which Xdialog)" =~ (Xdialog) ]] &>/dev/null; then
	echo "Xdialog dependency is not found, please install with: sudo pacman -S xdialog"
	echo "Alternatively for TUI version install dialog: sudo pacman -S dialog"
	exit 1
fi
if ! [[ "$(which /usr/lib/gtk-2.0/2.10.0/engines/libmurrine.so)" =~ (/usr/lib/gtk-2.0/2.10.0/engines/libmurrine.so) ]] &>/dev/null; then
	echo "Libmurrine dependency is not found, please install with: sudo pacman -S gtk-engine-murrine"
	echo "Alternatively for TUI version install dialog: sudo pacman -S dialog"
	exit 1
fi
else
if ! [[ "$(which Xdialog)" =~ (Xdialog) ]]; then
	MODE=dialog
	if [[ "$(which notify-send)" =~ (notify-send) ]]; then notify-send "If you want GUI you can install Xdialog with"  "sudo pacman -S xdialog"; fi
fi
if ! [[ "$(which /usr/lib/gtk-2.0/2.10.0/engines/libmurrine.so)" =~ (/usr/lib/gtk-2.0/2.10.0/engines/libmurrine.so) ]]; then
	MODE=dialog
	if [[ "$(which notify-send)" =~ (notify-send) ]]; then notify-send "If you want GUI you can install libmurrine with"  "sudo pacman -S gtk-engine-murrine"; fi
fi
fi
OPTIONS=(
	1 " Mirror Sync status and branch" "pacman-mirrors"
	2 " Refresh the mirror list" "sudo pacman-mirrors -f" # sudo pacman-mirrors --country Germany --api --protocol https
	3 " Update all without AUR" "sudo pacman -Syu"
	4 " Download all updates for offline install later" "sudo pacman -Syuw"
	5 " Force refresh database and update (only for emergencies)" "sudo pacman -Syyu"
	6 " Run pacdiff with Meld to compare changed configs" "DIFFPROG=meld pacdiff -s" # pamac install meld
	7 " List foreign (AUR) packages" "pacman -Qm"
	8 " List orphaned packages" "pacman -Qdt"
	9 " Check for updates of AUR with YAY, do not update" "yay -Qua" # pamac install yay
	10 " Update only AUR packages with YAY" "yay -Sua" # pamac install yay
	11 " Pamac update AUR packages" "pamac update --aur"
	12 " Remove orphaned packages" "sudo pacman -Rsu \$(pacman -Qtdq)"
	13 " Clean Pacman and Pamac cache" "sudo pacman -Scc"
	14 " Show journal errors from current boot" "journalctl -b -p3 --no-pager"
	15 " Show journal errors from previous boot" "journalctl -b -1 -p3 --no-pager"
	16 " Show systemd bootlog only" "journalctl -b -t systemd"
	17 " Show dmesg" "sudo dmesg"
	18 " Check for coredumps" "coredumpctl"
	19 " List coredumps on disk and used space" "du -sh /var/lib/systemd/coredump/"
	20 " Clear coredumps on disk" "sudo rm -f /var/lib/systemd/coredump/*"
	21 " Trim the root of the SSD" "sudo fstrim -v /"
	22 " S.M.A.R.T. status of the disk and write cycles" "sudo smartctl --all /dev/nvme0" # smartctl --scan
	23 " Run wavemonitor to check Wifi channel and strength with wavemon" "wavemon" # pamac install wavemon
	24 " Read sensors every second, press CTRL-C to exit" "watch -e -n 1 sensors"
	25 " Stress the CPU, useful for thermal or throttling tests, press CTRL-C to exit" "stress -c 16"
	26 " Gather system info with inxi (filtered)" "inxi -zv8"
	27 " Update database for locate" "sudo updatedb"
	28 " Temporary disable Ideapad battery conservation mode" "sudo conservation_mode.sh 0" # pamac build conservation_mode
	29 " Show hidden spaceeaters above 100M in HOME" "du -sh -t +100M ~/.cache/* ~/.config/* ~/.local/share/*"
	30 " Use MAPARE to check if missing default packages" "bash <(curl -s https://gitlab.com/cscs/mapare/-/raw/main/mapare) -IP"
	31 " Check for missing files from packages" "sudo pacman -Qk 2>/dev/null | grep -v ' 0 missing files' "
	32 " Which package owns an existing file (paste filepath)" "read fileowner; pacman -Qo \$fileowner"
	33 " Which (installed or not) package contains a file (paste filename, online check)" "read whogotit; sudo pacman -Fyx \$whogotit"
	34 " Which (installed) package contains a file or directory (paste filename or path, offline check)" "read whogotit; pacman -Qo \$whogotit"
	35 " Check for flatpak updates and update" "flatpak update"
	36 " Remove orphaned (unused) flatpak runtimes" "flatpak uninstall --unused"
	37 " Clean flatpak cache" "rm -rfv /var/tmp/flatpak-cache-*"
	38 " Clean tmp bash history files and Totem stream cache" "rm -f ~/.bash_history-*.tmp && rm -f ~/.cache/totem/stream-buffer/*"
	39 " A 10-20 sec. cpu benchmark using bc to calculate PI" "time echo \"scale=5000; 4*a(1)\" | bc -l > /dev/null" # pamac install bc
	40 " Show journal size" "journalctl --disk-usage"
	41 " Cut journal to 2 weeks" "sudo journalctl --vacuum-time=2weeks"
	42 " Display the apps making most network traffic. Exit with q" "sudo nethogs" # pamac install nethogs
	43 " Show all network connections of an app (paste name or pid)" "read nethog; ss -tuap | grep \$nethog"
	44 " Whois (paste ip address)" "read ipaddress; whois \$ipaddress"
	45 " Regenerate hashes for the boot files after update" "sudo /root/verifier.sh -update" # requires the extra script
)
while true; do
CHOICE=$($MODE --clear \
		--no-shadow \
		--no-tags \
		--item-help \
		--keep-tite \
		--scrollbar \
		--ok-label "Run" \
		--cancel-label "Exit" \
                --backtitle "" \
                --title "A Manjaro cheatsheet by Teo, version $VERSION" \
		--menu "Press Enter to run a command from the list or close the window to cancel:" \
                79 125 0 \
                "${OPTIONS[@]}" \
                2>&1 >/dev/tty)
[[ $CHOICE ]] || break
echo "${OPTIONS[$(($(($CHOICE*3))-1))]}"
eval "${OPTIONS[$(($(($CHOICE*3))-1))]}"
read -n 1 -s -r -p "Press any key to return to menu or q to exit." $REPLY;
echo ""
echo ""
echo "================================================="
echo ""
if [[ $REPLY == "q" ]]; then break; fi
done