Skip to content

Instantly share code, notes, and snippets.

View lukebakken's full-sized avatar

Luke Bakken lukebakken

View GitHub Profile
@lukebakken
lukebakken / querying-data.py
Last active December 5, 2015 19:01
Riak TS / Python examples
import datetime
from riak.client import RiakClient
epoch = datetime.datetime.utcfromtimestamp(0)
def unix_time_millis(dt):
td = dt - epoch
return int(td.total_seconds() * 1000.0)
tenMins = datetime.timedelta(0, 600)
@lukebakken
lukebakken / code-samples.md
Last active January 2, 2016 10:08
Erlang Study Group - Riak Code Samples

erlang-study

Notes / examples from Programming Erlang with emphasis on Riak

Page Code Method Source

Keybase proof

I hereby claim:

  • I am lukebakken on github.
  • I am krakken (https://keybase.io/krakken) on keybase.
  • I have a public key whose fingerprint is E778 02C6 EEEB EABC DC03 2495 1074 AF46 F589 A49C

To claim this, I am signing this object:

@lukebakken
lukebakken / di-configure-object.md
Last active July 30, 2016 14:57
di-configure-object
public interface IYoMamaService
{
    bool IsSoFat { get; }
}

public interface IYoMamaServiceConfig
{
    int SoFatSize { get; }
}
@lukebakken
lukebakken / nuke-gems
Created August 1, 2016 20:01
Remove all gems in your rbenv environment
#!/usr/bin/env bash
RBENV_ROOT="$HOME/.rbenv"
if [[ -d "$RBENV_ROOT/bin" ]]
then
export RBENV_ROOT
export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"
else
echo "Expected to find rbenv in $RBENV_ROOT!" 2>&1
@lukebakken
lukebakken / ruby-1.9.3-ext-openssl-extconf.rb.patch
Last active November 18, 2016 18:38
Ruby 1.9.3 on Arch Linux
diff --git a/ext/openssl/extconf.rb b/ext/openssl/extconf.rb
index 8c04cb5..132d803 100644
--- a/ext/openssl/extconf.rb
+++ b/ext/openssl/extconf.rb
@@ -104,6 +104,9 @@
have_func("SSLv2_method")
have_func("SSLv2_server_method")
have_func("SSLv2_client_method")
+have_func("SSLv3_method")
+have_func("SSLv3_server_method")
@lukebakken
lukebakken / haproxy.conf
Last active November 23, 2016 17:44
Riak / haproxy
global
log /dev/log local0 info
pidfile /home/lbakken/run/haproxy.pid
defaults
log global
timeout connect 1s
timeout client 50ms
timeout server 1s
#!/usr/bin/env bash
set -o errexit
set -o nounset
# This script needs mp3splt, cdrtools, vorbis-tools
CREATE_OGG="false";
CREATE_FLAC="true";
CREATE_MKA="false";
@lukebakken
lukebakken / ruh-roh.md
Last active April 6, 2017 18:01
Erlang Gotcha

What could go wrong here?

receiver() ->
    receive
        {first, Msg} ->
            io:format("receiver first ~s~n", [Msg]),
            receive
                {second, Msg} ->
                    io:format("receiver second ~s~n", [Msg]);
@lukebakken
lukebakken / rabbit_pash_hash.py
Last active May 2, 2017 00:51 — forked from komuw/rabbit_pash_hash.py
rabbitMQ password hashing algo
# rabbitMQ password hashing algo as laid out in: http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/2011-May/012765.html
from __future__ import print_function
import base64
import os
import hashlib
import struct
# This is the password we wish to encode
password = 'simon'