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

docker

open shell in a running container

docker exec -ti <container-name> /bin/bash
linux.1705263297.txt.gz · Last modified: 2024/01/14 20:14 by nine