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:

@bpot
bpot / freeze.rb
Created March 6, 2015 01:56
Freezing MRI with FFI
require 'ffi'
module Block
extend FFI::Library
ffi_lib FFI::Library::LIBC
attach_function :sleep, [:uint], :void
end
ms.cio.huge@gmail.com

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.
bpot@zoho.bpot.io
bpotimaptest@outlook.com
bpotimaptest@yandex.com

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