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
"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" | |
}, |
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 | |
grep -v '^$\|^\s*\#' $1 |
OlderNewer