Skip to content

Instantly share code, notes, and snippets.

@NeilMasters
NeilMasters / rain-poop-emojis.js
Created September 9, 2026 08:46
A small snippet of javascript you can paste into your console that rains poop emojis down the screen.
(() => {
const COUNT = 60;
const layer = document.createElement('div');
layer.style.cssText =
'position:fixed;inset:0;pointer-events:none;overflow:hidden;z-index:2147483647';
document.body.appendChild(layer);
const style = document.createElement('style');
style.textContent = `
@keyframes poop-fall {
@NeilMasters
NeilMasters / diff-secrets.sh
Created August 14, 2026 13:31
Create the differences between old and current version of aws secrets.
#!/usr/bin/env bash
set -euo pipefail
###############################################################################
#
# A simple shell script that will compare an aws secret' current and previous
# version and then print a) what has been added, b) what has been removed and
# c) what has changed.
#
# Notes:
@NeilMasters
NeilMasters / codedeploy-history.sh
Created August 5, 2026 09:52
A simple script that will pull codedeployment history to help isolate if failures are clustered around specific instances.
#!/usr/bin/env bash
# Dump full CodeDeploy deployment + target history for an application (every target on every
# deployment, not just failures), to figure out whether failures cluster on specific instances
# or are randomly distributed.
#
# Usage: ./codedeploy-history.sh <application-name> [deployment-group-name] [max-deployments]
# Example: ./codedeploy-history.sh example_name "" 200
#
# Output will include each codedeploy and the reason it failed (based on first failure from the
# instances), for each instance percentage of failure(if your doing in place) along with first
@NeilMasters
NeilMasters / check-for-zero-time-values.php
Created June 4, 2025 08:21
Locate all datetime fields that should be date fields.
<?php
/**
* This fairly basic script will connect to a MySQL database and check all timestamp fields
* for zero time values. It will log the results to the console.
*
* The purpose of this is to highlight fields that should be a DATE field instead of a
* DATETIME field.
*
* usage:
@NeilMasters
NeilMasters / purge-sqs-queues-by-prefix.sh
Created May 28, 2025 11:34
Purge SQS queues that match a provided prefix
#!/bin/bash
PREFIX=$1
DRY_RUN=$2
REGION=$3
echo "Starting the purge of queues that have the prefix of ${PREFIX}"
# Get the list of queues with the $ PREFIX and store as a block of json
QUEUES=$(aws sqs list-queues --region "${REGION}" --queue-name-prefix=${PREFIX} | jq '.QueueUrls')
echo $QUEUES > /tmp/queues.json
@NeilMasters
NeilMasters / monitor-for-person.sh
Created October 22, 2024 17:11
Play a sound file when a user posts a message into a specific slack channel
#!/bin/bash
###########################################################################
#
# Very very rough script! Does not work well!
#
# Will monitor a slack channel (has to be public unless you give it special
# permissions) for a specific user and if there is a message in the last 30
# seconds will play a sound file of your choosing. Obviously not great
# for conversational channels.
#
@NeilMasters
NeilMasters / sprint-time-support.php
Created September 26, 2024 12:28
Generic Jira issues script for pulling a JQL list of issues based on type and sprint
<?php
include('vendor/autoload.php');
$sprint = $argv[1];
$email = '';
$token = '';
$domain = '';
$project = '';
$type = '';
@NeilMasters
NeilMasters / db-sizes.sh
Created August 7, 2024 16:41
Generate size data for all databases in a mysql server
#!/bin/bash
# A simple bash script which will generate 2 csv files; database sizes and
# table sizes for all databases.
#
# This does use performance_schema so ya know... take it with a pinch of salt.
CLUSTER_HOST=$1
CLUSTER_PORT=3306
CLUSTER_REF=$2
@NeilMasters
NeilMasters / phpmd-pretty
Created July 26, 2024 10:03
PHPMD Pretty
#!/usr/bin/env php
<?php
/**
* A very simple and basic utility that can be used to pipe phpmd errors and format
* in a cleaner way. This suits MY requirements and you will probably want line numbers
* etc so edit as you see fit.
*
* Example use:
* vendor/bin/phpmd ./src xml ./ruleset.xml | bin/phpmd-pretty
@NeilMasters
NeilMasters / clean-aws-sqs-queues.sh
Created May 30, 2024 09:29
Delete sqs queues using a prefix.
#!/bin/bash
PREFIX=$1
DRY_RUN=$2
echo "Starting the purge of queues that have the prefix of ${PREFIX}"
while true
do
# Get the list of queues with the PREFIX and store as a block of json
QUEUES=$(aws-vault exec $AWS_PROFILE -- aws sqs list-queues --queue-name-prefix=${PREFIX} | jq '.QueueUrls')