Skip to content

Instantly share code, notes, and snippets.

View bashtoni's full-sized avatar

Sam Bashton bashtoni

View GitHub Profile
TZ=":Etc/UTC" aws s3 ls s3://BUCKET/
@bashtoni
bashtoni / ebs-k8s-resize.md
Created May 15, 2023 00:36
Resizing EBS volumes in a Kubernetes cluster

Resizing EBS volumes in a Kubernetes cluster

  • Edit the gp2 storage class to add allowVolumeExpansion: true
  • Edit the persistent volume claim with the new amount of required storage
  • Re-create the pod using the persistent volume claim
  • The pv and pvc should now reflect the new amount of storage
@bashtoni
bashtoni / gist:955658356e8b9278debbce356d2321d3
Created June 1, 2023 09:07
Cognito password reset from CLI
aws cognito-idp admin-create-user --user-pool-id eu-west-3_POOLID --username [email protected] --message-action RESEND
@bashtoni
bashtoni / gist:ca532e90027bce842e56f85d66d0c4fc
Created June 20, 2023 05:00
curl to an alternate host - check before changing DNS
curl -IX GET --connect-to oldhost:443:newhost:443 https://oldhost
@bashtoni
bashtoni / changed.sh
Created October 12, 2023 23:08
Show all settings in an RDS parameter group which have been changed from the default
aws rds describe-db-cluster-parameters \
--db-cluster-parameter-group-name $PARAMETER_GROUP_NAME \
--query 'Parameters[].{ParameterName:ParameterName,DataType:DataType,Source:Source,Description:Description,ParameterValue:ParameterValue} | [?Source == `user`]'
@bashtoni
bashtoni / compare-db-parameters.sh
Created November 10, 2023 00:56
Compare Aurora database cluster parameters and show differences
#!/bin/bash
# Compare parameters from two different parameter groups, which can be in different regions or accounts
PROFILE1=$1
PG1=$2
PROFILE2=$3
PG2=$4
aws --profile $PROFILE1 rds describe-db-cluster-parameters --db-cluster-parameter-group-name $PG1 --query 'Parameters[].{ParameterName:ParameterName,ParameterValue:ParameterValue}' --output text | sort >> $$-pg1.txt