Skip to content

Instantly share code, notes, and snippets.

Mark Nottingham mnot

Block or report user

Report or block mnot

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@mnot
mnot / fake_hdrs.py
Created Oct 24, 2014
Create some fake headers for HTTP/2 compression testing.
View fake_hdrs.py
#!/usr/bin/env python
from random import choice, sample, randrange
from string import lowercase
iterations = 10000
authorities = [
'www.foo.com',
'api1.backend.region.bar.com:8000',
@mnot
mnot / apple_pipeline
Last active Jun 29, 2017
Apple doing HTTP pipeline testing
View apple_pipeline
192.168.001.051.65156-023.015.188.224.00080: GET /configurations/pep/pipeline/pipeline0.html HTTP/1.1
Host: configuration.apple.com
Connection: Keep-Alive
GET /configurations/pep/pipeline/pipeline1.html HTTP/1.1
Host: configuration.apple.com
Connection: Keep-Alive
GET /configurations/pep/pipeline/pipeline2.html HTTP/1.1
Host: configuration.apple.com
@mnot
mnot / gist:9660370
Created Mar 20, 2014
HTTP:// over TLS proposal
View gist:9660370
<section anchor="opportunistic" title="Discovering TLS Support for http:// URIs">
<t>
A server wishing to advertise support for HTTP/2 over TLS for http:// URIs MAY do so by
including an Alt-Svc (see <xref target="AltSvc"/>) response header with the "h2" protocol
identifier.
</t>
<t>
For example, a HTTP/1 connection could indicate support for HTTP/2 on port 443 for use
with future http:// URI requests with this Alt-Svc header:
@mnot
mnot / github.sh
Created Mar 15, 2014
Git alias handler for github
View github.sh
#!/bin/sh
# Github Handler
#
# Add to your .gitconfig like this:
#
# [alias]
# hub = !"github"
@mnot
mnot / ietf_flying_times.js
Created Jun 4, 2013
Figure out how long it takes to get to a set of airports from a "home" location.
View ietf_flying_times.js
#!/usr/bin/env node
var argv = require('optimist').argv
var http = require('http');
var $ = require('jquery');
var ietf_airports = {
IETF_airports: [
@mnot
mnot / htlook.py
Last active Dec 16, 2015
Summarise how a list of HTTP servers handles a particular request to a set of URLs.
View htlook.py
"""
htlook.py
Summarise how a list of HTTP servers handles a particular request to a
set of URLs.
You can modify the request by either:
* Adding headers with the -a flag; e.g.,
@mnot
mnot / update.sh
Last active Jul 9, 2019
Update all projects in a directory from their master repositories.
View update.sh
#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
for PROJECT in $DIR/*
do
if [ -d $PROJECT ] ; then
cd $PROJECT
# Git
@mnot
mnot / iri_to_uri.py
Created Jan 20, 2013
Convert an IRI to a URI
View iri_to_uri.py
import urllib
import urlparse
def iri_to_uri(iri, encoding='Latin-1'):
"Takes a Unicode string that can contain an IRI and emits a URI."
scheme, authority, path, query, frag = urlparse.urlsplit(iri)
scheme = scheme.encode(encoding)
if ":" in authority:
host, port = authority.split(":", 1)
authority = host.encode('idna') + ":%s" % port
@mnot
mnot / weird_date
Created Apr 18, 2012
IIS Split date line - only on partial responses, one site
View weird_date
HTTP/1.1 206 Partial Content
Cache-Control: max-age=86400
Content-Type: text/css
Last-Modified: Mon, 15 Mar 2010 17:41:22 GMT
Accept-Ranges: bytes
ETag: "0cd3ba66c4ca1:0"
Server: Microsoft-IIS/7.5
X-Powered-By: ASP.NET
Connection: Keep-Alive
Date: Wed, 18 Apr 2012 16:20
@mnot
mnot / sun buffering goes wild
Created Aug 11, 2011
The raw HTTP of a GET response from http://www.sun.com/ (before the Oracle acquisition), reproduced here in its entirety.
View sun buffering goes wild
HTTP/1.1 200 OK
Server: Sun-Java-System-Web-Server/7.0
Date: Mon, 07 Dec 2009 07:25:34 GMT
P3p: policyref="http://www.sun.com/p3p/Sun_P3P_Policy.xml", CP="CAO DSP COR CUR ADMa DEVa TAIa PSAa PSDa CONi TELi OUR SAMi PUBi IND PHY ONL PUR COM NAV INT DEM CNT STA POL PRE GOV"
Cache-control: public
Set-cookie: JROUTE=W2VMz2yu926eYGvP; Path=/
X-powered-by: JSP/2.1
Set-cookie: JSESSIONID=80765ae114eab08df95a11208c62; Path=/
Content-type: text/html;charset=UTF-8
Via: 1.1 https-www
You can’t perform that action at this time.