Skip to content

Instantly share code, notes, and snippets.

Avatar

Luke Bakken lukebakken

View GitHub Profile
View hcping
#!/usr/bin/env bash
set -o errexit
set -o nounset
tmpfile=''
function onexit
{
if [[ -f $tmpfile ]]
@lukebakken
lukebakken / watch-xfers
Created Apr 29, 2014
Watch Riak Transfers
View watch-xfers
#!/usr/bin/env bash
function xfers_in_progress
{
local tmp="$(mktemp)"
riak-admin transfers > "$tmp" 2>&1
fgrep -qi 'No transfers active' "$tmp"
declare -i rv=$?
rm -f "$tmp"
if (( rv == 1 ))
@lukebakken
lukebakken / commands.md
Last active Aug 29, 2015
Ubuntu / FreeBSD / Misc useful commands
View commands.md
@lukebakken
lukebakken / logrep
Created Dec 3, 2014
Large Object Grep
View logrep
#!/usr/bin/env perl
use strict;
use warnings;
while (<>)
{
# 2014-10-05 14:59:45.023
my @F = split;
if (/(\d{4}-\d{1,2}-\d{1,2} \d{1,2}:\d{1,2}:\d{1,2}).*Reading large object/)
@lukebakken
lukebakken / .gitignore
Last active Aug 29, 2015
Load Riak Memory backend
@lukebakken
lukebakken / HipchatLongIdle.user.js
Created Jan 9, 2015
HipChat web chat long idle for Chromium/Chrome
View HipchatLongIdle.user.js
// ==UserScript==
// @author Luke Bakken
// @name Hipchat Long Idle
// @namespace org.bowbak.luke
// @description Makes you stay "Available" in hipchat for 8 hours of inactivity instead of 5 minutes
// @match https://*.hipchat.com/chat
// @version 1
// @grant none
// @run-at document-end
// ==/UserScript==
View exercise-fibonacci-closure.go
package main
import "fmt"
// fibonacci is a function that returns
// a function that returns an int.
func fibonacci() func() int {
x0, x1 := 0, 1
return func() (f int) {
f = x0 + x1
@lukebakken
lukebakken / Makefile
Last active Sep 28, 2015
Riak - Go client examples
View Makefile
.PHONY: all install-deps lint run
PROJDIR = $(realpath $(CURDIR))
RUNCMD = go run $(wildcard *.go)
all: install-deps lint run
install-deps:
go get -t ./...
@lukebakken
lukebakken / monit.conf
Created Oct 18, 2012 — forked from shapeshed/monit.conf
Upstart script for monit on Ubuntu 10.04
View monit.conf
# This is an event.d (upstart) script to keep monit running.
# To install disable the old way of doing things:
#
# /etc/init.d/monit stop && update-rc.d -f monit remove
#
# then put this script here:
#
# /etc/init/monit.conf
#
# and reload upstart configuration:
View python-client-ts.md
git clone git://github.com/basho/riak_pb.git
(cd riak_pb && git checkout --track end-to-end/timeseries)

git clone git://github.com/basho/riak-python-client.git
(cd riak-python-client && git checkout --track end-to-end/timeseries)

Build Riak PB messages for Python. This requires the protoc command to be in your PATH. Your distro may have a protoc or protobuf package, or you can build from source easily (installs to /usr/local/bin/protoc):