Skip to content

Instantly share code, notes, and snippets.

@ronaldbradford
ronaldbradford / README.md
Created January 29, 2025 15:12
NorthWind for RDS

This is an adaption of the Northwind sample database that can operate with AWS RDS and the Linux sqlcmd command.

Usage:

sqlcmd -S ${INSTANCE_ENDPOINT} -U ${DB_USER} -P ${DB_PASSWORD} -l 2 -i instnwnd.sql
@ronaldbradford
ronaldbradford / chat.html
Created December 12, 2024 00:41
Broken ChatGPT Output (Mac app)
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js ie6 oldie" lang="en-US"> <![endif]-->
<!--[if IE 7]> <html class="no-js ie7 oldie" lang="en-US"> <![endif]-->
<!--[if IE 8]> <html class="no-js ie8 oldie" lang="en-US"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en-US"> <!--<![endif]-->
<head>
<title>ios.chat.openai.com | 522: Connection timed out</title>
<meta charset="UTF-8" />
@ronaldbradford
ronaldbradford / README.md
Last active December 7, 2024 18:50
WeSQL 2024-12-07 Docker Logs - Issue #48
@ronaldbradford
ronaldbradford / OBS.txt
Last active February 17, 2025 18:34
Pokémon Wish Lists Reverse Holofoil/Energy
Reverse Holofoil I Need from Obsidian Flames (OBS)
#30 - Entei
#138 - Malamar
#154 - Varoom
#180 - Lechonk
#181 - Lechonk
#184 - Oinkologne
#185 - Flamigo
#193 - Poppy
@ronaldbradford
ronaldbradford / README.md
Last active October 23, 2024 14:22
Minimalistic MySQL collection scripts

These bash scripts do the smallest amount of work possible to collect simple MySQL metrics and running SQL queries of a running system for subsequent analysis. These scripts include:

  • collect-mysql-status Snapshot of Status, ProcessList and supporting information for 60 seconds
  • sample-mysql-queries SQL sampling (brute force approach) for approximately 20 seconds

These scripts are designed to be executed on a Linux host, and require the mysql client to be installed, and MySQL credentials to run SQL placed in the $HOME/.my.cnf file.

NOTE: The output of information of SQL statements may include PII information. It is important data is reviewed and masked.

@ronaldbradford
ronaldbradford / diff.py
Created September 18, 2024 14:29
Diff two csv files with two columns of name/value pairs
import csv
import sys
# Function to check if a value is numeric
def is_numeric(value):
try:
int(value)
return True
except ValueError:
return False
@ronaldbradford
ronaldbradford / README.md
Last active June 11, 2024 17:45
MySQL 8.0 Memory capacity 'range_optimizer_max_mem_size' exceeded.

An experiment to trigger the "Range optimization was not done for this query" Warning

Warning (Code 3170): Memory capacity of 8388608 bytes for 'range_optimizer_max_mem_size' exceeded. Range optimization was not done for this query.

This was produced with 1M rows of data.

> SELECT COUNT(*) FROM sysbench.filler2;   # Will match total number of events
@ronaldbradford
ronaldbradford / vmselect.sql
Created May 31, 2024 13:58
MySQL Selects 1m/5m/15m/60m
SELECT 'Start' AS msg, NOW();
SHOW GLOBAL STATUS LIKE 'com_select';
SELECT SLEEP(60 * 1);
SELECT '1m' AS msg, NOW();
SHOW GLOBAL STATUS LIKE 'com_select';
SELECT SLEEP(60 * 4);
SELECT '5m' AS msg, NOW();
SHOW GLOBAL STATUS LIKE 'com_select';
SELECT SLEEP(60 * 10);
SELECT '15m' AS msg, NOW();
@ronaldbradford
ronaldbradford / README.md
Last active May 22, 2024 20:48
MySQL CAST ARRAY Problem

Reported as https://bugs.mysql.com/bug.php?id=115085

  • Create Table
  • Load Table
  • Query with NULL
  • Query with an array with values
  • Query with empty array [] PROBLEM

Reproducible using 8.0.34 Docker Container

@ronaldbradford
ronaldbradford / WHISPER.md
Last active May 25, 2024 21:43
Whisper Example to extract text transcription from YouTube
# https://github.com/openai/whisper
pip install -U openai-whisper
brew install ffmpeg

# https://formulae.brew.sh/formula/youtube-dl. (Deprecated, owner shutdown but still works)
brew install youtube-dl


youtube-dl -x https://youtu.be/Nx-X4hVQGyQ