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 bash -l | |
# rvm get latest && rvm reload #<< current rvm older than 1.10 | |
useradd -d /opt/fluentd --system -c fluentd -s /usr/sbin/nologin --user-group fluent | |
rvm get stable | |
mkdir -p /opt/fluentd | |
cd /opt/fluentd | |
rvm install ruby-1.9.3-p194 |
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
# -*- coding: utf-8 -*- | |
# Capistranoのデプロイ時にコンフィグを作成する、作成元は "*.sample"ファイル | |
# | |
# 各環境用の設定を上書きした後、キー及びバリューのクラス、階層を元のsampleと比較し、 | |
# 文字・数字の区別がついていることなどを確認する。 | |
# | |
# TODO:Capistranoのモジュールにしたい | |
require 'yaml' | |
require 'json' |
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
require 'net/https' | |
https = Net::HTTP.new('google.com',443) | |
https.use_ssl = true | |
https.verify_mode = OpenSSL::SSL::VERIFY_NONE | |
https.start { | |
puts https.peer_cert.not_after.class | |
puts https.peer_cert.not_after | |
} |
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 ruby | |
# -*- coding:utf-8 -*- | |
require 'socket' | |
require 'openssl' | |
require 'timeout' | |
require 'pp' | |
include OpenSSL | |
timeout=15 |
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
function pp { | |
echo pretty | |
} |
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 | |
format /(?<c_ip>[\w\.]+):(?<c_port>\d+) \[(?<a_date>.+)\] (?<f_end>[\w-]+) (?<b_end>[\w-]+)\/(?<b_server>[\w-]+) (?<tw>\d+)\/(?<tc>\d | |
+)\/(?<tt>\d+) (?<bytes>\d+) (?<t_state>[\w-]+) (?<actconn>\d+)\/(?<feconn>\d+)\/(?<beconn>\d+)\/(?<srv_conn>\d+)\/(?<retries>\d+) (?< | |
srv_queue>\d+)\/(?<backend_queue>\d+)/ | |
time_format %d/%B/%Y:%H:%M:%S | |
path /var/log/haproxy/haproxy_access.log | |
pos_file /opt/fluentd/var/pos/haproxy_access.pos | |
tag haproxy.access | |
</source> |
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
# -*- coding: utf-8 -*- | |
require 'csv' | |
require 'json' | |
require 'pp' | |
csvh = ["owner_uuid", "zone_uuid","net_if","period_start","period_end","Megabytes_sent_delta","Megabytes_received_delta"] | |
jfile = "data/billing.json" | |
rfile = "result/all_result.csv" |
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
# -*- coding: utf-8 -*- | |
require 'csv' | |
require 'json' | |
## machines | |
owner_uuid = "oooooooo-oooo-oooo-oooo-oooooooooooo" | |
zone_uuids = [ | |
"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", | |
"yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy", | |
"zzzzzzzz-zzzz-zzzz-zzzz-zzzzzzzzzzzz" ] |
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
require 'json' | |
gf_1 = "locate_name" | |
gf_2 = "riak_stat" | |
gfcast = "http://user:password@your_gfcast_address/api/#{gf_1}/#{gf_2}" | |
r_add = "your_riak_address:8098/stats" | |
r_stats = JSON.load(`curl -s #{r_add} | json`) |
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
require 'yaml' | |
require 'erb' | |
CLI_NUM = ENV["CLI_NUM"] || 10 | |
INTERVAL = ENV["INTERVAL"] || 5 | |
task :default do | |
puts "default do nothing" | |
puts p | |
end |