Skip to content

Instantly share code, notes, and snippets.

View repeatedly's full-sized avatar

Masahiro Nakagawa repeatedly

View GitHub Profile
@repeatedly
repeatedly / README.md
Last active April 8, 2020 02:55 — forked from okkez/README.md
Fluentd Mutual authentication sample with cert_verifier

Prepare files and directories

mkdir -p fluentdCA/{private,newcerts,certs,crl}
touch fluentdCA/index.txt
echo 00 > fluentdCA/serial

Setup private CA

ruby 2.3.5p376 (2017-09-14 revision 59905) [x86_64-linux]
built-in mem: 178476 duration: 5.132209188
jemalloc 3.0.0 mem: 176224 duration: 4.000590038
jemalloc 3.1.0 mem: 176228 duration: 3.905287789
jemalloc 3.2.0 mem: 181496 duration: 3.884209287
jemalloc 3.3.0 mem: 181512 duration: 3.993662677
jemalloc 3.3.1 mem: 183572 duration: 3.883753324
jemalloc 3.4.0 mem: 181564 duration: 3.92800123
jemalloc 3.4.1 mem: 181500 duration: 3.842475057
@repeatedly
repeatedly / result.md
Created November 19, 2017 13:01
Cool.io Timer result between 2.4 and 2.5

2.5.0-dev

% ruby --version
ruby 2.5.0dev (2017-11-18 trunk 60833) [x86_64-darwin15]

% ruby timer_test.rb
Traceback (most recent call last):
        3: from t_test.rb:16:in `<main>'
 2: from /Users/repeatedly/.rbenv/versions/2.5.0-dev/lib/ruby/gems/2.5.0/gems/cool.io-1.5.1/lib/cool.io/loop.rb:88:in `run'
@repeatedly
repeatedly / Log.md
Created September 7, 2017 10:24
rubygems 2.4.8と2.5.0以降の依存解決の違い

gem 2.4.8

  • with pre activesupport 4.2.8 installation
% gem i draper -v 1.4.0 --no-doc --explain
Gems to install:
  i18n-0.8.6
  thread_safe-0.3.6
 tzinfo-1.2.3
@repeatedly
repeatedly / dig_bench.rb
Created July 19, 2017 10:07
dig benchmark for fluentd
require 'benchmark'
class Test0
def initialize(key)
@key = key
end
def call(record)
record[@key]
end
@repeatedly
repeatedly / fluent.conf
Last active May 31, 2020 03:45
Fluentd: HTTP input simple benchmark
<source>
@type http
port 8888
</source>
<match test.**>
@type flowcounter_simple
</match>
@repeatedly
repeatedly / fluent.conf
Last active November 15, 2016 00:31
Sync like file transfer with v0.14
<source>
@type tail
path in/*.log
path_key tailed_path
read_from_head true
tag logs.tail
<parse>
@type none
</parse>
# encoding: UTF-8
require 'date'
require 'excon'
require 'elasticsearch'
require 'uri'
begin
require 'strptime'
rescue LoadError
end
@repeatedly
repeatedly / build_td_agent_on_centos5.md
Created May 23, 2016 02:43
td-agent build on CentOS 5

Build step on CentOS5

Use /home/repeatedly/lib for installation directory. Change the path on your environment.

Setup Ruby

Download openssl, zlib and ruby on host and copy to CentOS5

$ pwd
@repeatedly
repeatedly / json_decode.rb
Created December 16, 2015 16:24
JSON encode / decode comparison
# Result
#valid
#{"k"=>"vvv"}
#{"k"=>"vvv"}
#{"k"=>"vvv"}
#invalid utf-8 with US-ASCII
#{"k"=>"v\xFFvv"}
#{"k"=>"v\xFFvv"}
#"Yajl: error: lexical error: invalid bytes in UTF8 string.\n # {\"k\":\"v\xFFvv\"}\n (right here) ------^\n"