Skip to content

Instantly share code, notes, and snippets.

# encoding: UTF-8
require 'logging'
log = Logging.logger['read_rate']
log.add_appenders(
Logging.appenders.file(
"1.log",
:layout => Logging.layouts.pattern(:pattern => '%m\n'),
:auto_flushing => 100
)
$ gnuplot
G N U P L O T
Version 4.6 patchlevel 0 last modified 2012-03-04
Build System: Linux x86_64
Copyright (C) 1986-1993, 1998, 2004, 2007-2012
Thomas Williams, Colin Kelley and many others
gnuplot home: http://www.gnuplot.info
require 'rubygems'
require 'benchmark/ips'
class ExampleClass
def foo; 42; end
end
module ExampleMixin
def foo; 43; end
end
sudo packer -S chruby
sudo packer -S ruby-build-git
sudo ruby-build 1.9.3-p374 /opt/rubies/ruby-1.9.3-p374
@bpot
bpot / a
Created January 25, 2013 21:02
a
@bpot
bpot / sched.md
Last active December 14, 2015 17:49

#Tuesday (3/12)

Mohawk (Outside)

  • 1:00pm - Lemuria

Valhalla

  • 5:00pm - Japanther
# Attempt to reproduce SSL_shutdown() hang. http://bugs.ruby-lang.org/issues/7584
require 'net/http'
require 'uri'
20.times do
Thread.new {
loop do
# Sorry google!
uri = URI.parse("https://www.google.com/")
http = Net::HTTP.new(uri.host, uri.port)

Dynotype

A write efficient implementation of large (consistent) sets on DynamoDB.

Why?

DynamoDB has built-in support for sets but if your sets are large (>1000 members) you quickly run into two issues:

  1. When calculating the cost of an item update AWS charges you based on the size of the item and not the size of the update. This makes even small additions to large sets expensive.

Kafka failures when sending to a single topic:

  • We can't connect to any brokers
  • We connect to a broker but cluster metadata fetch fails
  • Metadata doesn't know about topic
  • Metadata has no leader for that partition we want to send to
  • There is a leader for the partition but we can't connect to it
  • There is a leader for the partition and we sent the request but we timedout or the connection broke (unclear if success)
  • There is a leader for the partition and we sent the request but the broker returned an error
  • There is a leader for the partition, required_acks > 1 and we sent the request but the leader didn't receive acks in time.