Skip to content

Instantly share code, notes, and snippets.

@ronaldbradford
ronaldbradford / lambda.auto-shutdown.py
Created January 26, 2023 15:06
Autoshutdown AWS RDS Instances and Clusters
# this Code will help to schedule stop the RDS databasrs using Lambda
# Yesh
# Version -- 2.0
# Adapted from https://aws.amazon.com/blogs/database/schedule-amazon-rds-stop-and-start-using-aws-lambda/
import boto3
import os
import sys
import time
from datetime import datetime, timezone

First Time Install Instructions for Mac OS

  • System Preferences | Sharing | Set Computer Name (CLI automated)
  • System Preferences | Sharing | Tick Remote Login
  • System Preferences | Trackpad | Scroll & Zoom | untick Scroll Direction (CLI automated)
  • Set Screenprint to dedicated location (CLI automated)
  • Set default shell to bash (CLI automated)
# Set Computer Name
@ronaldbradford
ronaldbradford / optimizer-trace.json
Created January 19, 2024 19:47
Full MySQL optimizer trace for "How to capture supporting information with your SQL statements"
{
"steps": [
{
"join_preparation": {
"select#": 1,
"steps": [
{
"expanded_query": "/* select#1 */ select `a`.`country_code` AS `country_code`,`c`.`name` AS `name`,count(0) AS `cnt` from (`airport` `a` join `country` `c` on((`a`.`country_code` = `c`.`country_code`))) group by `a`.`country_code`,`c`.`name` order by count(0) desc limit 10"
},
{
@ronaldbradford
ronaldbradford / README.md
Last active January 18, 2024 16:14
Monitor a connection to a MySQL Endpoint

Use this script to monitor an RDS instance endpoint, RDS proxy endpoint, Route 53 endpoint during any testing or failover operations.

    $ watch --differences -n 1 -t "./monitor-mysql-connection.sh"
@ronaldbradford
ronaldbradford / README.md
Last active October 20, 2023 20:03
Config Examples

Example Configs

Databases

  • MySQL (table format)
  • MySQL (tsv format)
  • MariaDB (Table format)
  • PostgreSQL (table format)
@ronaldbradford
ronaldbradford / postgresql-15.4-rds.txt
Created October 19, 2023 16:30
RDS PostgreSQL 15.4 Configuration Settings via psql
name | setting
-------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Option Benefits Limitions
Processlist Enabled by default. Only captures executing SQL. Required elevated privileges to view all statements for all users.
Performance Schema Captures executed statements. Provides additional metrics and aggregrations. Not enabled by default. Very tehnical information.
Sys Schema Extends Performance Schema with highly usable views and objects. Not enabled by default
Slow Query Log Provides historical log of slow queries. Useful for long term analysis. Only logs queries that run longer than configured long_query_time. Does not capture additional information at time of query.
General Log Provides historical log of all queries. Very useful for viewing a full statement of sequential SQL statements. Can impact system performance. Essential for any detailed testing framework.
Binary Log Provides historical log of all write queries. Very useful for per table metrics of write load. Does not capture SELECT statements. Not always enabled.
@ronaldbradford
ronaldbradford / mew-worlds-2023.txt
Created August 14, 2023 20:07
Mew World Champships 2023 Winner - Vance Kelley
#https://limitlesstcg.com/decks/list/8175
#Vance Kelley
#World Championships 2023 Winner
Pokémon (13)
4 Mew V CRZ 60
3 Mew VMAX FST 114
4 Genesect V FST 185
1 Meloetta FST 124
1 Oricorio FST 42
@ronaldbradford
ronaldbradford / mew.txt
Created August 12, 2023 13:25
Pokemon Mew Deck
Pokémon: 4
4 Genesect V FST 185
3 Mew V FST 113
3 Mew VMAX FST 114
2 Meloetta FST 124
Trainer: 17
4 Battle VIP Pass FST 225
4 Cram-o-matic FST 229
4 Ultra Ball SVI 196

Pokemon Decks

Alolan Vulpix VSTAR (SIT 34)

  • Vulpix Beta - 5 Mar 2023 (Fire & Dice - Bobby)
  • ARCEUS VSTAR WITH FLYING PIKACHU VMAX (JustInBasil)
  • ARTICUNO (JustInBasil)

About

  • Water Energy