Skip to content

Instantly share code, notes, and snippets.

View wizzat's full-sized avatar

Mark Roberts Shah wizzat

View GitHub Profile
@wizzat
wizzat / psycopg2_performance.py
Created October 23, 2013 04:29
Psycopg2 vs Psycopg2cffi, Python 2.7.3 vs Pypy-2.0.1 benchmark
try:
from psycopg2cffi import compat
compat.register()
except ImportError:
pass
from pyutil.decorators import *
import tempfile, psycopg2, psycopg2.extras
def setup_test_table(conn):
@wizzat
wizzat / break_kafka.py
Created February 13, 2014 05:57
Permanently break kafka topics
# Null messages in Kafka permanently break a Kafka topic
# Reproduction Requirements:
# Install kafka-python (master is building towards 0.9, so use the kafka-0.8.0-release branch)
# Run a 3 node local kafka cluster (it may break with other sizes, but it is untested)
# Run a kafka SimpleConsumer (kafka-console-consumer works fine):
# kafka_2.8.0-0.8.0/bin/kafka-console-consumer.sh kafka-console-consumer.sh --topic some_topic --zookeeper localhost:2181 --from-beginning
# Run this:
import kafka