Skip to content

Instantly share code, notes, and snippets.

@olublessed
olublessed / gist:d0c8474aef81e175a094afb8219ed98c
Created August 3, 2022 15:55 — forked from iann0036/gist:b473bbb3097c5f4c656ed3d07b4d2222
List of expensive / long-term effect AWS IAM actions
route53domains:RegisterDomain
route53domains:RenewDomain
route53domains:TransferDomain
ec2:ModifyReservedInstances
ec2:PurchaseHostReservation
ec2:PurchaseReservedInstancesOffering
ec2:PurchaseScheduledInstances
rds:PurchaseReservedDBInstancesOffering
dynamodb:PurchaseReservedCapacityOfferings
s3:PutObjectRetention
@olublessed
olublessed / gist:1e95837f3e30a2a17097e80b9a8b0b2e
Created April 15, 2022 13:53 — forked from pitch-gist/gist:2999707
HTML: Simple Maintenance Page
<!doctype html>
<title>Site Maintenance</title>
<style>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
a { color: #dc8100; text-decoration: none; }
a:hover { color: #333; text-decoration: none; }
</style>
@olublessed
olublessed / info.md
Created November 1, 2018 22:44 — forked from manicminer/info.md
RDS Production termination protection

RDS Production Termination Protection

Create a policy like this, substituting your AWS account number, then attach it to all groups and roles. It will prevent deletion of RDS instances containing the string "prod" in their name.

Note: This is intended to prevent accidental deletion, and is easily sidestepped.

@olublessed
olublessed / mysql-docker.sh
Created July 10, 2018 13:39 — forked from spalladino/mysql-docker.sh
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
ERROR 1146 (42S02) at line 31 in file: './views/p_s/ps_check_lost_instrumentation_57.sql': Table 'performance_schema.global_status' doesn't exist
ERROR 1146 (42S02) at line 32 in file: './views/p_s/memory_by_user_by_current_bytes.sql': Table 'performance_schema.memory_summary_by_user_by_event_name' doesn't exist
ERROR 1146 (42S02) at line 32 in file: './views/p_s/x_memory_by_user_by_current_bytes.sql': Table 'performance_schema.memory_summary_by_user_by_event_name' doesn't exist
ERROR 1146 (42S02) at line 32 in file: './views/p_s/memory_by_host_by_current_bytes.sql': Table 'performance_schema.memory_summary_by_host_by_event_name' doesn't exist
ERROR 1146 (42S02) at line 32 in file: './views/p_s/x_memory_by_host_by_current_bytes.sql': Table 'performance_schema.memory_summary_by_host_by_event_name' doesn't exist
ERROR 1146 (42S02) at line 35 in file: './views/p_s/memory_by_thread_by_current_bytes.sql': Table 'performance_schema.memory_summary_by_thread_by_event_name' doesn't exist
ERROR 1146 (42S02) at line 35
@olublessed
olublessed / sql_backup.sh
Created August 23, 2017 19:33 — forked from niraj-shah/sql_backup.sh
Amazon S3 Backup Script for MySQL Databases
#!/bin/bash
# Shell script to backup MySql database
# CONFIG - Only edit the below lines to setup the script
# ===============================
MyUSER="root" # USERNAME
MyPASS="password" # PASSWORD
MyHOST="localhost" # Hostname
Get:38 http://archive.ubuntu.com precise-security/universe i386 Packages [197 kB]
Fetched 28.5 MB in 42s (666 kB/s)
Reading package lists...
W: GPG error: http://repo.percona.com precise Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 9334A25F8507EFA5
WARNING: The following packages cannot be authenticated!
libmysqlclient18 percona-xtrabackup
E: There are problems and -y was used without --force-yes
The command '/bin/sh -c apt-key adv --keyserver keys.gnupg.net --recv-keys 1C4CBDCDCD2EFD2A && sed -i '/repo.percona.com/d' /etc/apt/sources.list && sh -c 'echo "deb http://repo.percona.com/apt precise main" >> /etc/apt/sources.list' && sh -c 'echo "deb-src http://repo.percona.com/apt precise main" >> /etc/apt/sources.list' && apt-get -q -y update && apt-get -o Dpkg::Options::='--force-confnew' -qqy install nano wget psmisc libdbi-perl libdbd-mysql-perl libwrap0 perl libaio1 mysql-client percona-xtrabackup libssl0.9.8 libssl1.0.0 rsync netcat && wget --n
RUN apt-key adv --keyserver keys.gnupg.net --recv-keys 1C4CBDCDCD2EFD2A && sed -i '/repo.percona.com/d' /etc/apt/sources.list && sh -c 'echo "deb http://repo.percona.com/apt precise main" >> /etc/apt/sources.list' && sh -c 'echo "deb-src http://repo.percona.com/apt precise main" >> /etc/apt/sources.list' apt-get -q -y update && apt-get -o Dpkg::Options::='--force-confnew' -qqy install nano wget psmisc libdbi-perl libdbd-mysql-perl libwrap0 perl libaio1 mysql-client percona-xtrabackup libssl0.9.8 libssl1.0.0 rsync netcat && wget --no-check-certificate https://launchpad.net/codership-mysql/5.5/5.5.34-25.9/+download/mysql-server-wsrep-5.5.34-25.9-amd64.deb && wget --no-check-certificate https://launchpad.net/galera/2.x/25.2.8/+download/galera-25.2.8-amd64.deb && dpkg -i galera-25.2.8-amd64.deb && dpkg -i mysql-server-wsrep-5.5.34-25.9-amd64.deb
# # MySQL Galera Cluster 5.5.34-25.9/Galera 2.8/Ubuntu 12.04 64bit
FROM ubuntu:12.04
MAINTAINER Severalnines AB <[email protected]>
RUN apt-key adv --keyserver keys.gnupg.net --recv-keys 1C4CBDCDCD2EFD2A
RUN sed -i '/repo.percona.com/d' /etc/apt/sources.list
RUN sh -c 'echo "deb http://repo.percona.com/apt precise main" >> /etc/apt/sources.list'
RUN sh -c 'echo "deb-src http://repo.percona.com/apt precise main" >> /etc/apt/sources.list'
RUN apt-get -q -y update
RUN LC_ALL=en_US.utf8 DEBIAN_FRONTEND=noninteractive apt-get -o Dpkg::Options::='--force-confnew' -qqy install nano wget psmisc libdbi-perl libdbd-mysql-perl libwrap0 perl libaio1 mysql-client percona-xtrabackup libssl0.9.8 libssl1.0.0 rsync netcat