GNU Terry Pratchett

GNU Terry Pratchett
Photo by Alicia Christin Gerald / Unsplash

I do plan on writing some actually informative technical material for this blog and not just snarky stories about IT. I may as well start off with a fun one.

I'm sure many of you have read at least one Terry Pratchett novel and I'd put money on it being from the Discworld series, his most famous work.
For those that haven't had the pleasure of exploring Pratchett's work I'd implore you to visit your local book store and pick up something from the Discworld series, brand new or otherwise.

Discworld?

The premise for those uninitiated is that the titular environment consists of a planet sized disc with "Earth like" features resting on four elephants named "Berilia, Tubul, Great T'Phon, and Jerakeen". The elephants are stood on the back of a giant star turtle called "Great A'Tuin" which leisurely swims through space.

A'Tuin

Absurd? Yes.
Funny? Yes.
Science fantasy? Absolutely.
Inspired by the real world?
Also yes!
The premise of a world resting on the back of elephants and turtles draws from Hindu mythology among others.

I thought this blog was about IT?

Well you thought wrong buddy!

Actually no you would be correct, there is a connection between the late great Terry Pratchett and deep deep nerd culture. Terry was seen as an icon in sci-fi/fantasy and general nerdy circles, his legacy is testament to that with most people having at least heard of him or Discworld even if they may not have been exposed to his work directly.

As you can imagine with anything significantly impactful enough on the nerd zeitgeist people felt the need to immortalize Terry. Whilst his own literature does that to some extent, the internet felt the need for his legacy to transcend paper and it came in the form of a Reddit post: https://www.reddit.com/r/discworld/comments/2yt9j6/gnu_terry_pratchett/

The first comment is the relevant bit. I will attempt to break down the concepts and what it does next.

HTTP headers

You may have heard IT people refer to "headers" in different contexts, they appear in many computer based systems and communication protocols.
Essentially a header is extra data that can be placed at the beginning of a data block (Hence "head") to provide additional data/information to the sending or receiving application.

With HTTP headers this usually identifies various characteristics of the client or server so that either end can process and/or make decisions which may differ from request to request.
Some common headers are:

  1. The Accept header followed by a MIME type so the server knows what to send the client: Accept: application/json
  2. The Authorization header to send credentials to the server: Authorization: Basic SuperSecretToken
  3. The X-Forwarded-For header to allow a backend server to identify the connecting client's real IP address: X-Forwarded-For: 122.199.58.140

That last example is important, notice the "X" at the start, that indicates that at some point during the development of HTTP it was a non-standard header (It's very standard now).

Headers are just key-value pairs and since we have the "X" prefix they can be non-standard or custom too. See where I'm going with this?

Clacks

In Discworld there exists a network of Semaphore towers called "The Clacks" so named for their clicking sound as they send signals. This system was invented by a man named Robert Dearheart who lost his son to an accident on one of the Clacks towers. In an effort to keep the memory of his son alive, Robert encodes a message and sends it into the "Clacks" network.

GNU John Dearheart

G: Send the message onto the next Clacks Tower.

N: Do not log the message.

U: At the end of the line, return the message.

The code would keep the message bouncing around the Clacks network for as long as the network existed therefore immortalizing his son.

X-Clacks-Overhead

We don't have a Clacks network in real life...

We have better.

The Clacks network is almost certainly based on the internet albeit with more primitive technology.
Why not use the real "Clacks" to immortalize it's fictional counterpart's creator?

"A man is not dead while his name is still spoken."

Since we can send and receive any arbitrary HTTP headers and only action those we understand, why not send something to the requesting client that's benign but thoughtful? If we prefix it with "X" it will be considered to be a custom header and ignored by most clients.

So that's what we did.

Terry devised an in-universe way to immortalize a person. So too have we extended that method to the real world in the nerdiest way we know how.

Caddy

I must admit, I wasn't aware of this tribute to Terry until recently when I stumbled upon a blog post by a UK ISP who use this concept to pad out ICMP packets in their firewall firmware (Caution, exceedingly deep nerd stuff) https://www.revk.uk/2015/03/no-one-is-actually-dead-until-ripples.html.

As soon as I discovered it and traced the origin and lore I knew I had to implement it into my reverse proxy, Caddy.
A simple addition to the block for this blog allows Caddy to return the header:

        @blog host blog.feisar.xyz                                                  
        handle @blog {                                                              
                reverse_proxy 10.0.1.7:2368                                         
                header X-Clacks-Overhead "GNU Terry Pratchett"                      
        }

Caddy proxy block

If you load this site with your browser developer tools open (F12 or CTRL+SHIFT+I) and navigate to the network tab followed by clicking the first request at the top, you should see the added header as in the picture below.

Chrome dev tools

After I had confirmed it was working I submitted the URL to the list of sites carrying the torch: https://xclacksoverhead.org/listing/the-signal.

GNU

GNU Logo

There also exists another meaning to the three letters G N U, that of the GNU (Pronounced "guh-NEW") project.
In this instance GNU stands for "GNU's Not Unix", enjoying the recursion there?

This is a little nod towards the computing world from one nerd to many.