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 / urlnorm.py
Created Dec 1, 2009
urlnorm.py: URL normalisation
View urlnorm.py
#!/usr/bin/env python
"""
urlnorm.py - URL normalisation routines
urlnorm normalises a URL by;
* lowercasing the scheme and hostname
* taking out default port if present (e.g., http://www.foo.com:80/)
* collapsing the path (./, ../, etc)
* removing the last character in the hostname if it is '.'
@mnot
mnot / uri_validate.py
Last active Jul 22, 2019
uri_validate.py: Validation regex for URIs, URI references, and relative URIs
View uri_validate.py
#!/usr/bin/env python
"""
Regex for URIs
These regex are directly derived from the collected ABNF in RFC3986
(except for DIGIT, ALPHA and HEXDIG, defined by RFC2234).
Additional regex are defined to validate the following schemes according to
their respective specifications:
@mnot
mnot / json_form.js
Created May 30, 2010
json_form.js - JSON Form Submission
View json_form.js
/*
json_form.js -- JSON Form Submission (version 0.5)
Copyright (c) 2006 Mark Nottingham <mnot@pobox.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
@mnot
mnot / template_form.js
Created May 30, 2010
template_form.js - Templated form submission
View template_form.js
/*
template_form.js -- Templated Form Submission (version 0.1)
Copyright (c) 2006 Mark Nottingham <mnot@pobox.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
@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
View phkh2.md

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
@mnot
mnot / req_hdrs.md
Last active Jul 7, 2019
Interesting request headers
View req_hdrs.md

Here Be Web Proxies

  • 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
@mnot
mnot / rename with date.applescript
Created Oct 29, 2009
Applescript to rename a selected file, appending the current date
View rename with date.applescript
(*
Rename with Date 0.1
Copyright 2004 Mark Nottingham <mnot@pobox.com>
THIS SOFTWARE IS SUPPLIED WITHOUT WARRANTY OF ANY KIND, AND MAY BE
COPIED, MODIFIED OR DISTRIBUTED IN ANY WAY, AS LONG AS THIS NOTICE
AND ACKNOWLEDGEMENT OF AUTHORSHIP REMAIN.
*)
@mnot
mnot / RSS.py
Created Oct 29, 2009
RSS.py: work with RSS channels as data structures
View RSS.py
#!/usr/bin/env python
"""
RSS.py
Classes for working with RSS channels as arbitrary data structures.
Requires Python 2.2 or newer and PyXML 0.7.1 or newer.
ChannelBase - Base class for RSS Channels.
CollectionChannel - RSS Channel modeled as a URI-per-entry
@mnot
mnot / http.rrtext
Last active Jan 30, 2019
Railroad diagrams of HTTP semantics
View http.rrtext
# Generated from the ABNF at <https://httpwg.org/http-core/draft-ietf-httpbis-semantics-latest.html#collected.abnf>
# using <https://github.com/katef/kgt>
Accept:
,---------------------------------------------------------------------------------------------------------------------------.
| |
||--^--v----------------- "," ------------------>--v------------------------------------------------------------------------->-->--||
| | | |
| ,-------------------. | | ,-----------------------------------------------. |
| | | | | | | |
You can’t perform that action at this time.