By Susam Pal on 05 Apr 2025
“It’s essentially the Hacker News Hug of Deaf.”
–
@TonyTrapp
About three years ago, I set up a tiny netcat
loop on
one of my Debian servers to accept arbitrary connections from the
Hacker News (HN) community. The loop ran for 24 hours and did
exactly three things whenever a client connected:
-
Send a simple
ok
message to the client. - Close the connection immediately.
- Make my terminal beep four times.
That’s it! It was a playful experiment in response to a thread
about quirky, do-it-yourself alerting systems for friends and
family. See
this
HN thread for the original discussion. Here is the exact
command I ran on my server:
while true; do (echo ok | nc -q 1 -vlp 8000 2>&1; echo; date -u) | tee -a beeper.log; for i in 1 2 3 4; do printf '\a'; sleep 1; done & done
The nc
command closes the connection immediately after
sending the ok
message and runs an
inner for
loop in a background shell that
asynchronously prints the bell character to the terminal four times.
Meanwhile, the outer while
command loops back quickly
to run a new nc
process, thus making this one-liner
script instantly ready to accept the next incoming connection.
Soon after I shared this, members of the HN community began
connecting to the demo running on susam.net:8000
.
Anyone on the Internet could use any client of their choice to
connect. Here’s how I explained it in the HN thread:
Now anytime someone connects to port 8000 of my system
by any means, I will hear 4 beeps! The other party can
use whatever client they have to connect to port 8000 of
my system, e.g., a web browser,nc HOST
,
8000curl HOST:8000
, or even,ssh HOST
,
-p 8000irssi -c HOST -p 8000
, etc.
In the next 24 hours, I received over 4761 connections, each one
triggering four beeps. That’s a total of 19044 terminal beeps
echoing throughout the day!
The data for the above graph is available in
beeper.log.
Now, 4761 isn’t a huge number in the grand scheme of things, but it
was still pretty cool to see people notice an obscure comment buried
in a regular HN thread, act on it, and make my terminal beep
thousands of time.
At the end of the day, this was a fun experiment. Pointless, but
fun! Computing isn’t always about solving problems. Sometimes,
it’s also about exploring quirky ideas. The joy is in the
exploration, and having others join in made it even more enjoyable.
Activities like this keep computing fun for me!