$ python get_logs.py rds-db-instance-name rds.log aws-access-key aws-secret-key
$ ./pgbadger -p '%t:%r:%u@%d:[%p]:' ./rds.log
$ open out.html
| --- | |
| - hosts: c1 | |
| become: yes | |
| tasks: | |
| - name: ensure ssh root login is disabled | |
| lineinfile: | |
| dest: /etc/ssh/sshd_config | |
| state: present | |
| regexp: "^PermitRootLogin" |
| #!/bin/bash | |
| ENV=$1 | |
| # Install terraform | |
| if [ ! -x terraform ] | |
| then | |
| wget -q https://releases.hashicorp.com/terraform/0.8.8/terraform_0.8.8_linux_amd64.zip | |
| unzip terraform_0.8.8_linux_amd64.zip | |
| chmod +x terraform |
| #!/bin/bash -ex | |
| export name | |
| export template_url=$2 | |
| aws cloudformation create-stack --stack-name ${name} --template-url ${template_url} \ | |
| # Check StackStatus | |
| sleep 120 |
| #!/bin/bash | |
| # | |
| # Download and compress cloudwatch log for the specified group, stream and date | |
| DATE=$1 | |
| CLOUDWATCH_LOG_GROUP=$2 | |
| CLOUDWATCH_LOG_STREAM=$3 | |
| LOG_FILE="${DATE}-${CLOUDWATCH_LOG_GROUP}-${CLOUDWATCH_LOG_STREAM}.log" | |
| echo "Installing awslog tools" |
| #!/bin/bash | |
| # | |
| # Update docker image tag in a kubernetes deployment | |
| # Kubernetes cluster address | |
| K8S_CLUSTER="change.me" | |
| # Kubernetes cluster certificate path | |
| K8S_CERTIFICATE="/change/me" | |
| # Kubernetes cluster token | |
| K8S_USER="CHANGEME" |
| #!/bin/bash -x | |
| # | |
| # archive-cloudwatch-logs-to-s3.sh | |
| # | |
| # This script archives all cloudwatch logs to S3 for the specified environment | |
| # Environment (prefix used in all matching cloudwatch log groups - ex: prod-tomcat, prod-apache, prod-mysql, ...) | |
| ENV=$1 | |
| # Destination S3 Bucket | |
| S3_LOG_BUCKET="$2" |
| server { | |
| listen 80; | |
| server_name localhost; | |
| location / { | |
| proxy_pass http://webserver:8080; | |
| } | |
| } | |
| server { |
$ python get_logs.py rds-db-instance-name rds.log aws-access-key aws-secret-key
$ ./pgbadger -p '%t:%r:%u@%d:[%p]:' ./rds.log
$ open out.html
| #!/usr/bin/bash -e | |
| # This script will be use to automate the mongodb rpm updates steps on ReplicaSet nodes installed on EC2 instances with CentOS7 | |
| mongo_connect() { | |
| mongo --quiet ${MONGO_DB} -u ${MONGO_USER} -p ${MONGO_PASS} | |
| } | |
| usage() { | |
| cat << EOF |
I hereby claim:
To claim this, I am signing this object: