Bonum Certa Men Certa

Using a Single-Board Computer to Monitor IPFS

IPFS lights-based monitoring on self-hosted SBC
IPFS lights-based monitoring on self-hosted SBC (blue is for status, green and red for upstream and downstream payloads)



Summary: IPFS is light and simple enough to run from one's home, even on a low-voltage machine, and the code below can be used as a baseline for monitoring IPFS activity 24/7




#!/usr/bin/python3
# 2019-04-22
# 2020-11-07



from blinkt import set_pixel, show from random import randint,random,shuffle,randrange from time import sleep import argparse import signal

def solid(r,g,b,s): while True: for pixel in range(8): set_pixel(pixel, r, g, b) show() sleep(0.1)

def random_lights3(): while True: for pixel in range(8): r = randint(0, 255) g = randint(0, 255) b = randint(0, 255) set_pixel(pixel, r, g, b) show() sleep(0.1)

def random_lights2(): while True: p=range(8) p=sorted(p, key=lambda x: random()) for pixel in p: r = randrange(0, 255, 16) g = randrange(0, 255, 16) b = randrange(0, 255, 16) set_pixel(pixel, r, g, b) show() sleep(0.1)

def random_lights1(): while True: p=range(8) p=sorted(p, key=lambda x: random()) for pixel in p: r = randrange(0, 255, 8) g = randrange(0, 255, 8) b = randrange(0, 255, 8) set_pixel(pixel, r, g, b) show() sleep(0.1)

def spacer(r,g,b,seconds): while True: for pixel in range(8): set_pixel(pixel, r, g, b) next = (pixel+1)%8 set_pixel(next, 0, 0, 0) show() sleep(seconds)

def reversed_spacer(r,g,b,seconds): while True: for pixel in reversed(range(8)): set_pixel(pixel, r, g, b) prev = (pixel-1)%8 set_pixel(prev, 0, 0, 0) show() sleep(seconds)

def cylon(r,g,b,seconds): while True: for pixel in reversed(range(8)): set_pixel(pixel, r, g, b) prev = (pixel-1)%8 if prev < pixel: set_pixel(prev, 0, 0, 0) show() sleep(seconds) for pixel in range(8): set_pixel(pixel, r, g, b) next = (pixel+1)%8 if next > pixel: set_pixel(next, 0, 0, 0) show() sleep(seconds)

def pulsed_bar(r,g,b,seconds): steps=8 while True: for fade in reversed(range(steps)): r2=r*(fade+1)/steps g2=g*(fade+1)/steps b2=b*(fade+1)/steps # print (fade) for pixel in range(8): set_pixel(pixel, r2, g2, b2)

show() sleep(seconds) for fade in range(int(steps/1)): r2=r*(fade+1)/steps g2=g*(fade+1)/steps b2=b*(fade+1)/steps for pixel in range(8): set_pixel(pixel, r2, g2, b2)

show() sleep(seconds*0.5)

def ipfs(r,g,b,seconds): steps=4 # how many stages in gradient brightness=0.5 # how bright the lights will get bluebright=100 # the brightness of the blue light in the middle (0-255), albeit overriden by input dim=1 # increase to dim down the lights run = 0 # running count for periodic file access while True: # run always (until interruption) run=run+1 # first, open from files the required values, which change over time if (int(run) % 50 == 1): with open(r'~/RateIn', 'r') as f: # open from file the IN value # print(r) lines = f.read().splitlines() r=int(lines[-1]) # read the value # r=int(map(int, f.readline().split())) # prototype, for multiples (stale)

with open(r'~/RateOut', 'r') as f: # open from file OUT value # print(g) # show values, debugging lines = f.read().splitlines() g=int(lines[-1])

with open(r'~/Swarm', 'r') as f: # open from file Swarm value # print(g) # show values, debugging lines = f.read().splitlines() bluebright=int(lines[-1])/2 # print(bluebright)

for fade in reversed(range(steps)): # fade in effect # print(g2) # show values again, debugging # print(r2) r2=r*(fade+1)/steps/dim g2=g*(fade+1)/steps/dim b2=b*(fade+1)/steps/dim

# print(g2) # show values again, debugging # print(r2)

# print (fade) for pixel in range(3): # first 3 LED lights set_pixel(pixel, r2/20, (g2*brightness)+(pixel*1), b2/20)

for pixel in range(5,8): # the other/last 3 lights set_pixel(pixel, (r2*brightness)+(pixel*1), g2/20, b2/20) if (bluebright==0): set_pixel(3, 255, 255, 255) set_pixel(4, 255, 255, 255) else: set_pixel(3, 0, 0, 0) set_pixel(4, 0, 0, bluebright)

show() sleep(seconds/r*r+0.1) for fade in range(int(steps/1)): # fade out effect r2=r*(fade+1)/steps/dim g2=g*(fade+1)/steps/dim b2=b*(fade+1)/steps/dim

for pixel in range(3): set_pixel(pixel, r2/20, (g2*brightness)+(pixel*1), b2/20)

for pixel in range(5,8): set_pixel(pixel, (r2*brightness)+(pixel*1), g2/20, b2/20) set_pixel(3, 0, 0, bluebright) set_pixel(4, 0, 0, 0) show() sleep(seconds/g*g+0.1)

def flashed_bar(r,g,b,seconds): while True: for half in range(4): set_pixel(half,r,g,b) for half in range(4,8): set_pixel(half,0,0,0) show() sleep(seconds) for half in range(4,8): set_pixel(half,r,g,b) for half in range(4): set_pixel(half,0,0,0) show() sleep(seconds)

def handler(signum, frame): print("\nSignal handler called with signal", signum) exit(0)

signal.signal(signal.SIGTERM, handler) signal.signal(signal.SIGINT, handler)

# read run-time options

parser = argparse.ArgumentParser(description="Drive 'blinkt' 8-pixel display.") parser.add_argument("pattern", help="name of light pattern: \ random[1-3], spacer, reversed_spacer, cylon, pulsed_bar, flashed_bar") parser.add_argument("r", metavar="r", type=int, help="red channel, 0-255") parser.add_argument("g", metavar="g", type=int, help="green channel, 0-255") parser.add_argument("b", metavar="b", type=int, help="blue channel, 0-255") parser.add_argument("timing", metavar="s", type=float, \ help="rate of binking in seconds") options = parser.parse_args()

pattern = options.pattern.lower() r = options.r g = options.g b = options.b s = options.timing

if pattern == "solid": solid(r,b,g,s) elif pattern == "random3": random_lights3() elif pattern == "random2": random_lights2() elif pattern == "random1" or pattern == "random": random_lights1() elif pattern == "spacer": spacer(r,g,b,s) elif pattern == "reversed_spacer": reversed_spacer(r,g,b,s) elif pattern == "cylon": cylon(r,g,b,s) elif pattern == "pulsed_bar": pulsed_bar(r,g,b,s) elif pattern == "ipfs": ipfs(r,g,b,s) elif pattern == "flashed_bar": flashed_bar(r,g,b,s) else: print("Unknown pattern") exit(1)

exit(0)





Example runtime: run-blinkt-ipfs.py ipfs 0 0 0 0.00

Based on or derived from baseline blinkt scripts; requires the hardware and accompanying libraries being installed on the system.

For the code to run properly in the above form, given that it takes input from files, the IPFS values need to be periodically written to disk/card, e.g. for every minute of the day:

* * * * * ipfs stats bw | grep RateIn | cut -d ' ' -f 2 | cut -d '.' -f 1 >> ~/RateIn * * * * * ipfs stats bw | grep RateOut | cut -d ' ' -f 2 | cut -d '.' -f 1 >> ~/RateOut * * * * * ipfs swarm peers | wc -l >> ~/Swarm

These lists of numbers can, in turn, also produce status reports to be shown in IRC channels. When our git repository becomes public it'll be included (AGPLv3).

Recent Techrights' Posts

Symptom of Publishers Dying: They Move to Adopt Slop. Symptom of Software Companies Dying: They Move to Adopt Slop ('Vibe').
It'll always fail. It's hype. It's a bubble.
Under IBM, Red Hat Replaces Code With LLM Slop, Fedora is Slopware
Not even hiding it, those things are in plain sight
"systemd is essentially a corporate IBM/Redhat project and corporations of course will comply"
Microsoft and IBM care about users' freedom like Cheeto Lump cares about the US Constitution
Gemini Links 20/03/2026: Digital Identity Bifurcation and a "Return to Gemini"
Links for the day
 
SLAPP Censorship - Part 17 Out of 200: A Long Track Record of Online Abuse, Then Choosing a Low-Cost Law Firm to Muzzle People Who Have Illuminated This Abuse for Over a Decade
Censorship by targeting ISPs and webhosts isn't unprecedented
Plagiarism in "Linux" Clothing (LLM Slop in linuxiac.com, LinuxTeck.com, and linuxsecurity.com)
The net effect of those slopfarms is very negative
Links 20/03/2026: Facebook Weaponised Politically, Openwashing by LF and NVIDIA, Encyclopedia Britannica Sues Microsoft Proxy for Plagiarism
Links for the day
The EPO's Local Staff Committee Munich (LSCMN) Explains to the Administrative Council (AC) How Bad Things Have Become at Europe's Second-Largest Institution, Biggest Patent Office, and Corruption/Cocaine Hub (Jobs Sold to Friends)
We'll say a bit more tomorrow
IBM's Red Hat Diversity: Only 3 Women (Out of 11 Leaders)
For comparison's sake, the FSF is about 50% female
Gemini Links 20/03/2026: Depictions of Culture and The Social Smolnet
Links for the day
SimilarWeb Was Never a Reliable Yardstick for Traffic
5RB may need some "house-cleaning"
Strangulation, suffocation, Jonathan Carter & Debian toxic culture confirmed
Reprinted with permission from Daniel Pocock
Reports or Hearsay Suggest Ogilvy Broke Up With IBM and Insiders Report Mass Layoffs in "Infrastructure" (Might Impact Red Hat Entrants)
hearsay in Social Control Media
Scheduled Server Maintenance Tomorrow Night
Starting 9PM
None of the Above (NotA) & Debian snubbing Sruthi Chandran
Reprinted with permission from Daniel Pocock
Links 20/03/2026: Cryptography Pioneers Win Turing Award and BMG Sues Anthropic for Copyright Infringement
Links for the day
Even Uganda Understands That Journalists Never Belong in Prison
"Ugandan authorities must respect the spirit of this ruling and abandon any measures that seek to jail Ugandans for the free flow of ideas."
Inaction Helps Your Enemies
Without freedom, there's nothing else left
Windows Down From 99% to ~50% in Republic of Seychelles (République des Seychelles)
Windows fell by a lot
Confluent Insiders: IBM Laid Over Over 800 at Confluent, Not Just 800
For the record, the layoffs at Confluent won't be over. After the bluewashing there will be "IBM RAs" impacting Confluent folks, aside from PIPs
The Layoffs at IBM Carry on (Shades of Enron)
Is IBM another Enron?
"IBM boss Arvind Krishna... financial package valued at $38 million in calendar 2025 - equivalent to the average collective pay of 765 Big Blue workers."
continues to ruin the company to enrich himself while pretending he has a strategy
Over at Tux Machines...
GNU/Linux news for the past day
IRC Proceedings: Thursday, March 19, 2026
IRC logs for Thursday, March 19, 2026
SLAPP Censorship - Part 16 Out of 200: Detailing the Actors and Explaining Techrights' Own Internet Relay Chat (IRC) Network
For those who have not followed our story
Microsoft "hiding behind bigger news of war, Epstein, other companies' layoffs"
They know what's coming, they just don't know when
Joerg Jaspert (Debian Account Manager/DAM) personally approved Raphael Hertzog's wife Sophie Brun
Reprinted with permission from Daniel Pocock
Letter 'A' prohibited by Code of Conduct extremism
Reprinted with permission from Daniel Pocock
Spoiler: Diversity & Debian means different things to different people
Reprinted with permission from Daniel Pocock
Solicitors Regulation Authority (SRA) Admits Failures and Criticism of Inaction on SLAPPs
many if not all solicitors and solicitor firms in the UK are in effect unregulated
Archiving or Preserving Pages About IBM Layoffs
Layoffs at IBM and the media does not talk about these
ABC, the American National Broadcaster, "Now Publishes Slop"
If the "big media" absorbs slop, it'll no longer be trusted and therefore not read/watched by the public
Links 19/03/2026: Culling Deepfakes of Artists’ Music and "Age Verification Isn’t the Answer"
Links for the day
Gemini Links 19/03/2026: "Aktion GPT-4" and "Kill All Descendants"
Links for the day
"AI" 15 Times in Short 'Article' From The Register MS. And The Register MS Got Paid to Publish It.
gets paid to do this
People Who Decided to Boycott Novell Over Its Microsoft Alliance Should Also Boycott Canonical
As an associate put it, "selling out further, due to Microsoft moles inside Canonical"
Links 19/03/2026: "AI Glasses" as Euphemism for Mass Surveillance and ABC (US) Has Begun Publishing Slop as 'News'
Links for the day
The European Patent Office, Europe's Second-Largest Institution, is on Strike Today
Lots more to come
What People Impacted by the Bluewashing Layoffs at IBM Confluent Say (While the Media Says Nothing at All, in Effect Burying the News)
Worse yet, the mainstream media spreads lies about it right now
IBM Has Turned Red Hat and Fedora Into Slop
This is IBM policy
IBM is Being Robbed, Companies and Jobs Are Destroyed
Companies taken over by IBM will be exploited and destroyed to keep a bubble inflated for a little while longer
In Confluent Layoffs, IBM Vapourises a Quarter of Its Workforce (IBM Buys Something That It Destroys Already)
In the past, such things were typically referred to as "media blackout"; now it's just "the norm".
IBM Effect at Confluent: Mass Layoffs and IBM's Business Conduct Guidelines (BCGs) Said to be Violated
For Confluent employees who survived the layoffs there will be "culture chock"
Over at Tux Machines...
GNU/Linux news for the past day
IRC Proceedings: Wednesday, March 18, 2026
IRC logs for Wednesday, March 18, 2026
Links 19/03/2026: LLM Fatigue (It Doesn't Work as Advertised), "Small Web Feeds"
Links for the day
SLAPP Censorship - Part 15 Out of 200: Background and Particulars of Truth Regarding Techrights and Tux Machines
the basic facts (this has aged well, except the times/ages/numbers)
A Slopfarms Survey for Today (linuxteck.com, linuxsecurity.com, linuxjournal.com)
Not only did Google news link to a slopfarm; it linked to three run by the same team!
Links 18/03/2026: "Venture Capitalist Warns That It’s All About to Come Crashing Down" Due to Slop Bubble, "Birdwatching for Fun and no Profit"
Links for the day
IBM Red Hat is Still Promoting Restricted Boot Which Restricts Users' Control Over Their Computers
Red Hat under IBM is a total catastrophe
Arvind Says... Something Something "Hey Hi" (the State of Today's Media)
Look for news about IBM and most likely it'll boil down to some sound bites from an executive and nothing else
New Post Has Just Explained How IBM Gets Robbed by the People Who Fail IBM
Their plan for IBM is a personal plan
Slop-Spewing GAFAM LLM That Knows Nothing and Understands Nothing, It's a Stochastic Parrot That Cannot Even Figure Out Tux Machines is a Community That Started in Tennessee 22 Years Ago
RMS rightly calls those things "bullshit generators"
Cusdeb Makes New Presentation About Where GNU Hurd (Still a Possible Linux Replacement) Stands in 2026
coming from a generally RMS-friendly account
Gemini Links 18/03/2026: Librarians, Phone Anxiety, Growing 'Small' Net, and Slop Versus Software Engineering
Links for the day
Estimates That IBM to Lay Off Close to 10,000 Workers in 2026 (Not Counting People Pushed Out)
There's still chatter about Confluent mass layoffs
Smug Threat by Garrett to Put My Family and I in Prison Doesn't Prove We Did Anything Wrong, It Only Proves He's Truly Desperate to Stop Further Publications That Embarrass Him
his reputation is poor in the United States
systemd Increasingly Microsoft Project, Controlled by Microsoft and Slopware
Cannot allow choice
What IBM Meant to Red Hat: "Proprietary Bundling, Restricted Source Access"
Anyone or anything that joins IBM likely shortens its lifespan
IBM Thrashing Confluent Upon Arrival, Based on Rumours
We deem it a bigger issue that investigative journalism perished, not that one must rely on hearsay online or mere "rumours"
Slop Is Plagiarism, Not (Vibe) Coding, and It's Not Automated, It Doesn't Save Money
Reject misnomers, explain what's actually happening
UPC is Still Illegal and Unconstitutional (Kangaroo Court for Patents, Manned by Corporate Staff), Federal Court of Justice of Germany Receives Belated Complaint About It
What is happening to Europe???
EPO Demonstration Happening Right Now, Later This Week Things Will Only Escalate Further
The SUEPO The Hague Committee wrote to staff this morning
Sophie Brun, Raphael Hertzog & Debian sexual conflicts of interest
Reprinted with permission from Daniel Pocock
Links 18/03/2026: Commodore's Hedley Davis Dies, Apple Not Good Enough, Cheeto "Floats Treason Charges for Iran War Coverage"
Links for the day
A Step Close to Shutting Down the European Patent Office (EPO)
Not going to work all month long
EPO Staff Demonstration Today
The demonstration will be live-streamed for those thousands of colleagues who don't live in Munich
Gemini Links 18/03/2026: Brazilian SYN Attacks and BGP
Links for the day
LibreLocal Also Coming to Jordan, Kenya, Mexico, New Zealand, and Spain
It helps raise awareness of Software Freedom
Over at Tux Machines...
GNU/Linux news for the past day
IRC Proceedings: Tuesday, March 17, 2026
IRC logs for Tuesday, March 17, 2026