Skip to content

Instantly share code, notes, and snippets.

View paulbellamy's full-sized avatar

Paul Bellamy paulbellamy

View GitHub Profile
@paulbellamy
paulbellamy / gist:54d7d908d7ebce5bd2c0
Created June 23, 2014 08:43
How to lock up core.async
(import '[java.util.concurrent CountDownLatch])
(require '[clojure.core.async :as async])
(defn now []
(System/currentTimeMillis))
(defn waiter [i latch results]
(async/go
(swap! results conj [i :waiting (now)])
(.await latch) ;; Will block the thread
@paulbellamy
paulbellamy / generate_master_key.go
Created December 1, 2014 11:45
Bitcoin Key Generator (broken)
//usr/bin/env go run $0 $@
package main
import (
"encoding/hex"
"flag"
"fmt"
"os"
"github.com/conformal/btcnet"

Keybase proof

I hereby claim:

  • I am paulbellamy on github.
  • I am paulbellamy (https://keybase.io/paulbellamy) on keybase.
  • I have a public key whose fingerprint is 3E60 6446 06E5 A7DA 0E1E C190 F2F3 DFDF 2D4D 0C48

To claim this, I am signing this object:

@paulbellamy
paulbellamy / git_annex
Last active August 29, 2015 14:17
git annex assistant rc.d script
#!/bin/sh
# /etc/rc.d/git_annex
# PROVIDE: git_annex
# REQUIRE: LOGIN FILESYSTEMS NETWORKING
# KEYWORD: shutdown
. /etc/rc.subr
name="git_annex"
@paulbellamy
paulbellamy / bucket.rb
Created May 2, 2012 16:23 — forked from bjpirt/bucket.rb
Quick bucketing of PG logs
#!/usr/bin/env ruby
module Enumerable
# sum of an array of numbers
def sum
return self.inject(0){|acc,i|acc +i}
end
# average of an array of numbers
def average
@paulbellamy
paulbellamy / gist:2788108
Created May 25, 2012 13:18
cassandra 1.1.0 failure
Running official cassandra 1.1.0 binary
=======================================
at org.apache.cassandra.db.columniterator.SSTableSliceIterator.<init>(SSTableSliceIterator.java:58)
at org.apache.cassandra.db.filter.SliceQueryFilter.getSSTableColumnIterator(SliceQueryFilter.java:66)
at org.apache.cassandra.db.filter.QueryFilter.getSSTableColumnIterator(QueryFilter.java:78)
at org.apache.cassandra.db.CollationController.collectAllData(CollationController.java:233)
at org.apache.cassandra.db.CollationController.getTopLevelColumns(CollationController.java:61)
at org.apache.cassandra.db.ColumnFamilyStore.getTopLevelColumns(ColumnFamilyStore.java:1273)
at org.apache.cassandra.db.ColumnFamilyStore.getColumnFamily(ColumnFamilyStore.java:1155)
@paulbellamy
paulbellamy / gist:2819990
Created May 28, 2012 16:30
cassandra transport exception
/opt/ruby/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/thrift-0.8.0/lib/thrift/transport/socket.rb:109:in `read': CassandraThrift::Cassandra::Client::TransportException
from /opt/ruby/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/thrift-0.8.0/lib/thrift/transport/base_transport.rb:87:in `read_all'
from /opt/ruby/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/thrift-0.8.0/lib/thrift/transport/framed_transport.rb:104:in `read_frame'
from /opt/ruby/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/thrift-0.8.0/lib/thrift/transport/framed_transport.rb:69:in `read_into_buffer'
from /opt/ruby/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/thrift-0.8.0/lib/thrift/protocol/binary_protocol.rb:190:in `read_i32'
from /opt/ruby/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/thrift-0.8.0/lib/thrift/protocol/binary_protocol.rb:116:in `read_message_begin'
from /opt/ruby/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/thrift-0.8.0/lib/thrift/client.rb:45:in `receive_message'
from /home/paul/.bundler/ruby/1.9.1/c
@paulbellamy
paulbellamy / 'lein deps' output
Created August 16, 2012 11:34
Problem installing guava-collections
Retrieving com/google/guava/guava-collections/r03/guava-collections-r03.pom (1k)
from http://repo1.maven.org/maven2/
Checksum validation failed, expected eaa856fdfbf53342d48d9e48e09bb7056151beb5 but is 4542f475c395917cb2b572549e0804f23695a648
Retrieving com/google/guava/guava-collections/r03/guava-collections-r03.pom (1k)
from http://repo1.maven.org/maven2/
Could not transfer artifact com.google.guava:guava-collections:pom:r03 from/to central (http://repo1.maven.org/maven2): Checksum validation failed, expected eaa856fdfbf53342d48d9e48e09bb7056151beb5 but is 4542f475c395917cb2b572549e0804f23695a648
Could not find artifact com.google.guava:guava-collections:pom:r03 in clojars (https://clojars.org/repo/)
@paulbellamy
paulbellamy / gist:3496235
Created August 28, 2012 08:39
Ruby LolWut!?
irb(main):001:0> nil.foobar
NoMethodError: undefined method `foobar' for nil:NilClass
from (irb):1:in `evaluate'
from org/jruby/RubyKernel.java:1083:in `eval'
from /opt/ruby/jruby-1.6.7.2/lib/ruby/1.8/irb.rb:158:in `eval_input'
from /opt/ruby/jruby-1.6.7.2/lib/ruby/1.8/irb.rb:271:in `signal_status'
from /opt/ruby/jruby-1.6.7.2/lib/ruby/1.8/irb.rb:155:in `eval_input'
from org/jruby/RubyKernel.java:1410:in `loop'
from org/jruby/RubyKernel.java:1183:in `catch'
from /opt/ruby/jruby-1.6.7.2/lib/ruby/1.8/irb.rb:154:in `eval_input'
If nodetool repair has not been run often enough to the point that GCGraceSeconds has passed, you
risk forgotten deletes (see DistributedDeletes). In addition to data popping up that has been deleted,
you may see inconsistencies in data return from different nodes that will not self-heal by read-repair
or further nodetool repair. Some further details on this latter effect is documented in CASSANDRA-1316.