Skip to content

Instantly share code, notes, and snippets.

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: 10.128.0.14, Dst: 10.128.0.28
Transmission Control Protocol, Src Port: 41090, Dst Port: 26257, Seq: 13781, Ack: 9845, Len: 108
PostgreSQL
Type: Parse
Length: 79
Statement:
Query: SET SESSION CHARACTERISTICS AS TRANSACTION ISOLATION LEVEL SERIALIZABLE
Parameters: 0
### Keybase proof
I hereby claim:
* I am bdarnell on github.
* I am bdarnell (https://keybase.io/bdarnell) on keybase.
* I have a public key ASCyOPV6SzNXv7CtLZJ_z_8Z0CUqe5Y1TX4iqDF03kYlPQo
To claim this, I am signing this object:
package main
import (
"context"
"fmt"
"math/rand"
"net"
"sync"
"time"
)
@bdarnell
bdarnell / demo.py
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
bdarnell / README.md
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 init.sh once, then run start.sh 1, start.sh 2, and start.sh 3 in separate terminals. After that, run shell.sh to start a SQL shell.

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

@bdarnell
bdarnell / cockroach-cla.md
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
bdarnell / run.py
Created February 25, 2015 03:14
Python yield_loop macro
import macropy.activate
import test
@bdarnell
bdarnell / streaming.py
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
bdarnell / ssltest.py
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
bdarnell / coop.py
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):
self.stream = stream
self.header_future = Future()
self.chunk_future = None
self.read_ready = Future()