Skip to content

Instantly share code, notes, and snippets.

View shino's full-sized avatar

Shunichi Shinohara shino

View GitHub Profile
%% ---------------------------------------------------------------------
%%
%% Copyright (c) 2014 Basho Technologies, Inc. All Rights Reserved.
%%
%% This file is provided to you under the Apache License,
%% Version 2.0 (the "License"); you may not use this file
%% except in compliance with the License. You may obtain
%% a copy of the License at
%%
%% http://www.apache.org/licenses/LICENSE-2.0
From fa3e45ba64a41a7c16a57d2cff26f97a55e04ff2 Mon Sep 17 00:00:00 2001
From: Shunichi Shinohara <[email protected]>
Date: Tue, 10 Feb 2015 18:03:23 +0900
Subject: [PATCH] Fix coverage filter for csbucketfold and 2i return_terms
---
src/riak_kv_vnode.erl | 58 ++++++++++++++++++++++++++++++++-------------------
1 file changed, 37 insertions(+), 21 deletions(-)
diff --git a/src/riak_kv_vnode.erl b/src/riak_kv_vnode.erl

faked x-amz-content-sha256 with v4 auth

GET /?location HTTP/1.1
Host: shino.shun.test1.s3.amazonaws.com
Accept-Encoding: identity
Content-Length: 0
x-amz-content-sha256: 0000000000000000000000000000000000000000000000000000000000000000
Authorization: AWS4-HMAC-SHA256 Credential=AKIAIT2M2HIBZSYWPZHA/20150120/ap-northeast-1/s3/aws4_request,SignedHeaders=host;x-amz-content-sha256;x-amz-date,Signature=db79ff54941b0484e61bf96d9a8cc549808099fcc0749d5cc809fc5334051e2a
x-amz-date: 20150120T013450Z

Initiate

POST /zero.6MB?uploads HTTP/1.1
Host: shino.shun.test1.s3.amazonaws.com
Accept-Encoding: identity
Content-Length: 0
x-amz-content-sha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
x-amz-meta-s3cmd-attrs: uid:1000/gname:shino/uname:shino/gid:1000/mode:33204/mtime:1421375783/atime:1421375783/md5:da6a0d097e307ac52ed9b4ad551801fc/ctime:1421375783
content-type: binary/octet-stream
Authorization: AWS4-HMAC-SHA256 Credential=AKIAIT2M2HIBZSYWPZHA/20150116/ap-northeast-1/s3/aws4_request,SignedHeaders=content-type;host;x-amz-content-sha256;x-amz-date;x-amz-meta-s3cmd-attrs,Signature=02584881b12ac4c99854858d2e83b534267614b2f2d9cf6c67bc208b98507938
@shino
shino / boto.patch
Created January 28, 2015 12:53
Patch for boto/auth.py to fix S3 v4 authentication
From bb5e02b1c61b3cf03ba9cafc7a3f6c56adcf92ad Mon Sep 17 00:00:00 2001
From: Shunichi Shinohara <[email protected]>
Date: Wed, 28 Jan 2015 12:14:29 +0900
Subject: [PATCH] Fix S3 Version 4 HMAC auth bugs
- Canonical headers must be sorted by *key* for canonical requests.
- Header names in canonical headers must be lowercase even it is
capitalized in HTTP request header.
- Unicode bug in URL path normalzation, path should be treated as
just a binary. This bug manifests when an object key includes
@shino
shino / gist:df6aef40d5d61427a358
Created December 11, 2014 14:19
Gmail Monospace Font and Some Conpactifications
@namespace url(http://www.w3.org/1999/xhtml);
@-moz-document url-prefix("https://mail.google.com/") {
* {
font-family: monospace !important;
font-size: 11pt !important;
}
/* label boxes, make them smaller */
% $R16B03_1_hipe/bin/erlc utf8_with_magic_comment.erl
% $R16B03_1_hipe/bin/erl -noshell -s utf8_with_magic_comment start -s init stop
===== format by 's'
[bytes]: あ
===== format by 'ts'
[codepoint]: \x{3042}
[bytes]: あ
[string_literal]: \x{3042}
===== format by 'ts' with io:setopts([{encoding, utf8}])
[codepoint]: あ
% S3CURL=.s3curl.15018.test s3curl.pl --id cs -- -s -x localhost:15018 --trace - -H 'Range: bytes=0-10' http://test1.s3.amazonaws.com/rebar.config
== Info: Hostname was NOT found in DNS cache
== Info: Trying 127.0.0.1...
== Info: Connected to localhost (127.0.0.1) port 15018 (#0)
=> Send header, 289 bytes (0x121)
0000: 47 45 54 20 68 74 74 70 3a 2f 2f 74 65 73 74 31 GET http://test1
0010: 2e 73 33 2e 61 6d 61 7a 6f 6e 61 77 73 2e 63 6f .s3.amazonaws.co
0020: 6d 2f 72 65 62 61 72 2e 63 6f 6e 66 69 67 20 48 m/rebar.config H
0030: 54 54 50 2f 31 2e 31 0d 0a 55 73 65 72 2d 41 67 TTP/1.1..User-Ag
0040: 65 6e 74 3a 20 63 75 72 6c 2f 37 2e 33 35 2e 30 ent: curl/7.35.0

Keys in GC bucket 1.5

DELETE objects and GC bucket at 1.5

                    DELETE object
  CS w/o GC --------X--------------
  (1.5.x)           |
                    |
                    V
-module(wm_resource_call_latency_tracer).
-compile(export_all).
%% wm_resource_call_latency_tracer:start().
%% wm_resource_call_latency_tracer:print_stats_mean().
start() ->
start(webmachine_resource, 500, 30000).
start(_Mod, LatencyMS, Duration) ->