Skip to content

Instantly share code, notes, and snippets.

View andy-g's full-sized avatar

Andy Gardner andy-g

  • London
  • 08:17 (UTC)
View GitHub Profile

Keybase proof

I hereby claim:

  • I am andy-g on github.
  • I am andygardner (https://keybase.io/andygardner) on keybase.
  • I have a public key ASA2vTtZH6Htv3kS-s07NAZNQW0cBS6PAKCu8biikGmGHAo

To claim this, I am signing this object:

@andy-g
andy-g / usage_json.sh
Last active January 16, 2017 23:23
Per-user traffic monitoring script for OpenWRT
#!/bin/sh
echo 'Content-Type: application/json'
/usr/bin/wrtbwmon setup br-lan
/usr/bin/wrtbwmon update /tmp/user-usage.db
echo
echo { \"date\": $(date +%s), \"devices\": [
while IFS=, read MAC IN OUT LASTSEEN IP
do