Skip to content

Instantly share code, notes, and snippets.

@lordnynex
Forked from nl5887/Makefile
Created April 23, 2016 03:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lordnynex/7d0c60ca930006e5eb01c139be7d2c61 to your computer and use it in GitHub Desktop.
Save lordnynex/7d0c60ca930006e5eb01c139be7d2c61 to your computer and use it in GitHub Desktop.
grapviz tcpdump
tcpdump -nnt -r ~/Downloads/packets-758949d7-b01e-4c91-8792-90653d72be5d.pcap port not ssh and tcp > /tmp/b.txt
make
LAYOUT=circo
SOURCES = $(wildcard *.dot)
TARGETS = $(SOURCES:.dot=.svg)
%.svg:%.dot
dot -Tsvg -K${LAYOUT} "$^" -o "$@"
all: $(TARGETS)
clean:
rm -f $(TARGETS)
grep -E "IP\ " /tmp/b.txt | awk ' BEGIN { e="(([0-9]{1,3}.){3})([0-9]{1,3}).*" }
{
printf "\"%s\" -> \"%s\";\n", gensub(e, "\\1\\3", "1", $2), gensub(e, "\\1\\3", "1", $4)
}' >> /tmp/b.txt2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment