Skip to content

Instantly share code, notes, and snippets.

View kellymclaughlin's full-sized avatar
🏠
Working from home

Kelly McLaughlin kellymclaughlin

🏠
Working from home
View GitHub Profile
@kellymclaughlin
kellymclaughlin / sort-test.out
Created August 13, 2014 18:44
Comparison of aggregating a sorted list in Erlang
Erlang R16B02-basho5 (erts-5.10.3) [source] [64-bit] [smp:8:8] [async-threads:10] [kernel-poll:false]
Eshell V5.10.3 (abort with ^G)
1> sort_test:run().
Sort once at the end: 10266
Sort after each append: 349
ok
2> sort_test:run().
Sort once at the end: 9724
Sort after each append: 431
#!/usr/bin/env escript
%% -*- coding: utf-8 -*-
%%! -pa /usr/lib64/riak-cs/lib/riakc-1.4.1/ebin /usr/lib64/riak-cs/lib/riak_pb-1.4.4.0/ebin /usr/lib64/riak-cs/lib/protobuffs-0.8.1/ebin /usr/lib64/riak-cs/lib/riak_cs-1.4.5/ebin /usr/lib/riak-cs/lib/riakc-1.4.1/ebin /usr/lib/riak-cs/lib/riak_pb-1.4.4.0/ebin /usr/lib/riak-cs/lib/protobuffs-0.8.1/ebin /usr/lib/riak-cs/lib/riak_cs-1.4.5/ebin
%%! -pa /usr/lib64/riak-cs/lib/riakc-1.3.1.1/ebin /usr/lib64/riak-cs/lib/riak_pb-1.3.0/ebin /usr/lib64/riak-cs/lib/protobuffs-0.8.0/ebin /usr/lib/riak-cs/lib/riakc-1.3.1.1/ebin /usr/lib/riak-cs/lib/riak_pb-1.3.0/ebin /usr/lib/riak-cs/lib/protobuffs-0.8.0/ebin /usr/lib/riak-cs/ebin
%%! -pa /Users/kelly/basho/repos/riak_cs/deps/riakc/ebin /Users/kelly/basho/repos/riak_cs/deps/riak_pb/ebin /Users/kelly/basho/repos/riak_cs/deps/protobuffs/ebin /Users/kelly/basho/repos/riak_cs/deps/riakc/ebin /Users/kelly/basho/repos/riak_cs/deps/riak_pb/ebin /Users/kelly/basho/repos/riak_cs/deps/protobuffs/ebin /Users/kelly/basho/repos/riak_cs/dep
-module(cs_manifest_siblings).
-compile(export_all).
start() ->
start(1).
%% @doc Trace to determine the number of siblings of Riak CS manifest
%% objects. The `Threshold' parameter is used to limit the output to
%% manifest objects whose sibling count is >= to `Threshold'.
start(Threshold) ->
#!/usr/bin/env escript
%% -*- coding: utf-8 -*-
%%! -pa /usr/lib64/riak-cs/lib/riakc-1.3.1.1/ebin /usr/lib64/riak-cs/lib/riak_pb-1.3.0/ebin /usr/lib64/riak-cs/lib/protobuffs-0.8.0/ebin /usr/lib/riak-cs/lib/riakc-1.3.1.1/ebin /usr/lib/riak-cs/lib/riak_pb-1.3.0/ebin /usr/lib/riak-cs/lib/protobuffs-0.8.0/ebin /usr/lib/riak-cs/ebin
-include_lib("riak_cs/include/riak_cs.hrl").
-define(USERS_BUCKET, <<"moss.users">>).
-define(DEFAULT_RIAK_IP, "127.0.0.1").
-define(DEFAULT_RIAK_PORT, 8087).
package main
import riak "github.com/tpjg/goriakpbc"
import "fmt"
import "strconv"
import "sync"
func setupBucket(cli *riak.Client, bucketName string) error {
bucket, err := cli.NewBucket(bucketName)
if err != nil {
@kellymclaughlin
kellymclaughlin / bitcask_merge.erl
Last active July 14, 2017 17:12
An Erlang module to induce Riak to merge all bitcask data directories. **WARNING** It is not advisable to use this on a production system. There could be significant impact to request latencies.
-module(bitcask_merge).
-export([merge_dirs/0]).
bitcask_data_dir() ->
bitcask_data_dir(application:get_env(riak_kv, multi_backend),
application:get_env(bitcask, data_root)).
bitcask_data_dir(undefined, undefined) ->
undefined;
%% Old version. Boo!!
tenant_id(TokenItems) ->
{struct, AccessItems} = proplists:get_value(<<"access">>, TokenItems, []),
{struct, UserItems} = proplists:get_value(<<"user">>, AccessItems, []),
case proplists:get_value(<<"tenantId">>, UserItems) of
undefined ->
failed;
TenantId ->
{ok, TenantId}
end.
FAIL: s3tests.functional.test_s3.test_object_read_notexist
FAIL: s3tests.functional.test_s3.test_object_set_get_non_utf8_metadata
FAIL: s3tests.functional.test_s3.test_object_set_get_metadata_empty_to_unreadable_prefix
FAIL: s3tests.functional.test_s3.test_object_set_get_metadata_empty_to_unreadable_suffix
FAIL: s3tests.functional.test_s3.test_object_set_get_metadata_empty_to_unreadable_infix
FAIL: s3tests.functional.test_s3.test_object_set_get_metadata_overwrite_to_unreadable_prefix
FAIL: s3tests.functional.test_s3.test_object_set_get_metadata_overwrite_to_unreadable_suffix
FAIL: s3tests.functional.test_s3.test_object_set_get_metadata_overwrite_to_unreadable_infix
FAIL: s3tests.functional.test_s3.test_object_raw_response_headers
FAIL: s3tests.functional.test_s3.test_object_raw_authenticated_object_acl
#!/bin/sh
oIFS=$IFS
IFS="
"
ROOTDIR=`pwd`
if [ "$1" = "-p" ]; then
PRINT=1
else
22:58:43:s3tmp $ s3cmd -c ~/.s3cfg-amz mb s3://kellys_bucket
Bucket 's3://kellys_bucket/' created
10:12:51:s3tmp $ s3cmd -c ~/.s3cfg-amz mb s3://kellys_bucket
Bucket 's3://kellys_bucket/' created
10:12:52:s3tmp $ s3cmd -c ~/.s3cfg-amz mb -v -d s3://kellys_bucket
DEBUG: ConfigParser: Reading file '/Users/kelly/.s3cfg-amz'
DEBUG: ConfigParser: access_key->AK...17_chars...Q
DEBUG: ConfigParser: bucket_location->US
DEBUG: ConfigParser: cloudfront_host->cloudfront.amazonaws.com
DEBUG: ConfigParser: cloudfront_resource->/2010-07-15/distribution