Skip to content

Instantly share code, notes, and snippets.

@mechamogera
mechamogera / awslogs.conf
Last active Aug 7, 2018
CloudWatch Logsサンプル設定
View awslogs.conf
#
# ------------------------------------------
# CLOUDWATCH LOGS AGENT CONFIGURATION FILE
# ------------------------------------------
#
# --- DESCRIPTION ---
# This file is used by the CloudWatch Logs Agent to specify what log data to send to the service and how.
# You can modify this file at any time to add, remove or change configuration.
#
# NOTE: A running agent must be stopped and restarted for configuration changes to take effect.
@mechamogera
mechamogera / Gemfile
Created May 13, 2014
JenkinsのRole-based Authorization Strategy pluginを利用した認証においてUserをRoleにAssignする
View Gemfile
# A sample Gemfile
source "https://rubygems.org"
gem 'trollop'
@mechamogera
mechamogera / Gemfile
Last active Mar 18, 2016
Github Organizationのメンバー一覧を取得するRubyスクリプト
View Gemfile
# A sample Gemfile
source "https://rubygems.org"
gem 'github_api'
gem 'highline'
gem 'trollop'
@mechamogera
mechamogera / Gemfile
Created Mar 11, 2014
S3のstaticsホスティングをする構成のCloudFormationのTemplate
View Gemfile
# A sample Gemfile
source "https://rubygems.org"
# gem "rails"
gem "aws-sdk"
@mechamogera
mechamogera / all_event_get.rb
Created Aug 5, 2013
AWS EC2の全イベント取得サンプル
View all_event_get.rb
module AWSOperation
def self.get_ec2_events(config = {})
report = []
config[:proxy_uri] ||= ENV['HTTP_PROXY'] || ENV['http_proxy']
ec2 = AWS::EC2.new(config)
ec2.regions.each do |region|
reg = ec2.regions[region.name]
reg.instances.each do |instance|
status = reg.client.describe_instance_status({"instance_ids" => [ instance.id ]})
@mechamogera
mechamogera / Gemfile
Last active Dec 20, 2015
Jenkinsの休み中のジョブ結果確認ツール
View Gemfile
# A sample Gemfile
source "https://rubygems.org"
gem "holidays"
gem "trollop"
gem "rest-client"
@mechamogera
mechamogera / Gemfile
Last active Dec 20, 2015
AWSのAMI管理ツール
View Gemfile
# A sample Gemfile
source "http://rubygems.org"
gem "trollop"
gem "aws-sdk"
View get_s3_access_log.rb
require 'rubygems'
gem 'aws-sdk'
require 'aws'
require 'optparse'
require 'ostruct'
require 'time'
require 'yaml'
require 'csv'
options = OpenStruct.new
@mechamogera
mechamogera / Gemfile
Created Jun 7, 2013
Jenkinsで勤務時間外に失敗したジョブを調べるrubyスクリプト
View Gemfile
source "https://rubygems.org"
gem "holidays"
gem "trollop"
gem "rest-client"
@mechamogera
mechamogera / irc-socket-test.rb
Created Apr 15, 2013
irc-socket gemを用いたIRCメッセージ送信Rubyスクリプトサンプル
View irc-socket-test.rb
require 'irc-socket'
irc = IRCSocket.new('example.com')
irc.connect
if irc.connected?
irc.nick "hulk"
irc.user "hulk", 0, "*", "I am hulk hogan"
while line = irc.read