Skip to content

Instantly share code, notes, and snippets.

View mnot's full-sized avatar

Mark Nottingham mnot

View GitHub Profile
@mnot
mnot / mod_loadshed.c
Created September 8, 2010 03:47
mod_loadshed.c
/**
* \file mod_loadshed.c
* \author Mark Nottingham, <mnot@mnot.net>
*
* mod_loadshed, when enabled, will refuse the request with a 503 if
* no additional Apache children are currently available. This should
* prevent requests from going to the listen queue.
*/
@mnot
mnot / chatterbox.py
Created September 6, 2010 09:56
Chatterbox - System monitoring through social networking
#!/usr/bin/env python
"""
Chatterbox - System monitoring through Social Networking.
Chatterbox uses Twitter, IM and eventually other "social" channels to
send you information about your systems, so that you can keep in touch
with how they're performing without lots of messages in your e-mail inbox
or on your pager.
@mnot
mnot / json_form.js
Created May 30, 2010 05:21
json_form.js - JSON Form Submission
/*
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 05:20
template_form.js - Templated form submission
/*
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 / http_autocomplete.js
Created May 30, 2010 05:19
http_autocomplete.js
/*
http_autocomplete.js
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 / invalidate_cache.js
Created May 30, 2010 05:16
invalidate_cache.js
/*
invalidate_cache.js -- HTML Includes (version 0.8)
Copyright (c) 2005-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 / redir_frag_test.py
Created March 13, 2010 00:11
Test for browser redirection handling WRT URI fragments, quick and dirty.
#!/usr/bin/env python
"""
Test for browser redirection handling WRT URI fragments, quick and dirty.
Usage:
./redir_frag_test.py hostname port_number
"""
import nbhttp # http://github.com/mnot/nbhttp
@mnot
mnot / xop_parser.py
Created December 27, 2009 10:33
xop_parser.py - A demonstration XOP Parser for SAX
#!/usr/bin/env python
"""
xop_parser.py - A demonstration XOP Parser for SAX
Based upon: http://www.w3.org/2000/xp/Group/3/06/Attachments/XOP.html
THIS SOFTWARE IS EXPERIMENTAL - INTERFACES MAY CHANGE AT ANY TIME.
CAVEATS / TODO:
- requires python 2.3 AFAIK
@mnot
mnot / feed_history.py
Created December 27, 2009 10:32
feed_history - demonstration implementation of incremental feed
#!/usr/bin/env python
"""
feed_history - demonstration implementation of incremental feeds.
See:
http://www.mnot.net/drafts/draft-nottingham-atompub-feed-history-07.txt
This is a SAMPLE ONLY. In particular, error handling is not robust, entry
combination is basic, and using pickle for persistence may cause problems
(e.g., unnecessary fetches when the class is changed).
@mnot
mnot / http_conn_timer.py
Created December 20, 2009 04:40
http_conn_timer.py: find out how long a HTTP server keeps connections open
#!/usr/bin/env python
"""
http_conn_timer.py
by Mark Nottingham <mnot@pobox.com>
How long does a given HTTP server hold persistent connections open?
Requires Twisted <http://twistedmatrix.com/>
"""