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
#! /usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import sys | |
# 標準入力から読み込む | |
for line in sys.stdin: | |
# strip()を呼び出して余分な空白や改行コードを取り除く | |
line = line.strip() | |
# split()を呼び出して、単語ごとに分ける |
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
CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED HEREUNDER. | |
Statement of Purpose | |
The laws of most jurisdictions throughout the world automatically confer exclusive Copyright and Related Rights (defined below) upon the creator and subsequent owner(s) (each and all, an "owner") of an original work of authorship and/or a database (each, a "Work"). | |
Certain owners wish to permanently relinquish those rights to a Work for the purpose of contributing to a commons of creative, cultural and scientific works ("Commons") that the public can reliably and without fear of later claims of infringement build upon, modif |
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", | |
"Description": "Create a Server in specified VPC subnet", | |
"Parameters": { | |
"InstanceType": { | |
"Description": "EC2 instance type", | |
"Type": "String", | |
"Default": "t1.micro", | |
"AllowedValues": [ | |
"m1.small", |
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", | |
"Description": "AWS CloudFormation Sample Template vpc_multiple_subnets.template: Sample template showing how to create a VPC with multiple subnets. The first subnet is public and contains the load balancer, the second subnet is private and contains an EC2 instance behind the load balancer. **WARNING** This template creates an Amazon EC2 instance. You will be billed for the AWS resources used if you create a stack from this template.", | |
"Parameters": { | |
"NetCIDR": { | |
"Description": "VPC Subnet, like 10.0.0.0/16", | |
"Type": "String", | |
"Default": "10.0.0.0/16" | |
}, | |
"PublicSubnetCIDR": { |
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
#! /bin/sh | |
source virtualenvwrapper.sh | |
mkvirtualenv bootcamp | |
cat << EOF > requirements.txt | |
Baker==1.3 | |
Fabric==1.5.1 | |
boto==2.6.0 | |
paramiko==1.9.0 | |
pycrypto==2.6 | |
EOF |
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
#! /bin/sh | |
sudo yum -y install emacs git gcc make python-devel | |
curl https://raw.github.com/pypa/pip/master/contrib/get-pip.py | sudo python | |
sudo pip install virtualenvwrapper | |
. virtualenvwrapper.sh | |
mkvirtualenv bootcamp |
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
from fabric.api import run, env, sudo | |
from fabric.context_managers import cd | |
def check(): | |
for k in env: | |
print k, env[k] | |
def install_httpd(): | |
sudo("yum -y install httpd") |
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
#! /usr/bin/env python | |
from boto.vpc import VPCConnection | |
from boto.ec2 import get_region, connect_to_region | |
import baker | |
import time | |
def create_vpc(region, vpc_cidr): | |
ec2region = get_region(region) | |
conn = VPCConnection(region=ec2region) | |
return conn.create_vpc(vpc_cidr) |
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
#! /usr/bin/env python | |
from boto.vpc import VPCConnection | |
from boto.ec2 import get_region | |
EC2_REGION='ap-northeast-1' | |
VPC_CIDR='10.99.0.0/16' | |
PUBLIC_CIDR='10.99.0.0/24' | |
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
#! /bin/bash | |
export AWS_ACCESS_KEY_ID=YOURAWSKEYHERE | |
export AWS_SECRET_ACCESS_KEY=YOURAWSSECRETACCESSKEYHERE | |
HOSTNAME=`curl http://169.254.169.254/latest/meta-data/public-hostname` | |
TTL=60 | |
R53CMD=/usr/bin/route53 | |
ZONEID=Z1SP2Z8BRPBI0E | |
CNAME=host.domain.com. |