This file contains hidden or 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にSSL証明書をセットするスクリプトです。 | |
| # 要 AWS SDK for Ruby V2 | |
| require 'aws-sdk-core' | |
| require 'yaml' | |
| require 'pp' | |
| config = YAML.load(File.read("config.yml")) |
This file contains hidden or 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
| { | |
| "AWSTemplateFormatVersion": "2010-09-09", | |
| "Resources": { | |
| "distd1gtempk1i1houcloudfrontnet": { | |
| "Type": "AWS::CloudFront::Distribution", | |
| "Properties": { | |
| "DistributionConfig": { | |
| "Comment": "commnent string", | |
| "DefaultRootObject": "index.html", | |
| "PriceClass": "PriceClass_200", |
This file contains hidden or 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 -*- | |
| # | |
| # S3+CloudFrontでCache Distributionパターンを構築するスクリプトです。 | |
| # 要 AWS SDK for Ruby V2 | |
| require 'aws-sdk-core' | |
| require 'yaml' | |
| require 'pp' | |
| config = YAML.load(File.read("config.yml")) |
This file contains hidden or 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 -*- | |
| # | |
| # | |
| # http://qiita.com/takashibagura/items/8b49b8b02bb797210c5b | |
| # 上記サイトを参考にAWS SDK for Ruby v2で作成 | |
| require 'aws-sdk-core' | |
| require 'yaml' | |
| require 'pp' |
This file contains hidden or 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/http' | |
| require 'aws-sdk' | |
| instance_id = Net::HTTP.get('169.254.169.254', '/latest/meta-data/instance-id') | |
| ec2_region = 'ec2.' + Net::HTTP.get('169.254.169.254', '/latest/meta-data/placement/availability-zone').chop + '.amazonaws.com' | |
| image_name = instance_id + '-' + Time.now.strftime("%Y%m%d%H%M") | |
| comment = "automatically generated image" | |
| @ec2 = AWS::EC2.new( |
This file contains hidden or 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
| #PHP Unitテスト用(php5.6)Dockerファイルサンプル | |
| FROM centos:centos6 | |
| MAINTAINER Akira345 | |
| # Set TimeZone | |
| RUN echo 'ZONE="Asia/Tokyo"' > /etc/sysconfig/clock | |
| # Yum Repo Setting | |
| RUN sed -i -e 's/^#baseurl/baseurl/' /etc/yum.repos.d/CentOS-Base.repo |
This file contains hidden or 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
| <?php | |
| include_once "Cache/Lite.php"; | |
| //キャッシュの生存時間は8時間 | |
| $option = array( | |
| "cacheDir" => "./cache/", | |
| "lifeTime" => "28800" | |
| ); | |
| $cache = new Cache_Lite($option); | |
| function hoge($in_year,$in_month,$cache) { |
This file contains hidden or 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
| vpc_id = "" | |
| subnet_id="" | |
| private_ip = "" | |
| #すでにローカルIPが使用されていないか? | |
| ary_ips = [] | |
| ec2.client.describe_network_interfaces(filters: [{ name: "vpc-id",values: [vpc_id]},{name: "subnet-id",values: [subnet_id]}])[:network_interface_set].each {|d| | |
| d[:private_ip_addresses_set].each {|dd| | |
| ary_ips.push(dd[:private_ip_address]) | |
| } |
This file contains hidden or 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
| # | |
| # このあたりも参照。 | |
| # https://gist.github.com/taka328w/1615935 | |
| # | |
| #展開するインスタンスのベースになるAMI | |
| base_image_id = "" | |
| #インスタンスタイプ | |
| instance_type = "" | |
| #VPCに所属するサブネットID |
This file contains hidden or 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 -*- | |
| # | |
| # http://buta9999.hatenablog.jp/entry/2014/01/30/010351を参考に作成 | |
| require 'aws-sdk' | |
| require 'yaml' | |
| require 'pp' | |
| require "optparse" | |
| opts = OptionParser.new |