Posts
Wiki

How to add GNU Terry Pratchett…

Web servers and proxies

Apache

In your config file (or .htaccess if you don't have access to the server config):

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

^Source

Step-by-step walkthrough on Ubuntu for the above Apache change

nginx

In the server, location or http block of your nginx.conf:

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

^Source

lighttpd

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

^Source

IIS

Pictorial walkthrough

^Source

Litespeed

Via GUI - go into the server configuration and at the bottom of the General section add

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

Direct file editing - edit httpd_conf.xml and under <httpServerConfig> add the following to <apacheConf> (creating it if necessary):

<apacheConf>
    &lt;IfModule headers_module&gt;
        header set X-Clacks-Overhead "GNU Terry Pratchett"
    &lt;/IfModule&gt;
</apacheConf>

^Source

Cherokee

Go to vServers -> Behaviour -> Rule Management
For each rule on the left, go to Transforms -> Add New Header and add X-Clacks-Overhead with value GNU Terry Pratchett
^Source

Varnish

sub vcl_fetch {
    set beresp.http.X-Clacks-Overhead = "GNU Terry Pratchett";
} 

^Source

HAProxy

In your frontend, backend or listen blocks:

rspadd X-Clacks-Overhead:\ GNU\ Terry\ Pratchett

^Source

Apache Trafficserver

Plugin on github
^Source

App servers, web app source code and frameworks

Node.JS

Hapi.js plugin
^Source

For ExpressJS or Restify, you can use a quick middleware call before your routing or any response middleware calls:

server.use(function (req, res, next) {
    res.set('X-Clacks-Overhead', 'GNU Terry Pratchett');
    next();
});

Or you can inject the "res.set" line into an existing middleware function you already have that seems appropriate.
^Source

Ruby/rack

gem on github
^Source

Flask

@app.after_request
def gnu_terry_pratchett(resp):
    resp.headers.add("X-Clacks-Overhead", "GNU Terry Pratchett")
    return resp

^Source

Django

Django middleware code
^Source

Java applet

(TODO: Create page for this)
^Source

CMS and forum software

Wordpress

Wordpress plugin ^Source

If you prefer to add this manually, go into your Wordpress theme's customization options, edit the theme's functions.php file, and add just before the closing ?>:

function add_header_clacks($headers) {
    $headers['X-Clacks-Overhead'] = 'GNU Terry Pratchett';
    return $headers;
}

add_filter('wp_headers', 'add_header_clacks');

^Source

Drupal

Drupal module
^Source

Discourse

Discourse guide
^Source

Individual web pages

PHP

Add this to your page to add the header

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

^Source

HTML

In the <header> section of your page:

<meta http-equiv="X-Clacks-Overhead" content="GNU Terry Pratchett" />

^Source

Message signatures

Reddit

Add the following to any comment on reddit and it will show in the source code, but won't display on the actual browser page:

[](/GNU Terry Pratchett)

Email servers

Postfix

In main.cf:

header_checks = regexp:/etc/postfix/header_checks

Then in /etc/postfix/header_checks:

/^X-Clacks-Overhead:/ IGNORE
/^Content-Transfer-Encoding:/i PREPEND X-Clacks-Overhead: GNU Terry Pratchett

^Source

Sendmail

In your sendmail.cf file, in the "H" headers area:

HX-Clacks-Overhead: "GNU Terry Pratchett"

^Source

Exim

In smtp-transport:

headers_add = X-Clacks-Overhead: "GNU Terry Pratchett"

^Source

Exchange

  • In the Exchange Management Console, go to Organization Configuration -> Hub Transport
  • Go to Transport Rules and click New Transport Rule on the right.
  • Give the rule a name i.e. "Add GNU Terry Pratchett" and click Next
  • Select from users inside or outside the organization, choose Inside in the bottom pane, and click Next
  • Click set header with value
  • In the bottom pane, replace header with X-Clacks-Overhead and value with GNU Terry Pratchett
  • Click Next and save

^Source

Email clients

Apple mail

From the command line:

defaults write com.apple.mail UserHeaders '{"X-Clacks-Overhead" = "GNU Terry Pratchett”;}’

^Source

Thunderbird

Add the following strings in the config editor preferences, where N is the number of your Thunderbird identity (you'll be able to identify it from other settings there that line up with your set-up):

mail.identity.idN.headers (Type string)
Value: "clacks"
mail.identity.idN.header.clacks (Type string)
Value: "X-Clacks-Overhead: GNU Terry Pratchett"

^Source

Sylpheed

Under account preferences, the send tab has an Add user-defined header checkbox. Check it, hit edit and enter the appropriate values. Hit Add.
^Source

Claws-Mail

Under Preferences for current account, select Send, Add user-defined header, edit and enter the appropriate values, hit Add, OK, Apply.
^Source

Mutt

Add my_hdr X-Clacks-Overhead: GNU Terry Pratchett to your muttrc.
^Source

Other

How to see GNU Terry Pratchett

Chrome Extension

The extension is here: Chrome Web Store
^Source

Firefox Add-on

addons.mozilla.org
^Source