Skip to content

Instantly share code, notes, and snippets.

@intijk
intijk / pp-iptables.py
Created October 22, 2022 16:27 — forked from djoreilly/pp-iptables.py
Pretty print iptables output. Align columns and strip out comments.
#!/usr/bin/python3
import re
import sys
from tabulate import tabulate
comments_re = re.compile(r'/\*.*\/')
in_chain, eof = False, False
headers, table = [], []