From f654b90ff115b824595732e4a87dd901686a9dc1 Mon Sep 17 00:00:00 2001 From: Jordan Date: Sun, 15 May 2022 18:33:15 -0700 Subject: tracker.jordan.im: usage graphs --- tracker.jordan.im/index.html | 54 +++++++++++++++++++++++++++++++++++++++ tracker.jordan.im/style.css | 1 + tracker.jordan.im/update-stats.py | 20 +++++++++++++-- 3 files changed, 73 insertions(+), 2 deletions(-) create mode 100644 tracker.jordan.im/index.html diff --git a/tracker.jordan.im/index.html b/tracker.jordan.im/index.html new file mode 100644 index 0000000..41ccd88 --- /dev/null +++ b/tracker.jordan.im/index.html @@ -0,0 +1,54 @@ + + + + + + + TRACKER.JORDAN.IM(7) + + + + + + + + +
TRACKER.JORDAN.IM(7)Miscellaneous Information ManualTRACKER.JORDAN.IM(7)
+
+
+

+tracker.jordan.im — +
a free and open bittorrent tracker
+
+
+

+udp://tracker.jordan.im:6969/announce +
+
+

+The tracker has been online for 308 hrs, serving 787590 torrents with 1984 connections per second. +
+
+

+This is a service known as a + bittorrent + tracker, which coordinates the reliable transmission of information + between peers. +

There is very little to be found here. There are no indexes or + search boxes. You need to speak the + bittorrent + protocol and have knowledge of a hash to make use of this service.

+
+
+

+cpu usage graph +net usage graph +
+ + + + + +
November 11, 2021Debian
+ + diff --git a/tracker.jordan.im/style.css b/tracker.jordan.im/style.css index 740b52f..2524976 100644 --- a/tracker.jordan.im/style.css +++ b/tracker.jordan.im/style.css @@ -20,3 +20,4 @@ a { color: var(--ansi4); } a:visited { color: var(--ansi5); } a.permalink { color: var(--ansi3); text-decoration: none; } +img { max-width: 80ch; width: 100%; height: auto; } diff --git a/tracker.jordan.im/update-stats.py b/tracker.jordan.im/update-stats.py index bc370b2..f0a1ec7 100755 --- a/tracker.jordan.im/update-stats.py +++ b/tracker.jordan.im/update-stats.py @@ -1,10 +1,12 @@ #!/usr/bin/env python3 import fileinput +import os +import shutil import sys import urllib.request -INDEX_PATH = '/var/www/html/tracker.jordan.im/index.html' +WWW = '/var/www/html/tracker.jordan.im' stats = dict.fromkeys(['torrents', 'connections', 'uptime']) @@ -30,10 +32,24 @@ s = ( f'with {stats["connections"]} connections per second.\n' ) -for line in fileinput.input([INDEX_PATH], inplace=True): +for line in fileinput.input([os.path.join(WWW, 'index.html')], inplace=True): if line.strip().startswith('The tracker has been'): line = s sys.stdout.write(line) +cpu = 'https://service.greenhost.net/cloud/Instance/graph?id=7615&template=cpu&timeframe=24' +conn = urllib.request.Request(cpu) +conn.add_header('Cookie', 'PHPSESSID=XXXXXXXXXXXXXXXXXXXXXXXXXX') + +with urllib.request.urlopen(conn) as r, open(os.path.join(WWW, 'cpu.png'), 'wb') as out: + out.write(r.read()) + +net = 'https://service.greenhost.net/cloud/Instance/graph?id=7615&template=net1&timeframe=24' +conn = urllib.request.Request(net) +conn.add_header('Cookie', 'PHPSESSID=XXXXXXXXXXXXXXXXXXXXXXXXXX') + +with urllib.request.urlopen(conn) as r, open(os.path.join(WWW, 'net.png'), 'wb') as out: + out.write(r.read()) + #import code #code.interact(local=locals()) -- cgit v1.2.3-54-g00ecf