Skip to content

Instantly share code, notes, and snippets.

View bcg's full-sized avatar

Brenden Grace bcg

View GitHub Profile
@bcg
bcg / core.clj
Created December 23, 2011 15:24
Clojure Zookeeper
(ns playbook.core
(:use compojure.core
playbook.views.index
[hiccup.middleware :only (wrap-base-url)]
[zookeeper :as zk])
(:require [compojure.route :as route]
[compojure.handler :as handler]))
(defroutes main-routes
(GET "/" [] (index-page))
@bcg
bcg / State
Created January 17, 2012 20:44
State System
An app, "counter" is registered in the DB:
counter.starts = hourly
counter.depends = {"adx": hourly, "retarget": hourly}
counter.timeout = 6000 (seconds)
counter.host = tr-oddjob-dal-01
Also app, "bigcounter":
# bcounter.starts = weekly (might be unnecessary)
@bcg
bcg / curl
Created March 7, 2012 14:05
Riak all_nodes_down
$ curl -v -d 'this is a test' -H "Content-Type: text/plain" http://10.32.36.92:8098/riak/test
* About to connect() to 10.32.36.92 port 8098 (#0)
* Trying 10.32.36.92... connected
* Connected to 10.32.36.92 (10.32.36.92) port 8098 (#0)
> POST /riak/test HTTP/1.1
> User-Agent: curl/7.19.7 (x86_64-pc-linux-gnu) libcurl/7.19.7 OpenSSL/0.9.8k zlib/1.2.3.3 libidn/1.15
> Host: 10.32.36.92:8098
> Accept: */*
> Content-Type: text/plain
> Content-Length: 14
@bcg
bcg / FIX
Created March 9, 2012 13:16
bash_bench build error
sudo apt-get install erlang-parsetools
@bcg
bcg / app.config
Created March 12, 2012 14:50
basho_bench failure
~/basho_bench$ grep '{pb_' /etc/riak/app.config
{pb_ip, "10.32.36.92" },
{pb_port, 8087 },
%% {pb_backlog, 64},
~/basho_bench$
@bcg
bcg / basho_bench out
Created March 13, 2012 18:34
basho_bench test crashes
WARN: No data for op: {get,get}
=ERROR REPORT==== 13-Mar-2012::10:10:49 ===
** Generic server <0.111.0> terminating
** Last message in was {req_timeout,#Ref<0.0.7.28998>}
** When Server state == {state,{10,32,36,92},
8087,false,false,undefined,undefined,
{[],[]},
1,[],infinity,100}
** Reason for termination ==
@bcg
bcg / app.config
Created March 14, 2012 13:23
Current LevelDB Riak Config
%% -*- mode: erlang;erlang-indent-level: 4;indent-tabs-mode: nil -*-
%% ex: ft=erlang ts=4 sw=4 et
[
%% Riak Core config
{riak_core, [
%% Default location of ringstate
{ring_state_dir, "/riak/ring"},
%% http is a list of IP addresses and TCP ports that the Riak
%% HTTP interface will bind.
@bcg
bcg / riak-bucket_importer-crash.txt
Created March 15, 2012 13:03
Riak Crask During Import
# /flume/profiles contains 40 million json documents. I successfully loaded 1 million of these same
# documents earlier.
$ sudo riak attach
Attempting to restart script through sudo -u riak
Attaching to /tmp/riak/erlang.pipe.1 (^D to exit)
(riak@10.32.36.92)1> code:add_pathz("/tmp"), l(bucket_importer).
{module,bucket_importer}
@bcg
bcg / worksforme.txt
Created March 15, 2012 17:38
petrol
petrol(master)$ nvm use 0.6.2
Now using node v0.6.2
petrol(master)$ rake
rm -rf ./node_modules
npm WARN sinon@1.2.0 package.json: bugs['web'] should probably be bugs['url']
> hiredis@0.1.14 preinstall /Users/bcg/Projects/Collective/petrol/node_modules/hiredis
> make || gmake
cd deps/hiredis && make static
tasklist = 'aof-stuff'
task = 'cp-aofs'
if hostname ~= /serf/
SWFJob.wait_on(tasklist,task) do |result|
if system('cp this to/that')
result = SWFJob.SUCCESS
else
result = SWFJob.FAIL