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 'aws-sdk' | |
ACCESS_KEY = 'set your access key' | |
SECRET_KEY = 'set your secret key' | |
EC2_REGION = 'ec2.ap-southeast-1.amazonaws.com' | |
ec2 = AWS::EC2.new( | |
:access_key_id => ACCESS_KEY, | |
:secret_access_key => SECRET_KEY, |
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 -*- | |
## Auto Scalingの作成〜削除までの流れをまとめました、スクリプトではないので注意して下さい。 | |
require 'aws-sdk' | |
ACCESS_KEY = 'set your access key' | |
SECRET_KEY = 'set your secret key' | |
AS_REGION = 'autoscaling.ap-southeast-1.amazonaws.com' | |
CW_REGION = 'monitoring.ap-southeast-1.amazonaws.com' | |
as = AWS::AutoScaling.new( |
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 -*- | |
## ELBを起動するまでの流れです。スクリプトではないので注意して下さい | |
require 'aws-sdk' | |
## 設定 | |
ACCESS_KEY = 'set your access key' | |
SECRET_KEY = 'set your secret key' | |
ELB_REGION = 'elasticloadbalancing.ap-southeast-1.amazonaws.com' | |
elb_name = 'okochang-elb' |
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 -*- | |
## EC2インスタスを起動するまでの流れで、スクリプトではないので注意して下さい | |
require 'aws-sdk' | |
ACCESS_KEY = 'set your access key id' | |
SECRET_KEY = 'set your secret key' | |
EC2_REGION = 'ec2.ap-southeast-1.amazonaws.com' | |
ec2 = AWS::EC2.new( | |
:access_key_id => ACCESS_KEY, | |
:secret_access_key => SECRET_KEY, |
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
$ gem install dalli | |
$ irb | |
> require 'dalli' | |
=> true | |
> dc = Dalli::Client.new('yanase-cache-cluster.k9yqoo.cfg.apne1.cache.amazonaws.com:11211') | |
=> #<Dalli::Client:0x000000011c4890 @servers="yanase-cache-cluster.k9yqoo.cfg.apne1.cache.amazonaws.com:11211", @options={}, @ring=nil> | |
> dc.set("hoge", "foo") | |
=> true | |
> dc.get("hoge") | |
=> "foo" |
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 'aws-sdk' | |
ACCESS_KEY = "set your access key id" | |
SECRET_KEY = "set your secret key" | |
EC_REGION = 'elasticache.ap-northeast-1.amazonaws.com' | |
EC2_REGION = 'ec2.ap-northeast-1.amazonaws.com' | |
## ElastiCache用のインターフェースを作成します。 | |
ec = AWS::ElastiCache.new( | |
:access_key_id => ACCESS_KEY, |
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 'aws-sdk' | |
ACCESS_KEY = "set your access key id" | |
SECRET_KEY = "set your secret key" | |
REGION = 'redshift.us-east-1.amazonaws.com' | |
EC2_REGION = 'ec2.us-east-1.amazonaws.com' | |
## Redshift用のインターフェースを作成します | |
rs = AWS::Redshift.new( |
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 'aws-sdk' | |
ACCESS_KEY = "set your access key id" | |
SECRET_KEY = "set your secret key" | |
REGION = 'redshift.us-east-1.amazonaws.com' | |
## Redshift用のインターフェースを作ります | |
rs = AWS::Redshift.new( | |
:access_key_id => ACCESS_KEY, |
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 'net/ping' | |
## Pingの宛て先を指定して下さい | |
addr = 'google.co.jp' | |
pinger = Net::Ping::External.new(addr) | |
## Pingが通るかどうかテストします | |
if pinger.ping? |
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 'aws-sdk' | |
ACCESS_KEY ='set your access key id' | |
SECRET_KEY = 'set your secret key' | |
REGION = 'rds.ap-northeast-1.amazonaws.com' | |
rds_information_array = [] | |
rds = AWS::RDS.new( | |
:access_key_id => ACCESS_KEY, |