Skip to content

Instantly share code, notes, and snippets.

@Dharisd
Created June 30, 2026 17:41
Show Gist options
  • Select an option

  • Save Dharisd/c2e5583ebfbe212694572df20de9a182 to your computer and use it in GitHub Desktop.

Select an option

Save Dharisd/c2e5583ebfbe212694572df20de9a182 to your computer and use it in GitHub Desktop.
test.sh
watch -n 1 'python3 - <<EOF
iface="wlan0"
rx=int(open(f"/sys/class/net/{iface}/statistics/rx_bytes").read())
tx=int(open(f"/sys/class/net/{iface}/statistics/tx_bytes").read())
print(f"Downloaded: {rx/1024**3:.2f} GB")
print(f"Uploaded: {tx/1024**3:.2f} GB")
EOF'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment