Skip to content

Instantly share code, notes, and snippets.

curl http://localhost:6060/debug/pprof/goroutine?debug=2 | tee goroutine.txt | grep -A3 goroutine | grep ":" | sort | uniq -c | sort -rn | head

Keybase proof

I hereby claim:

  • I am bpot on github.
  • I am bpot (https://keybase.io/bpot) on keybase.
  • I have a public key whose fingerprint is A287 568E 79FA 759A 1300 8FC7 8B3D EF7D 9D8F B781

To claim this, I am signing this object:

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.
# 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)
@bpot
bpot / sched.md
Last active December 14, 2015 17:49

#Tuesday (3/12)

Mohawk (Outside)

  • 1:00pm - Lemuria

Valhalla

  • 5:00pm - Japanther
@bpot
bpot / a
Created January 25, 2013 21:02
a
sudo packer -S chruby
sudo packer -S ruby-build-git
sudo ruby-build 1.9.3-p374 /opt/rubies/ruby-1.9.3-p374
require 'rubygems'
require 'benchmark/ips'
class ExampleClass
def foo; 42; end
end
module ExampleMixin
def foo; 43; end
end
$ 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
# 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
)