Skip to content

Instantly share code, notes, and snippets.

@ckowarzik
ckowarzik / snowstats.sh
Last active September 16, 2024 14:08 — forked from Atrate/snowstats.sh
Quick script to get the statistics of traffic on Tor Project's Snowflake proxy instance running locally on docker
#!/bin/bash
# docker logs example:
# 2023/12/30 19:37:09 In the last 1h0m0s, there were 62 connections. Traffic Relayed ↑ 1321997 KB, ↓ 165777 KB.
docker logs snowflake-proxy 2>&1 \
| grep "Traffic Relayed" \
| sed 's|^\(20[0-9]\{2\}/[0-9]\{2\}/[0-9]\{2\}\) .* there were \([0-9]\+\) connections. Traffic Relayed . \([0-9]\+\) \([KMG]\?B\), . \([0-9]\+\) \([KMG]\?B\).$|\1 \2 \3 \4 \5 \6|' \
| awk '
BEGIN {