Skip to content

Instantly share code, notes, and snippets.

View cbd's full-sized avatar

Chad DePue cbd

View GitHub Profile
### Keybase proof
I hereby claim:
* I am cbd on github.
* I am chadd (https://keybase.io/chadd) on keybase.
* I have a public key whose fingerprint is 653A 9B02 9707 1CF2 8847 AC08 C084 E1E9 6DE7 928A
To claim this, I am signing this object:
This file has been truncated, but you can view the full file.
CodePath: ["/home/wuser/riak-1.2.0/rel/riak3/lib/appmon-2.1.14.1/ebin",
"/home/wuser/riak-1.2.0/rel/riak3/lib/asn1-1.8/ebin",
"/home/wuser/riak-1.2.0/rel/riak3/lib/basho_stats-1.0.2/ebin",
"/home/wuser/riak-1.2.0/rel/riak3/lib/bear-0.1-0-g7ef9a7b/ebin",
"/home/wuser/riak-1.2.0/rel/riak3/lib/bitcask-1.5.1/ebin",
"/home/wuser/riak-1.2.0/rel/riak3/lib/cluster_info-1.2.2/ebin",
"/home/wuser/riak-1.2.0/rel/riak3/lib/compiler-4.8.2/ebin",
"/home/wuser/riak-1.2.0/rel/riak3/lib/crypto-2.2/ebin",
"/home/wuser/riak-1.2.0/rel/riak3/lib/ebloom-1.1.1/ebin",
"/home/wuser/riak-1.2.0/rel/riak3/lib/edoc-0.7.10/ebin",
11:08:54.031 [error] Supervisor riak_core_sup had child riak_core_vnode_manager started with riak_core_vnode_manager:start_link() at <0.157.0> exit with reason no match of right hand value {error,{{badmatch,{error,{badarg,[{erlang,binary_to_term,[<<131,108,0,0,0,2,104,4,104,3,109,0,0,0,5,117,115,101,114,115,109,0,0,0,5,115,99,111,114,101,109,0,0,0,1,48,109,0,0,0,32,97,57,50,53,50,100,57,98,50,97,100,57,102,51,99,99,51,48,54,48,52,54,53,100,101,53,51,98,51,56,53,49,110,7,1,76,18,226,127,54,203,4,100,0,9,117,110,100,101,102,105,110,101,100,104,4,104,3,109,0,0,0,5,117,115,101,114,115,109,0,0,0,8,110,105,99,107,110,97,109,101,109,0,0,0,12,116,114,105,112,108,101,95,98,117,114,...>>],...},...]}}},...}} in riak_core_vnode_manager:get_vnode/3 line 489 in context child_terminated
@cbd
cbd / gist:3813735
Created October 1, 2012 19:01
riak timeouts
2012-10-01 00:00:14.766 [error] <0.9634.6>@riak_api_pb_server:handle_info:170
Unrecognized message
{pipe_log,#Ref<0.0.7.68217>,index,{trace,[error],{error,[{module,riak_kv_pipe_in
dex},{partition,685078892498860742907977265335757665463718379520},{details,[{fit
ting,{fitting,<0.16989.6>,#Ref<0.0.7.68217>,{chash,key_of},1}},{name,index},{mod
ule,riak_kv_pipe_index},{arg,undefined},{output,{fitting,<0.16985.6>,#Ref<0.0.7.
68217>,<<220,220,52,140,126,86,19,127,229,62,244,13,222,141,128,122,159,130,242,
94>>,1}},{options,[{sink,{fitting,<0.16985.6>,#Ref<0.0.7.68217>,<<220,220,52,140
,126,86,19,127,229,62,244,13,222,141,128,122,159,130,242,94>>,1}},{trace,{set,1,
16,16,8,80,48,{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]},{{[],[],[error],
@cbd
cbd / gist:3546684
Created August 31, 2012 00:41
elasticsearch failing example
curl -XDELETE localhost:9200/test
echo
curl -XPOST localhost:9200/test -d '{
"settings" : {
"number_of_shards" : 1
}
} '
sleep 1
curl -XPOST localhost:9200/test/tweet/_mapping -d '{
"pin" : {
@cbd
cbd / Lager.ex
Created May 17, 2012 21:26
wrapper for basho's lager in Elixir
defmodule Lager do
# debug | info | notice | warning | error | critical | alert | emergency
def debug msg do
Lager.log(:debug,msg)
end
def info msg do
Lager.log(:info,msg)
#!/bin/bash
export PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/X11/bin:/usr/local/sbin"
# Configure colors, if available.
if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
c_reset='\[\e[0m\]'
c_user='\[\033[1;33m\]'
c_path='\[\e[0;33m\]'
c_git_clean='\[\e[0;36m\]'
c_git_dirty='\[\e[0;35m\]'
else
-module(cacher).
-author(chad@inakanetworks.com).
-behaviour(gen_server).
%% API
-export([start/0,stop/0,cache/0]).
-export([init/1, handle_call/3, handle_cast/2, handle_info/2, terminate/2, code_change/3]).
-export([auction_state_json/1]).
-define(CACHING_INTERVAL,1000).
-define(STATS_INTERVAL,5 * 60 * 1000).
-module(event_test).
-behaviour(gen_event).
-export([run/0]).
%% gen_event callbacks
-export([init/1, handle_event/2, handle_call/2, handle_info/2, terminate/2, code_change/3]).
-record(state, {name :: atom()}).
%% @spec pmap(F, L, N) -> list(any())
%%
%% @doc A parallelized version of lists:map/2 that executes at most N
%% concurrent processes. This will perform much better than pmap/2
%% for long lists.
pmap(F, L, N) ->
pmap(F, L, N, []).
pmap(_F, [], _N, Acc) ->
ungather(Acc);