Skip to content

Instantly share code, notes, and snippets.

# source: https://askubuntu.com/a/675109
# Without a parameter, the script lists some infos.
# With --delete, the list files will be removed, if no packages are installed.
#!/usr/bin/env bash
for f in /etc/apt/sources.list.d/*.list; do
grep -Po "(?<=^deb\s).*?(?=#|$)" "$f" | while read -r ENTRY ; do
echo "ENTRY: $ENTRY"
HOST=$(cut -d/ -f3 <<< "$ENTRY")
#!/usr/bin/env bash
#script is based on: https://raw.githubusercontent.com/matryer/bitbar-plugins/master/Network/bandwidth.1s.sh
#Do this first:
#sudo apt install ifstat sysstat lm-sensors
#sudo sensors-detect
netspeed=$(ifstat -n -w -i wlp1s0 0.1 1 | tail -n 1 | awk '{print "▼", $1, "▲", $2;}')
mem=$(free | grep Mem | awk '{print $3/$2 * 100.0}')