Skip to content

Instantly share code, notes, and snippets.

View lukebakken's full-sized avatar

Luke Bakken lukebakken

View GitHub Profile
@lukebakken
lukebakken / .gitignore
Last active October 10, 2017 15:13
Erlang RSS Memory
*.beam
*.csv
@lukebakken
lukebakken / rmq-centos-7.md
Last active June 7, 2017 17:47
RabbitMQ download, install and start on CentOS 7

Download

Docs for this can be found here:

curl -LO https://www.rabbitmq.com/releases/rabbitmq-server/v3.6.10/rabbitmq-server-3.6.10-1.el7.noarch.rpm
curl -LO https://github.com/rabbitmq/erlang-rpm/releases/download/v19.3.5/erlang-19.3.5-1.el7.centos.x86_64.rpm

Install

@lukebakken
lukebakken / pinger.erl
Last active January 17, 2018 17:37
Ping Riak nodes
-module(pinger).
-export([ping/1,
ping/3,
pinglist/4,
pingall/0,
pingall/1,
pingall/2,
ts_to_string/1
]).
@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'
@lukebakken
lukebakken / rmq-passwd-gen
Last active January 24, 2025 03:53
RabbitMQ - Create Hashed User Password
#!/usr/bin/env bash
set -o errexit
set -o nounset
declare -r passwd="${1:-newpassword}"
declare -r tmp0="$(mktemp)"
declare -r tmp1="$(mktemp)"
@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]);
#!/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 / 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
@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 / 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