This file contains 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/env ruby | |
# -*- coding: utf-8 -*- | |
require 'aws-sdk' | |
require 'time' | |
ACCESS_KEY = "#{ARGV[0]}" | |
SECRET_KEY = "#{ARGV[1]}" | |
gateway_id = "#{ARGV[2]}" | |
gateway_name = "#{ARGV[3]}" |
This file contains 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/env ruby | |
# -*- coding: utf-8 -*- | |
require 'aws-sdk' | |
require 'time' | |
ACCESS_KEY = "#{ARGV[0]}" | |
SECRET_KEY = "#{ARGV[1]}" | |
gateway_id = "#{ARGV[2]}" | |
gateway_name = "#{ARGV[3]}" |
This file contains 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/env ruby | |
# -*- coding: utf-8 -*- | |
require 'aws-sdk' | |
require 'time' | |
ACCESS_KEY = "#{ARGV[0]}" | |
SECRET_KEY = "#{ARGV[1]}" | |
gateway_id = "#{ARGV[2]}" | |
gateway_name = "#{ARGV[3]}" |
This file contains 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 'right_aws' | |
## 各種設定 | |
src_group_id = ARGV[0] | |
dst_group_name = ARGV[1] | |
description = ARGV[2] | |
ACCESS_KEY = 'set your access key id' |
This file contains 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/sh -x | |
## setup | |
TODAY=`date +\%Y\%m\%d` | |
INSTANCE_NAME="set your instance name" | |
EBS_VOLUME="set your ebs volume id" | |
EBS_GENERATION=5 | |
SRC_REGION="ap-northeast-1" | |
DST_REGION="ap-southeast-1" | |
TAG="set your management tag" |
This file contains 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/sh | |
##Setup | |
TODAY=`date +\%Y\%m\%d` | |
INSTANCE_NAME="set your instance name" | |
LOG="path to your log file" | |
EBS_VOLUME="set your ebs id" | |
EC2_REGION=ap-northeast-1 | |
EBS_GENERATION=5 |
This file contains 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 'right_aws' | |
## 引数チェック | |
unless ARGV.size == 1 then | |
puts "引数が正しく設定されていません" | |
exit 1 | |
end |
This file contains 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 'rubygems' | |
require 'right_aws' | |
### 使用例 | |
# ruby rightaws_runstop_dbinstance.rb rds_instance_name db.m1.small security-group parameter_group | |
### 事前に指定するパラメータ | |
# * RDSのインスタンス名 | |
# * RDSのインスタンスタイプ |
This file contains 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 'time' | |
require 'net/smtp' | |
HOST = 'email-smtp.us-east-1.amazonaws.com' | |
PORT = 465 | |
HELO = 'localhost' | |
ACCESS_KEY = 'YOUR_SMTP_USERNAME' | |
SECRET_KEY = 'YOUR_SMTP_PASSWORD' | |
FROM_ADDR = '[email protected]' |
This file contains 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 -*- | |
# AWSのアカウント料金からグラフを生成して、メールでレポートするスクリプトです | |
# $ sudo yum install ImageMagick ImageMagick-devel | |
# $ gem install rmagick | |
# $ gem install gruff | |
# $ gem install right_aws | |
# $ gem install aws-sdk | |
require 'right_aws' |