Coloring tcpdump

Some time ago I wrote a script to colorize the tcpdump output and convert that character mess into something easier to read

tcpdump default output

with this script this get converted to

output using the script

It only has to be dropped in the $PATH and mark it as executable (with a name other than tcpdump), it'll pass every flag to tcpdump, and try to colorize the output (but possibly there are some flags non considered)

1
2
3
4
proc = subprocess.Popen(["tcpdump", "-l"] + sys.argv[1:],
                        bufsize=0,
                        stdout=subprocess.PIPE,
                        stderr=subprocess.STDOUT)

The idea was to write some scripts for other programs (the repo is on gitorious named as candy-shell), but at this time only contains this script and une for maven, there will be more as the time passes

... or the pull requests ;)