Skip to content

Instantly share code, notes, and snippets.

Avatar

Alex Moore alexmoore

View GitHub Profile
@alexmoore
alexmoore / 0. Riak on Raspberry Pi's
Last active Dec 17, 2019
Building Basho Erlang / Riak TS on a Raspberry Pi 3
View 0. Riak on Raspberry Pi's
This is unsupported by Basho, but you can build Basho's flavor of Erlang and Riak on Raspberry Pis.
@alexmoore
alexmoore / service-checklist.md
Created Sep 27, 2016 — forked from acolyer/service-checklist.md
Internet Scale Services Checklist
View service-checklist.md

Internet Scale Services Checklist

A checklist for designing and developing internet scale services, inspired by James Hamilton's 2007 paper "On Desgining and Deploying Internet-Scale Services."

Basic tenets

  • Does the design expect failures to happen regularly and handle them gracefully?
  • Have we kept things as simple as possible?
View New Client Eng Reading List
Just Open a Socket - https://www.youtube.com/watch?v=jytJXjI0oQU
View SelectManyIterator.java
package Blah;
import java.util.Iterator;
import java.util.NoSuchElementException;
public class SelectManyIterable<TSource, TResult> implements Iterable<TResult>
{
public interface TransformProvider<TSource, TResult>
{
@alexmoore
alexmoore / large.sh
Created Sep 25, 2014
Find large Objects
View large.sh
#!/bin/bash
# For each node, search for reading large object messages, write to largeobject.read file
for NODE in 10.58.9*; do
IP=`echo "$NODE" | cut -d '-' -f1`;
cat $NODE/lo.r.console.log | sed "s/.*Reading large object of size \([0-9]*\) from \(<<.*>>\)\/\(<<.*>>\)/\{\"$IP\",\2,\3,\1\},/" | sort | uniq > $NODE/lo.r.list ;
done
# For each node, search for writing large object messages, write to largeobject.write file
for NODE in 10.58.9*;
View find_primaries.erl
FindPrimaries = fun(Bucket, Key, Ring) ->
BKey = {Bucket,Key},
DocIdx = riak_core_util:chash_key(BKey),
BucketProps = riak_core_bucket:get_bucket(Bucket, Ring),
[NValue] = [Y || {X1, Y} <- BucketProps, n_val == X1],
CHBin = chashbin:create(riak_core_ring:chash(Ring)),
Itr = chashbin:iterator(DocIdx, CHBin),
{Primaries, Itr2} = chashbin:itr_pop(3, Itr),
Primaries
end.
View Functional Core, Imperative Shell
http://www.infoq.com/presentations/Simple-Made-Easy
http://www.infoq.com/presentations/integration-tests-scam
http://blog.thecodewhisperer.com/2010/09/14/when-is-it-safe-to-introduce-test-doubles
http://youtu.be/yTkzNHF6rMs
http://pyvideo.org/video/1670/boundaries
http://skillsmatter.com/podcast/ajax-ria/enumerators
http://alistair.cockburn.us/Hexagonal+architecture
http://c2.com/cgi/wiki?PortsAndAdaptersArchitecture
http://www.confreaks.com/videos/977-goruco2012-hexagonal-rails
http://www.confreaks.com/videos/1255-rockymtnruby2012-to-mock-or-not-to-mock
@alexmoore
alexmoore / set_lager.erl
Created May 6, 2014
Set Debug / Info Log Levels Riak-CS
View set_lager.erl
SetDebug = fun() -> {node(), lager:set_loglevel(lager_file_backend, "/var/log/riak-cs/console.log", debug)} end.
SetInfo = fun() -> {node(), lager:set_loglevel(lager_file_backend, "/var/log/riak-cs/console.log", info)} end.
rp(rpc:multicall(erlang, apply, [SetInfo,[]])).
View keybase.md

Keybase proof

I hereby claim:

  • I am alexmoore on github.
  • I am alexmoore (https://keybase.io/alexmoore) on keybase.
  • I have a public key whose fingerprint is ED5D 175E 29A7 478F 0D4F 7D57 1D71 6D67 A969 0E08

To claim this, I am signing this object:

View greplogs.sh
unpack_riak_debugs () {
mkdir -p compressed
for file in `ls *riak-debug.tar.gz`
do
tar xzf $file
mv $file compressed
done
for file in `ls -1 | grep riak-debug`
do
You can’t perform that action at this time.