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 -x | |
# The bucket containing the userdata.d | |
export USERDATAD_BUCKET=userdata.example.com | |
# Required to set the endpoint of the aws-cli | |
export AWS_DEFAULT_REGION=eu-west-1 | |
# Install Prerequisites | |
yum install -y aws-cli | |
# Download all .sh scripts from the bucket and pipe to bash | |
SCRIPTS=$(aws s3 ls s3://$USERDATAD_BUCKET/userdata.d/ | awk '{ print $4 }') | |
for S in $SCRIPTS; do |
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
DATE = $(shell date) | |
release: | |
@echo "Enter commit message:" | |
@read REPLY; \ | |
echo "${DATE} - $$REPLY" >> CHANGELOG; \ | |
git add --all; \ | |
git commit -m "$$REPLY"; \ | |
git push |
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
version: 0.1 | |
log: | |
fields: | |
service: registry | |
http: | |
addr: :5000 | |
headers: | |
X-Content-Type-Options: [nosniff] | |
storage: | |
cache: |
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 | |
openssl x509 -req -days 365 -in $1.csr -signkey $1.key -out $1.crt |
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 |
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 | |
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
#!/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 <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 | |
# "Statement": [ | |
# { | |
# "Effect": "Allow", | |
# "Action": [ | |
# "ec2:CreateImage", | |
# "ec2:RegisterImage" | |
# ], | |
# "Resource": "*" | |
# } |