Skip to content

Instantly share code, notes, and snippets.

View mnot's full-sized avatar

Mark Nottingham mnot

View GitHub Profile
@mnot
mnot / kindle_my_rfc.sh
Created March 12, 2011 01:06
Quick and dirty way to get Internet-Drafts onto your kindle
#!/bin/sh
# Kindle My RFC (or Internet-Draft)
#
# Sends an Internet Draft to your kindle
# Invocation:
# > kindle_my_rfc [path/to/rfc2629-xml-file]
# > kindle_my_rfc [draft-name-with-number-00]
#
# Requires:
@mnot
mnot / sun buffering goes wild
Created August 11, 2011 02:32
The raw HTTP of a GET response from http://www.sun.com/ (before the Oracle acquisition), reproduced here in its entirety.
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
@mnot
mnot / weird_date
Created April 18, 2012 16:07
IIS Split date line - only on partial responses, one site
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 / htlook.py
Last active December 16, 2015 09:19
Summarise how a list of HTTP servers handles a particular request to a set of URLs.
"""
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 / ietf_flying_times.js
Created June 4, 2013 02:51
Figure out how long it takes to get to a set of airports from a "home" location.
#!/usr/bin/env node
var argv = require('optimist').argv
var http = require('http');
var $ = require('jquery');
var ietf_airports = {
IETF_airports: [
@mnot
mnot / csp violations
Last active January 14, 2016 21:51
One day's worth of CSP violations injected by toolbars and various other *ware
129 times:
<safari-extension://com.evernote.safari.clipper-q79wdw8yh9>
96 times:
<safari-extension://com.ideashower.pocket.safari-et279a6r5n>
88 times:
<>
34 times:
@mnot
mnot / isodate.py
Created December 1, 2009 05:28
isodate.py: W3C datetime functions
#!/usr/bin/env python
"""
isodate.py
Functions for manipulating a subset of ISO8601 date, as specified by
<http://www.w3.org/TR/NOTE-datetime>
Exposes:
- parse(s)
@mnot
mnot / apple_pipeline
Last active June 29, 2017 14:26
Apple doing HTTP pipeline testing
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 / req_hdrs.md
Last active July 7, 2019 11:23
Interesting request headers
  • X-FCCKV2 - Fortinet antivirus
  • Via - various (includ McAffee Web Gateway)
  • X-Bluecoat-Via
  • X-Cool-Jobs-Contact - meraki
  • X-OSSProxy - marketscore spyware
  • X-Forwarded-For

In response to the Call for Proposals to HTTP/2, PHK published a draft with a number of suggested requirements.

This is a summary of those requirements, indicating those that have been met.

  • 3.3 Avoid header field encodings/transformations in intermediaries
  • 3.3 and 9 Envelope / content header field distinction
  • 3.3 Add session as "flow-label"
  • 3.3 Use prefix coding for length
  • 3.3 Indicate presence of body clearly
  • 4 Support legitimate cryptography