1 Nowadays called the Internet.

Advertisement

Servers

+

Apache (.htaccess)

Where to put it:
.htaccess
What to type:
<IfModule headers_module>
  header set X-Clacks-Overhead "GNU Terry Pratchett"
</IfModule>
+

ASP.NET

Where to put it:
Web.config in the <configuration> section
What to type:
<configuration>
  <system.webServer>
    <httpProtocol>
      <customHeaders>
        <add name="X-Clacks-Overhead" value="GNU Terry Pratchett" />
      </customHeaders>
    </httpProtocol>
  </system.webserver>
</configuration>
+

Cherokee

How to make it go:
  1. Go to vServers > Behaviour > Rule Management
  2. For each rule on the left, go to Transforms > Add New Header
  3. Type "X-Clacks-Overhead" for the header and "GNU Terry Pratchett" for the value
+

F5 TMOS iRule

Where to put it:
Any virtual server with an HTTP profile
What to type:
when RULE_INIT {
  # Man's not dead while his name is still spoken.
  set static::clacks "{GNU Terry Pratchett} {GNU John Dearheart}"
}
when CLIENT_ACCEPTED {
  set clacks_enabled 1
}
when HTTP_REQUEST {
  # Per spec, clients can refuse all Clacks responses with an Accept-Clacks header of "no".
  if {[HTTP::header Accept-Clacks] == "no"} {
    set clacks_enabled 0
  }
}
when HTTP_RESPONSE {
  if {$clacks_enabled} {
    foreach clack $static::clacks {
      HTTP::header insert Clacks $clack
    }
  }
}
+

HAProxy

Where to put it:
Inside a listen, backend or frontend section
What to type:
rspadd X-Clacks-Overhead:\ GNU\ Terry\ Pratchett
+

IIS

Where to put it:
ApplicationHost.config but double-check with the IIS Manager for correct formatting
What to type:
<customHeaders>
  <add name="X-Clacks-Overhead" value="GNU Terry Pratchett" />
</customHeaders>
+

Azure (IIS)

You can connect your Azure website to an IIS administration console, then add the Clacks header through IIS.
  1. Connect your Azure website to the IIS admin console: Remote Administration of Windows Azure Websites using IIS Manager
  2. Add the Clacks header by following IIS above.
+

LiteSpeed

Where to put it:
httpd_conf.xml under the <httpServerConfig> section. Add the <apacheConf> if it doesn't already exist.
What to type:
<apacheConf>
  &lt;IfModule headers_module&gt; header set X-Clacks-Overhead "GNU Terry Pratchett" &lt;/IfModule&gt;
</apacheConf>
This is not a typo - make sure the <IfModule> tags have the HTML entities &lt; for < and &gt; for >.
+

lighttpd

Where to put it:
lighttpd.conf
What to type:
server.modules += ( "mod_setenv" )
setenv.add-response-header = ( "X-Clacks-Overhead" => "GNU Terry Pratchett" )
+

nginx

Where to put it:
either the server or location block of nginx.conf
What to type:
add_header X-Clacks-Overhead "GNU Terry Pratchett";
+

Varnish

Where to put it:
vcl_fetch subroutine of default.vcl
What to type:
sub vcl_fetch {
  set beresp.http.X-Clacks-Overhead = "GNU Terry Pratchett";
}

E-Mail Servers & Mailing Lists

+

Exchange

How to use it:
Use remote PowerShell
What to type:
New-TransportRule -Name "TerryPratchettClacksOverhead" -FromScope InOrganization -SetHeaderName "X-Clacks-Overhead" -SetHeaderValue "GNU Terry Pratchett"
+

Exim

Where to put it:
/etc/mail/exim.conf in the Transports Configuration section
What to type:
headers_add = X-Clacks-Overhead: "GNU Terry Pratchett"
+

Postfix

Step 1: Where to put it:
/etc/postfix/main.cf
Step 1: What to type:
header_checks = regexp:/etc/postfix/header_checks
Step 2: Where to put it:
/etc/postfix/header_checks
Step 2: What to type:
/^X-Clacks-Overhead:/ IGNORE
/^Content-Transfer-Encoding:/i PREPEND X-Clacks-Overhead: GNU Terry Pratchett
+

Sendmail

Where to put it:
sendmail.cf in the H section
What to type:
HX-Clacks-Overhead: "GNU Terry Pratchett"
How to make it go:
Restart Sendmail
+

Sympa Mailing List Server

To add to the headers of a single mailing list:
  1. Go to the list's admin page
  2. Go to "Edit List Config"
  3. Go to "Sending/Receiving Setup"
  4. Scroll down to "Custom Header Field (custom_header)"
  5. Enter X-Clacks-Overhead: GNU Terry Pratchett and save
To add to outgoing headers on all mailing lists:
  1. Edit your sympa.conf configuration file
  2. Add this line with a blank line above and below:
  3. custom_header X-Clacks-Overhead: GNU Terry Pratchett
To add to outgoing Sympa emails using Postfix
NOTE: the standard Sendmail way works with Sympa, but results in doubled headers - this instruction adds a test to prevent that.
  1. Find your postfix directory (usually /etc/postfix)
  2. Add this line to header_checks: /^X-Loop:/i PREPEND X-Clacks-Overhead: GNU Terry Pratchett
  3. Make sure this line in main.cf is not commented out: header_checks = regexp:/etc/postfix/header_checks
  4. Reload Postfix: /etc/init.d/postfix reload

Browsers and E-Mail Clients

+

Apple Mail

What to do:
Open Terminal
What to type:
defaults write com.apple.mail UserHeaders '{"X-Clacks-Overhead" = "GNU Terry Pratchett";}'
How to make it go:
Restart Mail
+

GMail

NOTE
Seems like this only works once (source), then GMail will remove the empty link from your signature. If you want it to be permanent, the "display text" will have to be more substantial than a space, like a period or something.
Where to put it:
GMail settings » General tab » Signature block
How to do it:
  1. Add a "link" anywhere in your signature
  2. In the "Text to display" field, enter one lone space
  3. Leave "Link to" selected on the default "Web address"
  4. In the "Link" field, type X-Clacks-Overhead: GNU Terry Pratchett
Pictures are worth 1,000 words:
Picture of the Add Link dialogue inside GMail
+

Chrome Plug-In

How to make it go:
Install from the Chrome Web Store: Clacks Overhead
+

Firefox Add-on

How to make it go:
Install from Firefox Add-ons: GNU_Terry_Pratchett
+

Gnus

Where to put it:
In your Gnus configuration file, typically ~/.gnus
What to type:
(setq message-default-headers (concat text!\n" "X-Clacks-Overhead: GNU Terry Pratchett\n"))
+

Mutt

Where to put it:
In your Mutt configuration file, typically $HOME/.muttrc (personal) or /etc/Muttrc or /etc/mutt/Muttrc (systemwide)
What to type:
my_hdr X-Clacks-Overhead: GNU Terry Pratchett
+

Safari Plug-In

Where to get it:
at Safari Extensions
+

Thunderbird

Where to find it:
Linux: Edit > Preferences > Advanced > General > Config Editor
Windows: Press Alt for the menu bar > Tools > Options > Advanced tab > General tab > Config Editor button
Step 1: Find your email account's identity ID
  1. In the search box, type your email address.
    Thunderbird
  2. In the above screenshot, the mailbox identity is "1". Change yours to suit in the following steps.
Step 2:
  1. Right-click inside the blank area > New > String.
  2. In the "New String Value" popup box, type mail.identity.id1.headers.
  3. In the "Enter String Value" popup box, type clacks.
Step 3:
  1. Right-click inside the blank area > New > String.
  2. In the "New String Value" popup box, type mail.identity.id1.header.clacks.
  3. In the "Enter String Value" popup box, type X-Clacks-Overhead: GNU Terry Pratchett.

CMSes and Frameworks

+

MediaWiki

Where to put it:
At the end of LocalSettings.php
What to type:
$wgExtensionFunctions[] = 'gnuTerryPratchett';
function gnuTerryPratchett() {
  global $wgOut;
  $wgOut->addMeta( 'X-Clacks-Overhead', 'GNU Terry Pratchett' );
}
+

WordPress Plug-In

How to make it go:
Install from the WordPress plugin repository: GNU Terry Pratchett
+

Drupal Module

How to make it go:
Install from the Drupal module repository: GNU Terry Pratchett Headers
+

Spark Framework (Java)

Where to put it:
At/near the end of your main()
What to type:
after((request, response) -> {
  response.header("X-Clacks-Overhead", "GNU Terry Pratchett");
});
+

Joomla Extension

How to make it go:
Install from the Joomla Extensions repository: Clacks Overhead
+

Magento

Where to get it:
Buro71a_XClacksPratchett on GitHub
How to use it:
Put all of the files under /src into your Magento root app folder. No other modifications are necessary.
+

ASP.NET MVC

Where to put it:
Add an instance in RegisterGlobalFilters
What to type:
public class ClacksOverheadHeaderFilter : ActionFilterAttribute
{
  public override void OnActionExecuted(ActionExecutedContext filterContext)
  {
    filterContext.HttpContext.Response.Headers.Add("X-Clacks-Overhead", "GNU Terry Pratchett");
  }
}
+

Spring Boot MVC

Example application:
package com.dearheart.gtsc.filters;

import java.io.IOException;

import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletResponse;

import org.springframework.context.annotation.Profile;
import org.springframework.stereotype.Component;

@Component
public class XClacksOverhead implements Filter {

  public static final String X_CLACKS_OVERHEAD = "X-Clacks-Overhead";

  @Override
  public void doFilter(ServletRequest req, ServletResponse res,
      FilterChain chain) throws IOException, ServletException {

    HttpServletResponse response = (HttpServletResponse) res;
    response.setHeader(X_CLACKS_OVERHEAD, "GNU Terry Pratchett");
    chain.doFilter(req, res);
  }

  @Override
  public void destroy() {}

  @Override
  public void init(FilterConfig arg0) throws ServletException {}

}
+

MODX

How to set it up:
Create a snippet called TerryPratchett:
<?php
  if(!headers_sent()) {
    header( 'X-Clacks-Overhead: GNU Terry Pratchett' );
  }

  return '';
?>
How to make it go:
At or near the top of your template(s):
[[TerryPratchett]]
<!doctype html> ...
+

Nette Extension

Where to get it:
X-Clacks-Overhead: GNU Terry Pratchett on GitHub
How to install it:
Install using Composer:
composer require lookyman/pratchett
Where to put it:
Register the extension in your config.neon:
extensions:
     pratchett: lookyman\Pratchett\DI\PratchettExtension

Scripts

+

HTML

NOTE:
Page headers are, by design, sent before the page content is. Using this meta tag will NOT trigger Clacks-Overhead recognition on any of the various browser plug-ins as it is sent AFTER the page headers have already been sent (and therefore cannot be modified). This should be the last resort if you have absolutely no other option to configure your webserver's page headers.
Where to put it:
in the <head> section of any .html file
What to type:
<meta http-equiv="X-Clacks-Overhead" content="GNU Terry Pratchett" />
+

PHP

Where to put it:
any .php file before you send headers
What to type:
<?php header("X-Clacks-Overhead: GNU Terry Pratchett"); ?>
+

Flask Decorator

Where to put it:
any .py file before you send headers
What to type:
@app.after_request
def gnu_terry_pratchett(resp):
  resp.headers.add("X-Clacks-Overhead", "GNU Terry Pratchett")
  return resp
+

Node.js

Where to put it:
before any routing or response calls
What to type:
server.use(function (req, res, next) {
  res.set('X-Clacks-Overhead', 'GNU Terry Pratchet');
  next();
});
+

Ruby/Rack/Rails Gem

How to make it go:
Source and instructions on Github
+

Perl (Plack)

Where to get it:
Install the Plack::Middleware::GNUTerryPratchett module
How to make it go:
use Plack::Builder;
my $app = builder {
  enable "Plack::Middleware::GNUTerryPratchett";
  sub {[ '200', ['Content-Type' => 'text/html'], ['hello world']] }
};
+

Python (Django)

Where to get it:
Install from PyPI: pip install django-GNU-Terry-Pratchett or install from GitHub: git clone git@github.com:aaronbassett/django-GNU-Terry-Pratchett.git
cd django-GNU-Terry-Pratchett
python setup.py install
Where to put it:
MIDDLEWARE_CLASSES in your Django settings
What to type:
MIDDLEWARE_CLASSES = (
  ...
  'gnu_terry_pratchett.middleware.ClacksMiddleware',
),
+

Clojure/Ring

Where to get it:
Install from GitHub
Where to install it:
Add this dependency [gsnewmark/ring-pratchett "0.1.0"] to your project.clj
Where to put it:
Add to your application's middleware stack
What to type:
(ns ring.app
  (:require [ring.middleware.pratchett :refer [wrap-pratchett]]))

(def handler)

(def app
  (-> handler
    wrap-pratchett))

Websites and Social Media

+

reddit

Where to put it:
In any text entry box on its own line
What to type:
[](/GNU Terry Pratchett)
+

Tumblr

NOTE:
Page headers are, by design, sent before the page content is. Using this meta tag will NOT trigger Clacks-Overhead recognition on any of the various browser plug-ins as it is sent AFTER the page headers have already been sent (and therefore cannot be modified).
Where to find where to put it:
  1. On your dashboard, click "Customize".
  2. Under your theme name, click "Edit HTML".
Where to put it:
in the <head> section
What to type:
<meta http-equiv="X-Clacks-Overhead" content="GNU Terry Pratchett" />
Finishing up:
  1. Click the "Update Preview" button. You shouldn't see any changes to your site.
  2. Click the "Save" button.

Other

+

Draft RFC

What it is:
Draft RFC to make the X-Clacks-Overhead: GNU Terry Pratchett header an Internet standard.
Where to go:
https://github.com/clacks-overhead/clacks-protocol/blob/master/middle.mkd