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
# encoding: utf-8 | |
#!/usr/bin/env ruby | |
require "./runtime" | |
unless ARGV.include?("--dotcucumber") | |
STDERR.puts "Must be specified option --dotcucumber OUTPUT_DIR" | |
exit 1 | |
end | |
runtime = Runtime.new(ARGV.dup) | |
runtime.write_stepdefs_json |
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
# encoding: utf-8 | |
#!/usr/bin/env ruby | |
require "./runtime" | |
if ARGV.empty? | |
STDERR.puts "Must be specified STEP_NAME" | |
exit 1 | |
end | |
step_name = ARGV.shift | |
runtime = Runtime.new(ARGV.dup) |
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 | |
if [ $# -lt 3 ]; then | |
CMDNAME=`basename $0` | |
cat <<__EOT__ | |
Delete and then add a record to a zone. | |
New record value is set current public-ipv4 or public-hostname to get from ec2 meta-data. | |
Usage: $CMDNAME [hosted_zone_id] [name] [type] [ttl] [comment] | |
type is supported A and CNAME. | |
ttl and comment are optional. |
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 | |
if [ $# -lt 3 ]; then | |
CMDNAME=`basename $0` | |
cat <<__EOT__ | |
Add a record to a zone. | |
New record value is set current public-ipv4 or public-hostname to get from ec2 meta-data. | |
Usage: $CMDNAME [hosted_zone_id] [name] [type] [ttl] [comment] | |
type is supported A and CNAME. | |
ttl and comment are optional. |
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
require "resolv" | |
require "./mongodb" | |
require "./simpledb" | |
RECORD_LIMIT = 2000 | |
unless ARGV.size >= 3 | |
puts <<USAGE | |
Usage: #{File.basename(__FILE__)} [FROM] [TO] | |
FROM : start date |
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
# see also: https://github.com/intridea/omniauth/wiki/Integration-Testing | |
OmniAuth.config.test_mode = true | |
OmniAuth.config.mock_auth[:facebook] = OmniAuth::AuthHash.new({ | |
provider: "facebook", | |
uid: "12345", | |
info: { name: "Mock User" }, | |
credentials: { token: "1234567890", expires_at: Time.now + 60.days }, | |
extra: { raw_info: { id: "12345", name: "Mock User", } } | |
}) |
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
# lib/sample/command/base.rb | |
module Sample | |
module Command | |
class Base < Thor | |
def self.banner(task, namespace = false, subcommand = true) | |
super | |
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
#!/bin/sh | |
[ -z "$JAVA_HOME" ] && export JAVA_HOME=/usr/lib/jvm/jre | |
[ -z "$EC2_HOME" ] && export EC2_HOME=/opt/aws/apitools/ec2 | |
[ -z "$AWS_PATH" ] && export AWS_PATH=/opt/aws && export PATH="${PATH}:${AWS_PATH}/bin" | |
AWS_REGION=`curl -s http://169.254.169.254/latest/meta-data/placement/availability-zone | sed -e 's/[a-z]$//'` | |
INSTANCE_ID=`curl -s http://169.254.169.254/latest/meta-data/instance-id` | |
KERNEL_ID=`curl -s http://169.254.169.254/latest/meta-data/kernel-id` | |
OPTS="--aws-access-key ${AWS_ACCESS_KEY_ID} --aws-secret-key ${AWS_SECRET_ACCESS_KEY} --region ${AWS_REGION}" |
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
require "aws-sdk" | |
['us-east-1', 'ap-northeast-1'].each do |region| | |
AWS::ELB.new(region: region).load_balancers.each do |elb| | |
elb.client.describe_instance_health(load_balancer_name: elb.name)[:instance_states].each do |h| | |
puts "#{region}\t#{elb.name}\t#{h[:instance_id]}\t#{h[:state]}\t#{h[:description]}\t#{h[:reason_code]}" | |
end | |
end | |
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
require "aws-sdk" | |
ACCOUNT_NUMBER = ENV['ACCOUNT_NUMBER'} | |
REGION_NAME = ENV['REGION_NAME'] | |
AMI_DESCRIPTION = ENV['AMI_DESCRIPTION_FILTER'] | |
ec2 = AWS::EC2.new(region: REGION_NAME) | |
images = ec2.images.filter('owner-id', ACCOUNT_NUMBER).filter('description', AMI_DESCRIPTION) | |
sorted = images.to_a.sort{|a, b| b.description <=> a.description } | |
sorted.each do |image| |
OlderNewer