User Tools

Site Tools


linux

This is an old revision of the document!


Linux Cheat Sheet

snap

Clean unused/disabled snap packages

snap list --all | while read snapname ver rev trk pub notes; do if [[ $notes = *disabled* ]]; then snap remove "$snapname" --revision="$rev"; fi; done

iptables/netfilter

Restrict to single host, e.g. for prometheus node exporter

iptables -N prometheus  
iptables -A prometheus --src <server-ip> -j ACCEPT
iptables -A prometheus -j DROP
iptables -I INPUT -m tcp -p tcp --dport 9100 -j prometheus
linux.1702841992.txt.gz · Last modified: 2023/12/17 19:39 by nine