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
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
%% 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.
@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;
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 {
#!/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).
-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.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
@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
@kellymclaughlin
kellymclaughlin / console.md
Last active August 29, 2015 14:05
Effects on Riak key listings when reducing n_val from 3 to 2
(riak@127.0.0.1)3> [C:put(riak_object:new(<<"bucket">>, list_to_binary(integer_to_list(X)), <<"val">>)) || X <- lists:seq(1,100)].
(riak@127.0.0.1)5> Props = riak_core_bucket:get_bucket(<<"bucket">>).
[{name,<<"bucket">>},
 {allow_mult,true},
 {basic_quorum,false},
 {big_vclock,50},
 {chash_keyfun,{riak_core_util,chash_std_keyfun}},
 {dw,quorum},
 {last_write_wins,false},
===> Consult config file "rebar.config"
===> Consult config file "rebar.lock"
===> Verifying dependencies...
===> Bad packages index, try to fix with `rebar3 update`
===> Consult config file "/home/kelly/XXX/repos/myapp/_build/lib/ranch/rebar.config"
===> Consult config file "/home/kelly/XXX/repos/myapp/_build/lib/ranch/rebar.lock"
===> Consult config file "/home/kelly/XXX/repos/myapp/_build/lib/procket/rebar.config"
===> Consult config file "/home/kelly/XXX/repos/myapp/_build/lib/procket/rebar.lock"
===> Consult config file "/home/kelly/XXX/repos/myapp/_build/lib/lager/rebar.config"
===> Consult config file "/home/kelly/XXX/repos/myapp/_build/lib/lager/rebar.lock"