Skip to content

Instantly share code, notes, and snippets.

View johnestima's full-sized avatar

John johnestima

View GitHub Profile
@johnestima
johnestima / Makefile
Created September 15, 2021 00:42 — forked from ryu1kn/Makefile
Encrypt/decrypt with AWS KMS using AWS cli
# How to encrypt/decrypt your text/blob secret with AWS KMS with AWS cli
KEY_ID=alias/my-key
SECRET_BLOB_PATH=fileb://my-secret-blob
SECRET_TEXT="my secret text"
ENCRYPTED_SECRET_AS_BLOB=encrypted_secret_blob
DECRYPTED_SECRET_AS_BLOB=decrypted_secret_blob # Result of decrypt-blob target
encrypt-text:
@johnestima
johnestima / cognito-delete-all-users.sh
Created August 21, 2020 17:21
Cognito delete all users from user pool
#!/bin/bash
USER_POOL_ID=POOL_ID
RUN=1
until [ $RUN -eq 0 ] ; do
echo "Listing users"
USERS=`aws cognito-idp list-users --user-pool-id ${USER_POOL_ID} | grep Username | awk -F: '{print $2}' | sed -e 's/\"//g' | sed -e 's/,//g'`
if [ ! "x$USERS" = "x" ] ; then
for user in $USERS; do
@johnestima
johnestima / gcode.easel
Created December 20, 2014 04:42
Getting gcode from Easel
- on console create global var GCODE='';
- update function EASEL.gcodeForDesign = function (callback) {
...
finish = function() {
GCODE = gcodes;
if (callback != null) {
return callback(gcodes);
}
};
...