This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
my $regex = shift; | |
my $cmd = quotemeta(shift); | |
my @nodes = `consul members -status alive`; | |
shift @nodes; # dispose header | |
@nodes = grep /$regex/, map { (split /\s+/, $_)[0] } @nodes; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
node="$1" | |
cmd="$2" | |
nodes=$(consul members -status alive | awk "/$node/{ print \$1 }") | |
args=() | |
for n in $nodes |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package mapbench_test | |
import "testing" | |
var N = 1000000 | |
func BenchmarkMap(b *testing.B) { | |
for i := 0; i < b.N; i++ { | |
m := map[int]int{} | |
for j := 0; j < N; j++ { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ go-bindata -prefix=public public/... | |
$ go build |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package fluent_test | |
import ( | |
"reflect" | |
"testing" | |
) | |
var testNumbers = []interface{}{ | |
int(10), | |
uint(10), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"log" | |
"github.com/fujiwara/go-zabbix-get/zabbix" | |
) | |
func main() { | |
err := zabbix.RunTrapperServer( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[fluentd] | |
$ fluentd -c fluentd.conf | |
2014-09-05 10:17:57 +0900 [info]: starting fluentd-0.10.53 | |
2014-09-05 10:17:57 +0900 [info]: reading config file path="fluentd.conf" | |
2014-09-05 10:17:57 +0900 [info]: gem 'fluentd' version '0.10.53' | |
2014-09-05 10:17:57 +0900 [info]: using configuration file: <ROOT> | |
<source> | |
type tail | |
tag ltsv | |
format ltsv |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<source> | |
type forward | |
</source> | |
<source> | |
tag test | |
type tail | |
format json | |
path /tmp/test.log | |
</source> | |
<match **> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use 5.12.1; | |
use Data::Validator; | |
use Data::Util; | |
use Benchmark qw/ :all /; | |
cmpthese 0, { | |
"Data::Validator" => sub { | |
dv(100); | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<source> | |
type tail | |
path /dev/shm/tmp/dummy.log | |
pos_file /var/tmp/_var_log_dummy.pos | |
format none | |
tag dummy | |
</source> | |
<match dummy> | |
type copy | |
<store> |