Skip to content

Instantly share code, notes, and snippets.

@donalod
Last active August 29, 2015 14:08
Show Gist options
  • Save donalod/efd062498dfc5bcc97f0 to your computer and use it in GitHub Desktop.
Save donalod/efd062498dfc5bcc97f0 to your computer and use it in GitHub Desktop.
WiFiRetriesTerminalGraph
# In one terminal run the below (ensuring you have *wireshark/tshark* installed)...
# or you can backround the process too of course with '&' or 'screen'...
# but remember this will put your OSX radio in monitor mode until you stop the process :)
/usr/local/bin/tshark -q -i en1 -I -y IEEE802_11_RADIO -Tfields -e wlan.fc.retry > retries.dat
# In another terminal run the following (or create a script file) + ensure you have *gnuplot* installed :)
while true ; do tail -n 200 retries.dat | gnuplot -e "set term dumb size 100,40; set yrange [0:1.5]; plot '-' with linespoints" ; sleep 1 ; done
# And your output should look like this:
+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+
+ + + + + + + + + '-' **A*** +
1.4 ++ ++
| |
| |
| |
| |
1.2 ++ ++
| |
| |
| |
| |
1 ++ A A A A A AA A A A A ++
| * * * * * ** * * * * |
| * * * * * ** * * * * |
| * * * * * ** * * * * |
0.8 ++ * * * * * ** * * * * ++
| * * * * * ** * * * * |
| * * * * * ** * * * * |
| * * * * * ** * * * * |
| * * * * * ** * * * * |
0.6 ++ * * * * * ** * * * * ++
| * * * * * ** * * * * |
| * * * * * ** * * * * |
| * ** * * * * * *** * * * ** * * * * |
| * ** * * * * * *** * * * ** * * * * |
0.4 ++ * ** * * * * * *** * * * ** * * * * ++
| * ** * * * * * *** * * * ** * * * * |
| * ** * * * * * *** * * * ** * * * * |
| * ** * * * * * *** * * * ** * * * * |
0.2 ++ * ** * * * * * *** * * * ** * * * * ++
| * ** * * * * * *** * * * ** * * * * |
| * ** * * * * * *** * * * ** * * * * |
| * ** * * * * * *** * * * ** * * * * |
+ + * ** * + + + * * +* * *** +* * * + ** *+* * * +
0 AAAAAAAAAAAAAAAAAAA-AA-AAAAAAAAAAAAAAAAAAAAAAAAAAAA-AAAA-AAAAA-+AAAAA-AAAAAAAAAAA+AAA-AAAA+
0 10 20 30 40 50 60 70 80 90 100
# For bonus points try piping your graphs through 'lolcat' or make a percent counter and pass
# it through 'figlet' and 'localcat' :)
while true ; do tail -n 100 retries.dat | grep 1 | wc -l | awk '{print $1" % Retries"}' | figlet -ck | lolcat ; sleep 1 ; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment