A presence-aware break reminder

Most break reminders rely on a plain clock, so the alarm still fires the instant a fifty minute timer runs out, even if you spent thirty of those minutes away from the desk getting a coffee, because the timer has no way of knowing that you already sat back down. I already wear a smartwatch that vibrates on my wrist whenever I have been sitting too long, which helps, although it tracks the wrong thing, since it watches my wrist rather than my desk, so that a handful of arm movements is enough to convince it that I got up while I am still in the same chair, in front of the same screen. I am also the kind of person who concentrates hard enough to lose track of time entirely, so that eyestrain is usually the first sign I get that I went too far. Because I wanted something that watches the desk instead, I turned to a piece of 2009 e-waste sitting in the corner of it: a Samsung N130 netbook with a single core Intel Atom processor and 1GB of RAM. It runs Void Linux, and it is the same machine that I turned into a basement WiFi router a few months ago. I made it a desk sentinel that checks whether I am really sitting in front of the workstation, counts work time only while I am there, and speaks up once I stay too long. Image credits to: Bananayota, found on Pixabay TL;DR The basic idea: when something moves in the webcam frame, it means I am at the desk. If I stay at the desk too long without a break, the netbook speaks up. An old Samsung N130 netbook running Void Linux works as that desk sentinel. motion watches the built-in webcam and, on every start and stop of movement, writes active or idle into a plain state file. A small Nim daemon reads that file and tracks continuous desk time with a live one line progress bar, so that once the limit is reached, it calls espeak-ng and wall, while an absence under 5 minutes never resets the clock. Nothing is recorded, because the video feed never leaves the netbook and no frame is written to disk. The daemon runs as an unprivileged supervised runit service that costs 0.01% of one core and 2 MB of RAM, since motion is the real cost on this hardware. ...

September 6, 2026 · Andrea Manzini

automate OTP credentials for multi-factor authentication

Background: I work with one or more terminal command-line always opened and having to pick up my phone to generate an OTP breaks my flow; also it’s always nice to have an alternate source of multi-factor authentication if something bad happens, one day you could lose or break your trusty mobile device. Therefore I was looking for a way to login through Okta portals without a phone. You may argument that this defeats the whole meaning of MFA, but let’s say it’s only an hack for research and fun purpose … ...

June 14, 2022 · Andrea Manzini

Hijack C library functions in D

I like playing with the D programming language and I wrote this little post to show how it’s easy to create a dynamic library (shared object, .so) that can be invoked in other programs; to have a little fun we will write a D replacement for the rand() C standard library function call. For your convenience, all the code is also on github Let’s start with the demo implementation, a C program that calls 10 times the stdlib function rand() to get a random number. ...

March 10, 2020 · Andrea Manzini

a honeypot ssh server in Go

honey-ssh-pot Curious about who and how attempts ssh login to your home server ? Me too… So I wrote a very simple ssh honeypot, just to collect interesting info about the kind guys who knocks my door :) warning: this is safe, but don’t run the service (well, ANY service) as root user. Even better if you can run it as a dedicate unprivileged user. This program is only for didactic use and not intended for deployment in a production network environment. If you want to have it exposed on the public internet, you must map port 22 of your wan router to the internal server port ( 2222 by default)… Do it at your risk! ...

June 26, 2018 · Andrea Manzini
Buy Me a Coffee at ko-fi.com Buy Me A Coffee

This site does not use cookies or collect any personal data. © 2026 Andrea Manzini.