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 | |
# オリジナルのポリシー名 | |
POLICY_NAME=$1 | |
# オリジナルのポリシーのjsonの場所 file:// とか http://とか | |
POLICY_DOCUMENT=$2 | |
# cli の configure 済の profile名いれる | |
AWS_PROFILE_NAME=$3 | |
# オリジナルのポリシーつくる |
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
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Sid": "Stmt1398823591000", | |
"Effect": "Allow", | |
"Action": [ | |
"ec2:RunInstances", | |
"ec2:StartInstances", | |
"ec2:StopInstances", |
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 | |
require __DIR__.'/../vendor/autoload.php'; | |
use Aws\S3\S3Client; | |
use Aws\Common\Enum\Region; | |
use Aws\Common\Enum\ClientOptions; | |
use Aws\Common\Credentials\Credentials; | |
$credentials = Credentials::fromIni('your-profile-name'); |
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": "VPC 120 with multiple subnets", | |
"Mappings": { | |
"SubnetConfig": { | |
"VPC": { | |
"CIDR": "10.120.0.0/24" | |
}, | |
"PublicA": { | |
"CIDR": "10.120.0.0/26", |
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 | |
class Hoge { | |
public static function unchi() { | |
echo "uncho"; | |
} | |
} | |
/* @var $hoge Hoge */ | |
$hoge::unchi(); |
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 | |
asname=$1 | |
private_key_path="~/.ssh/your-private-key.pem" | |
instances=$(aws autoscaling describe-auto-scaling-instances --query "AutoScalingInstances[?AutoScalingGroupName==\`$asname\`][InstanceId]" --output text) | |
query_private_ip='Reservations[].[Instances[][NetworkInterfaces][][][PrivateIpAddresses][][][PrivateIpAddress]]' | |
dnslist=`aws ec2 describe-instances --instance-ids $instances --query "$query_private_ip" --output text` | |
for hostname in $dnslist |
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
[treasuredata] | |
name=TreasureData | |
baseurl=http://packages.treasuredata.com/2/redhat/7/\$basearch | |
gpgcheck=1 | |
gpgkey=http://packages.treasuredata.com/GPG-KEY-td-agent |
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
aws s3 cp s3://bucket/key - | \ | |
bzip2 --best | \ | |
aws s3 cp - s3://bucket/key.bz2 |
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
files: | |
/root/os-timeclock.sh: | |
source: http://my-bucket-name.s3.amazonaws.com/shells/os-timeclock.sh | |
authentication: S3Access | |
Resources: | |
AWSEBAutoScalingGroup: | |
Metadata: | |
AWS::CloudFormation::Authentication: | |
S3Access: |
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 | |
# lb-hogehoge = ELB Tag Name Value | |
for instance_id in `aws elb describe-load-balancers --query 'LoadBalancerDescriptions[?LoadBalancerName==\`lb-hogehoge\`].["Instances"[]["InstanceId"]]' --output text` | |
do | |
ips=`aws ec2 describe-instances --instance-id $instance_id --query Reservations[].["Instances"[]["NetworkInterfaces"][][]["PrivateIpAddresses"][][]["PrivateIpAddress"]] --output text` | |
for ip in $ips |