Skip to content

Instantly share code, notes, and snippets.

View gist:f07d1cd944d7dc7c1c4a0ec15fd4d235
Frame 45647: 174 bytes on wire (1392 bits), 174 bytes captured (1392 bits)
Ethernet II, Src: 42:01:0a:80:00:01 (42:01:0a:80:00:01), Dst: 42:01:0a:80:00:1c (42:01:0a:80:00:1c)
Internet Protocol Version 4, Src:, Dst:
Transmission Control Protocol, Src Port: 41090, Dst Port: 26257, Seq: 13781, Ack: 9845, Len: 108
Type: Parse
Length: 79
Parameters: 0
View gist:480931d642a781fad2bc03f0a5e1df25
### Keybase proof
I hereby claim:
* I am bdarnell on github.
* I am bdarnell ( on keybase.
* I have a public key ASCyOPV6SzNXv7CtLZJ_z_8Z0CUqe5Y1TX4iqDF03kYlPQo
To claim this, I am signing this object:
View spuriouswakeup.go
package main
import (
bdarnell /
Created July 25, 2016 00:27
Tornado monitoring wrappers (proof of concept)
from tornado import gen
from tornado.httpclient import AsyncHTTPClient
from tornado.httpserver import HTTPServer
from tornado.ioloop import IOLoop
from tornado.options import define, options, parse_command_line
from tornado.web import RequestHandler, Application
define('port', default=8888)
define('trace', default=False)
bdarnell /
Created September 21, 2015 17:41
Scripts for running multi-node cockroachdb cluster

Run make build in the cockroach repo and copy the binary to ./bin/cockroach (relative to wherever you have downloaded these scripts).

Run once, then run 1, 2, and 3 in separate terminals. After that, run to start a SQL shell.

To wipe everything and start over, kill all the processes started by and delete the node* directories.

bdarnell /
Created July 21, 2015 17:22
Cockroach Labs CLA

Cockroach Labs, Inc.

Contributor License Agreement

Thank you for your interest in the open source project(s) managed by Cockroach Labs, Inc. (“Cockroach Labs”). In order to clarify the intellectual property license granted with Contributions from any person or entity, Cockroach Labs must have a Contributor License Agreement (“CLA”) on file that has been signed by each contributor, indicating agreement to the license terms below. This license is for your protection as a contributor as well as the protection of Cockroach Labs and its other contributors and users; it does not change your rights to use your own Contributions for any other purpose.

By clicking “Accept” on this page You accept and agree to these terms and conditions for Your present and future Contributions submitted to Cockroach Labs. In return, Cockroach Labs shall consider Your Contributions for addition to the official Cockroach Labs open source project(s) for which they were submitted. Except for the license granted herein to Cockroach

bdarnell /
Created February 25, 2015 03:14
Python yield_loop macro
import macropy.activate
import test
bdarnell /
Created January 11, 2015 21:23
Demo of streaming requests with Tornado
"""Demo of streaming requests with Tornado.
This script features a client using AsyncHTTPClient's body_producer
feature to slowly produce a large request body, and two server
handlers to receive this body (one is a proxy that forwards to the
other, also using body_producer).
It also demonstrates flow control: if --client_delay is smaller than
--server_delay, the client will eventually be suspended to allow the
server to catch up. You can see this in the logs, as the "client
bdarnell /
Created May 24, 2014 16:26
Test case for interrupted SSL handshake
import contextlib
import os.path
import socket
import ssl
import unittest
from tornado.iostream import SSLIOStream
from tornado import netutil, testing
from tornado.testing import AsyncTestCase, bind_unused_port
bdarnell /
Created February 17, 2014 19:11
Sketches of potential HTTPServer callback interfaces
from tornado.concurrent import Future
from tornado import gen
from somewhere import parse_headers
class HTTPReader(object):
def __init__(self, stream): = stream
self.header_future = Future()
self.chunk_future = None
self.read_ready = Future()