- 指定されたEBSボリュームのスナップショットを作成する。
- 指定があった場合は指定された世代数を残して過去のスナップショットを削除する
- 以下のようにしてスクリプトを取得する。もしくは、downloadして解凍。
$ git clone https://gist.github.com/4248981.git
require 'rubygems' | |
require 'rest-client' | |
RestClient.proxy = ENV['http_proxy'] | |
while true | |
begin | |
res = RestClient.get( 'http://[ELBのドメイン名]/test' ) | |
puts res.body | |
rescue RestClient::Exception => e | |
p #{e.response.code} #{e.message}" |
require 'aws-sdk' | |
cw = AWS::CloudWatch.new(:proxy_uri => ENV['HTTP_PROXY'] || ENV['http_proxy']) | |
cw.metrics.filter('metric_name', 'EstimatedCharges').each do |m| | |
service_name = m.dimensions.find { |x| x[:name] == 'ServiceName' } | |
service_name = service_name ? service_name[:value] : "Total" | |
stats = m.statistics( | |
:start_time => Time.now - 24 * 3600, | |
:end_time => Time.now, | |
:statistics => ['Maximum'] |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>get started with three.js</title> | |
</head> | |
<body> | |
<script src="http://threejs.org/build/three.min.js"></script> | |
<script src="http://threejs.org/examples/js/controls/OrbitControls.js"></script> |
require 'net/http' | |
require 'uri' | |
require 'optparse' | |
server = nil | |
port = 443 | |
ca_file = nil | |
opt = OptionParser.new | |
opt.on('-s', '--server=VAL') { |v| server = v } |
require 'rubygems' | |
require 'zipruby' | |
outdir = "test" | |
Zip::Archive.open('hoge.zip', Zip::CREATE) do |arc| | |
arc.add_file('test.txt') | |
arc.encrypt('password') | |
end |
# A sample Gemfile | |
source "http://rubygems.org" | |
# gem "rails" | |
gem "activesupport" | |
gem "tzinfo" |
javascript:(function(){t%20=%20prompt("JIRA%E8%AA%B2%E9%A1%8C%20number","");if(t!==""&&t!==null){location.href%20=%20"http://example.com/jira/browse/"%20+%20t.replace(/^#/,"")}else%20if(t==""){location.href%20=%20"http://example.com/jira/"}})(); |
$ ruby get_value_from_cloudwatch.rb --help
Usage: get_value_from_cloudwatch [options]
--endpoint=VAL default:us-east-1, us-east-1/us-west-2/us-west-1/eu-west-1/ap-southeast-1/ap-southeast-2/ap-northeast-1/sa-east-1
--namespace=VAL
--metric-name=VAL
--no-exist-dimensions
--dimension=VAL format:: or ~