Skip to content

Instantly share code, notes, and snippets.

Ben Darnell bdarnell

Block or report user

Report or block bdarnell

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
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: 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
View gist:480931d642a781fad2bc03f0a5e1df25
### 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:
View spuriouswakeup.go
package main
import (
"context"
"fmt"
"math/rand"
"net"
"sync"
"time"
)
@bdarnell
bdarnell / demo.py
Created Jul 25, 2016
Tornado monitoring wrappers (proof of concept)
View demo.py
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 Sep 21, 2015
Scripts for running multi-node cockroachdb cluster
View README.md

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.

View cockroach-cla.md

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 Feb 25, 2015
Python yield_loop macro
View run.py
import macropy.activate
import test
@bdarnell
bdarnell / streaming.py
Created Jan 11, 2015
Demo of streaming requests with Tornado
View streaming.py
"""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
Test case for interrupted SSL handshake
View ssltest.py
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 Feb 17, 2014
Sketches of potential HTTPServer callback interfaces
View coop.py
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()
You can’t perform that action at this time.