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
| <Proxy balancer://3sec/ > | |
| BalancerMember http://192.168.1.1 loadfactor=10 timeout=3 | |
| BalancerMember http://192.168.1.2 loadfactor=10 timeout=3 | |
| </Proxy> | |
| <Proxy balancer://5sec/ > | |
| BalancerMember http://192.168.1.1 loadfactor=10 timeout=5 | |
| BalancerMember http://192.168.1.2 loadfactor=10 timeout=5 | |
| </Proxy> |
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
| module Fluent | |
| class RecommendRedis < Output | |
| Fluent::Plugin.register_output('recommend_and_ranking', self) | |
| require 'redis' | |
| REDIS = Redis.new(:host => "192.168.1.126", :port => 6379) | |
| VIEW_PREFIX = 'view_' # ユーザごとの閲覧履歴のリスト | |
| RELATION_PREFIX = 'relation_' # アイテム間の相関値 | |
| ACCESS_COUNTER = 'access_counter' # アイテムごとのアクセスカウンタ |
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
| #!/home/mikeda/.rbenv/shims/ruby | |
| # -*- coding: utf-8 -*- | |
| require 'google_drive' | |
| session = GoogleDrive.login("<user>@gmail.com", "<password>") | |
| #session.files.each do |file| | |
| # p file.title | |
| #end |
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
| define command{ | |
| command_name notify-service-by-spreadsheet | |
| command_line /etc/nagios/notify-service-by-spreadsheet.rb "$HOSTALIAS$" "$SERVICESTATE$" "$NOTIFICATIONTYPE$" "$SERVICEDESC$" "$SERVICEOUTPUT$" "$TIMET$" | |
| } | |
| define contact{ | |
| name generic-contact | |
| service_notification_period 24x7 | |
| host_notification_period 24x7 | |
| service_notification_options w,u,c,r,f,s |
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/php | |
| <?php | |
| //最新版だとPHP5.2~らしいのでSDKは1.3.0を使う | |
| require_once(dirname(__FILE__) .'/../helper/aws/sdk-1.3.0/sdk.class.php'); | |
| //error_reporting(E_ALL); | |
| $debug_log = "/var/log/zabbix/rds.log"; | |
| //$args = print_r($argv, true); | |
| //debug_log($args); |
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/local/bin/ruby | |
| # とりあえずこのへんをグラフ化 | |
| # ●インデックス | |
| # numDocs | |
| # サイズ | |
| # | |
| # ●検索クエリ | |
| # 総リクエスト(QPS) | |
| # エラー(QPS) | |
| # タイムアウト(QPS) |
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/local/bin/ruby | |
| require 'json' | |
| result = {} | |
| cur_ks = nil | |
| cur_cf = nil | |
| ARGF.each_line do |line| | |
| line.strip! | |
| if line =~ /^Keyspace: (.+)/ |
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/local/bin/ruby | |
| # アクセスログを1時間ごとに集計。アクセスタイプごとのアクセス数をTSV形式で出力する | |
| # usage : analyze_access_log.rb <YYYYMMDD> <access_log>... | |
| require 'json' | |
| require 'time' | |
| require 'pp' | |
| ANALYZE_DATE = ARGV.shift # YYYYMMDD |
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
| # EC2のインスタンスを作成 | |
| # VPC | |
| # インスタンスはEBSタイプ | |
| # 追加EBSをcreate & attach & mount | |
| # EIPをallocate & associate | |
| # インスタンス、EBSボリュームにはNameタグをつける | |
| # 使用例 | |
| # $ ruby run_instance.rb app01 m1.small 10.0.0.101 30 | |
| require 'aws-sdk' |
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 'aws-sdk' | |
| $config_file = File.join(File.dirname(__FILE__), "../../config/aws/aws.yml") | |
| $config = YAML.load(File.read($config_file)) | |
| AWS.config( | |
| access_key_id: $config['access_key_id'], | |
| secret_access_key: $config['secret_access_key'], | |
| region: $config['region'] | |
| ) |