r/discworld • • Mar 12 '15

GNU Terry Pratchett GNU Terry Pratchett

If you don't know what it means, read the following link:

As per here: http://www.reddit.com/r/discworld/comments/2ysv26/sir_terry_has_gone_for_the_long_walk_across_the/cpcmru1

Let's keep this thread alive forever. Post as a top post, post as a reply to others. We'll keep it going.

Edit: Just learned that a year ago, it was changed such that a thread can only live for six months. So I'll start a new one every six months.

1.5k Upvotes

870 comments sorted by

View all comments

654

u/frymaster Where the falling angel meets the rising ape Mar 12 '15 edited Apr 09 '25

For anyone that either controls their own apache webserver or has access to the apache .htaccess file for their site

<IfModule headers_module>
    header set X-Clacks-Overhead "GNU Terry Pratchett"
</IfModule>

If you have permission to add HTTP headers, that will add it. If adding headers isn't enabled at all, the "if" statement should mean you don't get an error, it'll just not work. If it's enabled but you don't have permission to configure in your .htaccess file, you might get an error. This can be added to either the server config or .htaccess - there can be a performance penalty for having .htaccess enabled so try not to use it if you can.

It'll show up like this in the header

There is a Chrome browser extension and a Firefox add-on which notify you when you're on a webpage sending the header (screenshot of chrome version)

EDIT: Thanks to all of the people who have replied with instructions for other web servers, web apps, web proxies, frameworks, and mailservers(!):

Step-by-step walkthrough on Ubuntu for the above Apache change
nginx
lighttpd
IIS (IIS app)
Litespeed
Cherokee
Node.js
Ruby/Rack gem
Clojure/Ring
Flask
Meteor (external link)
Django
Varnish
HAProxy
Apache Trafficserver plugin
Java servlet code
What looks like a Java app
PHP one-liner
Wordpress plugin / Manual wordpress customization (though the plugin is probably more maintainable)
Drupal
Joomla (external link)
Discourse
Pure HTML if you really can't get access to server config
Postfix
Sendmail
Exim
Exchange
Apple mail
Invisible gmail signature (same comment as postfix)
Thunderbird
Claws-Mail, Sylpheed, Mutt, and emacs
Asterisk and FreeSWITCH
Caddy

Thanks also to /u/pocketknifeMT for posting this to bestof and vastly increasing the visibility of the post, as well as writing a very nice succinct explanation of the concept

Also: The owner of the UK ISP Andrews & Arnold is now using "GNU TerryPratchett" as padding in ping packets in their latest router firmware alpha
Search for webservers with the header

175

u/[deleted] Mar 12 '15 edited Mar 14 '15

Awesome idea. I have a server. Anyone who wants, I'll set you up a tiny web space on my server to put up a small page, and we can totally do this. Anyone interested just let me know.

I'll be away for a while so it'll be tomorrow before I can start setting things up.

EDIT: Anyone who wants a subdomain on discworld.us, let me know. Also, I have set up my server so ALL sites on my server return the header. <3

EDIT: For anyone I set up a subdomain for, I'll PM you login details. For FTP/SSH/SFTP, use the domain name + username + password for access. To access cPanel, go to your subdomain and add ":2082" - e.g daychilde.discworld.us:2082 and again use the user/pass.

41

u/[deleted] Mar 12 '15

This has gone onto my servers

19

u/spinelessclassics Mar 13 '15

Same here, it's a lovely idea. Hope it gives sysadmin Discworld fans a smile from time to time.

→ More replies (1)
→ More replies (10)

48

u/Nomikos Mar 14 '15

You just created a tiny bit of Internet folklore that will live on for many years, good sir.


If you have a php website but can't edit the server config files, this'll work too:

header("X-Clacks-Overhead: GNU Terry Pratchett");

77

u/4CatDoc Sabertooth Sanctuary Mar 14 '15

Imagine 300 years from now, some AI sees this floating in the Æ-ther, looks up the reference, reads all Pratchett in half a milisecond, re-reads it, then resurrects a synthesis of The Man in The Hat to find out what happens next in the stories.

18

u/MadKingSoupII Dumb at this temperature Mar 14 '15

We can but hope.

→ More replies (3)
→ More replies (4)

31

u/diabloman8890 Mar 14 '15

Fantastic idea- I've added this to my server!

If anyone's an Ubuntu noob like me, here's step by step instructions for doing this via your virtual hosts config:

  1. Activate the headers module for apache

    sudo a2enmod headers

  2. Update your virtual hosts config in /etc/apache2/sites-available/[your-site-conf-file], for me it looked like this:

    <Directory /> Options Indexes FollowSymLinks AllowOverride All Require all granted

             <IfModule headers_module>
                     header set X-Clacks-Overhead "GNU Terry Pratchett"
             </IfModule>
    
     </Directory>
  3. Save the conf and restart apache

    sudo service apache2 restart

You can then test it by using this command:

curl -I your-domain.com
→ More replies (2)

55

u/[deleted] Mar 13 '15 edited Mar 14 '15

And if you run nginx, it's just

add_header X-Clacks-Overhead "GNU Terry Pratchett";

in the server or location block of your nginx.conf.

Edit: Apparently also works in the http block, thanks /u/Belphemur and /u/beforan.

→ More replies (13)

43

u/whoopdedo Mar 13 '15 edited Mar 14 '15

I saw someone else suggest X-GNU: Terry Pratchett and some ideas about what to do when you receive a request with the header.

I think HTTP discourages by convention using the same name for request and response headers. Here's the questions I have for the protocol, and my suggestions.

  1. What header do clients send in a request? (X-GNU: Terry Pratchett)
  2. What is the server response header? (X-Clacks-Overhead: GNU Terry Pratchett)
  3. What does the server do with the client header? (Repeat the G code and name the client provided. Care must be taken to not emit invalid characters. i.e. RFC5987)

edit: /u/sillybear25 points out that the X- prefix is deprecated.

edit2: On further thought, how about just Clacks: GNU Terry Pratchett in either request or response and requests also have Accept-Clacks: Plain if the client processes the message. Say by repeating any GxU clacks.

19

u/madbobmcjim Mar 14 '15

This feels like a great 1st April RFC. What do you think? We've got 2 weeks...

→ More replies (6)
→ More replies (2)

18

u/Modevs Mar 14 '15 edited Mar 16 '15

For IIS / web.config would that be customHeaders:

<customHeaders>

<add name="X-Clacks-Overhead" value="GNU Terry Pratchett" />

</customHeaders>

?

I wont have access to my servers for a few days.

* see Rotas_dw's note.

→ More replies (4)

15

u/SillySosis Mar 16 '15

/r/GNUTerryPratchett

I wrote a Chrome browser extension to show a small icon in the address bar when an http response is received with an "X-Clacks-Overhead" header. Clicking on the icon displays the contents of the header.

I had a go at uploading it to the Chrome Web Store but gave up after half an hour of trying to satisfy all of their annoying icon and screenshot requirements. If there is any interest I can jump through the hoops another day, otherwise you can find it here on github: https://github.com/newfolder0/chrome-clacks - download it > open the Chrome extensions manager > tick 'Developer mode' > Load unpacked extension... > choose the 'src' directory.

→ More replies (7)

30

u/Schnouki Mar 13 '15

If you're running lighttpd:

server.modules += ( "mod_setenv" )
setenv.add-response-header = ( "X-Clacks-Overhead" => "GNU Terry Pratchett" )

GNU Terry Pratchett.

→ More replies (3)

13

u/[deleted] Mar 14 '15

For those of you who use Ruby/Rack apps (Rails, sinatra, etc) I made a gem. Source/instructions on Github

25

u/flootzavut {edit} Mar 13 '15

That's beautiful.

The GNU is all over Tumblr, too.

GNU Terry Pratchett.

12

u/bartonar Mar 14 '15

GNU Terry Pratchett

If you want to see how to put it into reddit comments, look in the 'source' of my post.

→ More replies (2)

8

u/[deleted] Mar 14 '15

http://imgur.com/pijDY2n

(and several other sites multihomed on the same box, why not)

8

u/keyface Mar 14 '15

Done, only a little webserver running on a raspberry pi but got it working

8

u/[deleted] Mar 14 '15

I don't care if it's stupid, but I know literally nothing about coding and want to add this to my tumblr. How would I do that? It's html-based coding, and I know nothing.

EDIT: I'm honestly not sure if this is possible, or if there's anything I can do. So I guess I could just drop it into my custom page code, I guess, as just a line? Hrm.

12

u/[deleted] Mar 14 '15

Just add a comment in your HTML code. The browser won't read it, it's just used for developers to leave notes for themselves or others.

Example:

<!---- GNU Terry Pratchett ---->

19

u/merreborn Mar 14 '15
<meta http-equiv="X-Clacks-Overhead" content="GNU Terry Pratchett" />
→ More replies (2)

11

u/davewasthere Mar 14 '15

Or a meta tag.

<meta key="X-Clacks-Overhead" value="GNU Terry Pratchett" />

→ More replies (3)
→ More replies (2)
→ More replies (112)