When using Caddy Server, it stores certificates in ~/.caddy/acme/acme-v01.api.letsencrypt.org/sites/{your domain name}/
3 files are stored in the folder called:
- {yourdomain}.crt
- {yourdomain}.json
- {yourdomain}.key
# Sync 2 S3 buckets | |
aws s3 sync s3://{source} s3://{destination} | |
# Determine size of an S3 bucket | |
aws s3api list-objects --bucket {s3_bucket_name} --output json --query "[sum(Contents[].Size), length(Contents[])]" | |
# dump large mysql DB > tested on 200gb DBs | |
mysqldump -h {HOST} -u {USER} -p {TABLE} --single-transaction --default-character-set=utf8 --quick --extended-insert > {FILENAME}.sql |
#!/usr/bin/env bash | |
# A small script to take a larger text based file and break it down to several smaller files | |
# of 500 lines each for easier processing, keeping the headings at the top of each file | |
FILENAME=${1} | |
if [ -z ${FILENAME} ]; then | |
echo "Please provide a filename, for example: bash split.sh /path/to/data.csv"; | |
else |
#!/usr/bin/env bash | |
# white list all public IPs from an AWS region in to a security group | |
security_group="sg-xxxxxx" | |
region="eu-west-1" | |
port="3306" | |
# list the public IPs from the instances in region | |
public_ips=`aws ec2 describe-instances --query "Reservations[*].Instances[*].PublicIpAddress" --output=text --region=${region} | xargs` |
# list your aws elasticache parameter groups | |
aws elasticache describe-cache-parameter-groups --profile=xxxxx --region=us-east-1 | |
# list the parameters currently set in a particular aws elasticache parameter groups | |
aws elasticache describe-cache-parameters --profile=xxxxx --region=us-east-1 --cache-parameter-group-name=xxxxx > xxxxx.json |
# prerequisites for docker | |
apt-get update | |
apt-get -y install apt-transport-https | |
apt-get -y install ca-certificates | |
apt-get -y install curl | |
apt-get -y install software-properties-common | |
# docker repos | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - \ | |
&& echo "deb [arch=amd64] https://download.docker.com/linux/ubuntu xenial stable" >> /etc/apt/sources.list.d/additional-repositories.list \ |
When using Caddy Server, it stores certificates in ~/.caddy/acme/acme-v01.api.letsencrypt.org/sites/{your domain name}/
3 files are stored in the folder called:
#!/usr/bin/env bash | |
# The following assumes you have an AWS account with the AWS CLI installed locally | |
# It will ask which VPC and Subnets to use | |
# Show the commands being executed | |
set -ex | |
# AWS region | |
REGION="eu-west-1" |
# Moved to a Repo here instead and added some additional files | |
https://github.com/gordonmurray/ecs_cluster_using_aws_cli |
# Simple script to list all RDS instances and then disable Automatic Minor Version Upgrades | |
# list RDS instances to a file | |
aws rds --region eu-west-1 describe-db-instances | jq -r '.DBInstances[].DBInstanceIdentifier' > rds.log | |
# loop over the items in the file, disable auto minor version upgrades | |
while read rds; do | |
aws rds modify-db-instance --region eu-west-1 --db-instance-identifier ${rds} --no-auto-minor-version-upgrade | |
sleep 5 | |
done <rds.log |
#!/usr/bin/env bash | |
set -xe | |
REGION="eu-west-1" | |
# list RDS instances to a file | |
aws rds --region ${REGION} describe-db-instances | jq -r '.DBInstances[].DBInstanceIdentifier' > rds.log | |
# loop over the rds instances in the file |