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/bash | |
# This script generates test logs with a UTC ISO 8601 | |
# compliant timestamp | |
# http://www.iso.org/iso/home/standards/iso8601.htm, | |
# https://en.wikipedia.org/wiki/ISO_8601 | |
while true | |
do | |
date -u +%Y-%m-%dT%H:%M:%S%z | |
sleep 1 |
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
.centre { | |
width:500px; | |
height:500px; | |
position:absolute; | |
left:50%; | |
top:50%; | |
margin:-250px 0 0 -250px; | |
} |
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/bash | |
echo "Usage: $0 <REGION>" | |
exit 1 | |
apt-get update | |
wget https://s3.amazonaws.com/aws-cloudwatch/downloads/latest/awslogs-agent-setup.py | |
python ./awslogs-agent-setup.py --region $1 |
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/bash -ex | |
apt-get update | |
apt-get -y install python-setuptools | |
mkdir aws-cfn-bootstrap-latest | |
curl https://s3.amazonaws.com/cloudformation-examples/aws-cfn-bootstrap-latest.tar.gz | tar xz -C aws-cfn-bootstrap-latest --strip-components 1 | |
easy_install aws-cfn-bootstrap-latest | |
cp -f aws-cfn-bootstrap-latest/init/ubuntu/cfn-hup /etc/init.d/ && chmod 0755 /etc/init.d/cfn-hup | |
update-rc.d cfn-hup defaults | |
service cfn-hup start |
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
"ScheduledActionUp": { | |
"Type": "AWS::AutoScaling::ScheduledAction", | |
"Properties": { | |
"AutoScalingGroupName": { | |
"Ref": "AutoScalingGroup" | |
}, | |
"MaxSize": "1", | |
"MinSize": "1", | |
"Recurrence": "0 7 * * 1" | |
} |
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/bash | |
# "Statement": [ | |
# { | |
# "Effect": "Allow", | |
# "Action": [ | |
# "ec2:CreateImage", | |
# "ec2:RegisterImage" | |
# ], | |
# "Resource": "*" | |
# } |
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/bash | |
if [ $# -eq 0 ]; then | |
echo "Usage: $0 <CERT_NAME>" | |
echo "e.g. $0 example.com" | |
else | |
openssl genrsa -des3 -passout pass:x -out $1.pass.key 2048 | |
openssl rsa -passin pass:x -in $1.pass.key -out $1.key | |
rm $1.pass.key | |
openssl req -new -key $1.key -out $1.csr | |
fi |
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/bash | |
# Get Instance Details | |
INSTANCE_ID=$(wget -q -O- http://169.254.169.254/latest/meta-data/instance-id) | |
REGION=$(wget -q -O- http://169.254.169.254/latest/meta-data/placement/availability-zone | sed -e 's/\([1-9]\).$/\1/g') |
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/bash | |
if [ $# -eq 0 ]; then | |
echo "Usage: $0 register|deregister <LOAD_BALANCER_NAME>" | |
echo "e.g. $0 register load-balancer-name" | |
else | |
INSTANCE_ID=$(wget -q -O- http://169.254.169.254/latest/meta-data/instance-id) | |
REGION=$(wget -q -O- http://169.254.169.254/latest/meta-data/placement/availability-zone | sed -e 's/\([1-9]\).$/\1/g') | |
if [ "$1" == "deregister" ]; then | |
aws elb $1-instances-from-load-balancer \ | |
--load-balancer-name $2 \ |
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
"cat << EOF > /etc/init.d/register_with_elb\n", | |
"#!/bin/bash\n", | |
"aws elb register-instances-with-load-balancer --load-balancer-name ", | |
{ | |
"Ref": "LoadBalancerName" | |
}, | |
" --instances $(wget -q -O- http://169.254.169.254/latest/meta-data/instance-id) --region ", | |
{ | |
"Ref": "AWS::Region" | |
}, |
OlderNewer