Apache (.htaccess)
- Where to put it:
- .htaccess
- What to type:
-
<IfModule headers_module>
header set X-Clacks-Overhead "GNU Terry Pratchett"
</IfModule>
"You know they'll never really die while the Trunk is alive[...]
It lives while the code is shifted, and they live with it, always Going Home." - Moist von Lipwig, Going Postal, Chapter 13
In Terry Pratchett's Discworld series, the clacks are a series of semaphore towers loosely based on the concept of the telegraph. Invented by an artificer named Robert Dearheart, the towers could send messages "at the speed of light" using standardized codes. Three of these codes are of particular import:
When Dearheart's son John died due to an accident while working on a clacks tower, Dearheart inserted John's name into the overhead of the clacks with a "GNU" in front of it as a way to memorialize his son forever (or for at least as long as the clacks are standing.)
"A man is not dead while his name is still spoken." - Going Postal, Chapter 4 prologue
Keeping the legacy of Sir Terry Pratchett alive forever.
For as long as his name is still passed along the Clacks1,
Death can't have him.
1 Nowadays called the Internet.
<IfModule headers_module>
header set X-Clacks-Overhead "GNU Terry Pratchett"
</IfModule>
<configuration>
<system.webServer>
<httpProtocol>
<customHeaders>
<add name="X-Clacks-Overhead" value="GNU Terry Pratchett" />
</customHeaders>
</httpProtocol>
</system.webserver>
</configuration>
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
}
}
}
rspadd X-Clacks-Overhead:\ GNU\ Terry\ Pratchett
<customHeaders>
<add name="X-Clacks-Overhead" value="GNU Terry Pratchett" />
</customHeaders>
<apacheConf>
<IfModule headers_module> header set X-Clacks-Overhead "GNU Terry Pratchett" </IfModule>
</apacheConf>
server.modules += ( "mod_setenv" )
setenv.add-response-header = ( "X-Clacks-Overhead" => "GNU Terry Pratchett" )
add_header X-Clacks-Overhead "GNU Terry Pratchett";
sub vcl_fetch {
set beresp.http.X-Clacks-Overhead = "GNU Terry Pratchett";
}
New-TransportRule -Name "TerryPratchettClacksOverhead" -FromScope InOrganization -SetHeaderName "X-Clacks-Overhead" -SetHeaderValue "GNU Terry Pratchett"
headers_add = X-Clacks-Overhead: "GNU Terry Pratchett"
header_checks = regexp:/etc/postfix/header_checks
/^X-Clacks-Overhead:/ IGNORE
/^Content-Transfer-Encoding:/i PREPEND X-Clacks-Overhead: GNU Terry Pratchett
HX-Clacks-Overhead: "GNU Terry Pratchett"
custom_header X-Clacks-Overhead: GNU Terry Pratchett
/^X-Loop:/i PREPEND X-Clacks-Overhead: GNU Terry Pratchett
header_checks = regexp:/etc/postfix/header_checks
defaults write com.apple.mail UserHeaders '{"X-Clacks-Overhead" = "GNU Terry Pratchett";}'
public class ClacksOverheadHeaderFilter : ActionFilterAttribute
{
public override void OnActionExecuted(ActionExecutedContext filterContext)
{
filterContext.HttpContext.Response.Headers.Add("X-Clacks-Overhead", "GNU Terry Pratchett");
}
}
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 {}
}
<?php
if(!headers_sent()) {
header( 'X-Clacks-Overhead: GNU Terry Pratchett' );
}
return '';
?>
[[TerryPratchett]]
<!doctype html> ...
composer require lookyman/pratchett
extensions:
pratchett: lookyman\Pratchett\DI\PratchettExtension
<meta http-equiv="X-Clacks-Overhead" content="GNU Terry Pratchett" />
<?php header("X-Clacks-Overhead: GNU Terry Pratchett"); ?>
@app.after_request
def gnu_terry_pratchett(resp):
resp.headers.add("X-Clacks-Overhead", "GNU Terry Pratchett")
return resp
server.use(function (req, res, next) {
res.set('X-Clacks-Overhead', 'GNU Terry Pratchet');
next();
});
use Plack::Builder;
my $app = builder {
enable "Plack::Middleware::GNUTerryPratchett";
sub {[ '200', ['Content-Type' => 'text/html'], ['hello world']] }
};
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
MIDDLEWARE_CLASSES = (
...
'gnu_terry_pratchett.middleware.ClacksMiddleware',
),
(ns ring.app
(:require [ring.middleware.pratchett :refer [wrap-pratchett]]))
(def handler)
(def app
(-> handler
wrap-pratchett))
<meta http-equiv="X-Clacks-Overhead" content="GNU Terry Pratchett" />