Skip to content

Instantly share code, notes, and snippets.

@baphael
baphael / undump.sh
Last active May 15, 2023 12:34
Netstat overlay to monitor TCP sockets usage (polling)
#!/usr/bin/env bash
# Simple IPv4 PCRE pattern
IP_P="(\d{1,3}\.){3}\d{1,3}"
echo -n "Check privileges... "
if (( $(id -u) )); then
echo KO
echo "This script must be executed as superuser in order to write in /tmp and to listen to all sockets."
exit 1