Skip to content

Instantly share code, notes, and snippets.

View pwmcintyre's full-sized avatar
🥑
golang fever

Peter McIntyre pwmcintyre

🥑
golang fever
View GitHub Profile
/*
Deletes all SSM Parameters with the given prefix.
Example usage:
$ npm i @aws-sdk/client-ssm
$ AWS_PROFILE=nbos-ris-np-admin AWS_REGION=us-west-2 SSM_PATH_PREFIX=/ris/dev/1/wombatch/ npx ts-node .
*/
import { SSMClient, DeleteParametersCommand, GetParametersByPathCommand } from "@aws-sdk/client-ssm"
const Path = process.env["SSM_PATH_PREFIX"]
@pwmcintyre
pwmcintyre / marp.versent.css
Last active August 3, 2022 09:13
Versent theme for Marp
/* @theme versent */
@import 'default';
:root {
color: #FFFFFF;
background: #11333F;
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAfcAAAB2CAMAAADiMCrcAAAAqFBMVEUAAAD///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////8j1z1tAAAAN3RSTlMAR5/4uCgD/PXpFdAkbKzGj3pTLpzxaQkG4w3s2BEYG01fiXTeH8qywZiEQjbUp1hkfzM6vJM+mREr6wAADLhJREFUeNrs3OmSmkAUBeALqIC4IyIoI+K+7573f7MoJo4CipKRkKK/f6NTlFXHvngalP6tbJOY9NnNiUmf+TRHTOoUxgViUievNIhJHX08ZlM+fZpLQSUmdQ7YEJM6UygmMWnTg8gRkzZdETwxaVMTYHSISRlOA9bEpMyxBWRYdU+brQxorLqnjWoAmBKTLtk+gAWr7imTbQOsuqdO4Rw7q+5pU1gAYNU9bdzYWXVPm+wl9j2r7qmi9nEmbYlJkbkBgFX3xGhSLGYyAFbdk2PVjSN5W4NLtIlJBLM97Or0YV0JAKvuiWIDSjFPn9QTcSEPiEmKEQDDydKnNCv4g90wnyCqhBOpVDPpE6wS/hizb0EmSQUXbWebo5+WHeKEVfcE+jLwm1juZelH2QauHGISpYFvUrm6bdJP6Qk4YdU9mZpD3BKVg/1FUZnH68jIL3HGqntSzUR4tPYbLkL2nVo9c90O2C1wY0lM4iwRQB5XVqpFL8oN7Olew7Lw5++
@pwmcintyre
pwmcintyre / list-lifecycle.sh
Created September 23, 2022 02:43
list all buckets and their lifecycle rules
#! /usr/bin/env bash
# to make this blubage easier to read ...
WHITE="97"
BOLDWHITE="\e[1;${WHITE}m"
ENDCOLOR="\e[0m"
# list buckets and loop
aws s3api list-buckets --query 'Buckets[].[Name]' --output text | while read bucket ; do
echo "${BOLDWHITE}${bucket}${ENDCOLOR}"
#!/usr/bin/env node
/*
This will migrate all tables of a database to a new S3 Bucket
Steps:
- lists all tables of a database, performs the following for each:
- list all objects at the table's storage location (S3 path)
- copies all objects found to new bucket
- updates table config with new S3 path
#!/usr/bin/env node
/*
This will disable all EventBridge rules for a given prefix
Steps:
- lists all rules for a given prefix
- for all rules found, disables it
example:
@pwmcintyre
pwmcintyre / .zshrc
Created July 28, 2023 00:43
.zshrc
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH="/home/peter/.oh-my-zsh"
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME