Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@ryu1kn
ryu1kn / Makefile
Last active March 19, 2023 13:02
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:
@nstielau
nstielau / send_metric_to_statsd.sh
Created May 11, 2011 16:41
Send a metric to StatsD from bash
# Send a metric to statsd from bash
#
# Useful for:
# deploy scripts (http://codeascraft.etsy.com/2010/12/08/track-every-release/)
# init scripts
# sending metrics via crontab one-liners
# sprinkling in existing bash scripts.
#
# netcat options:
# -w timeout If a connection and stdin are idle for more than timeout seconds, then the connection is silently closed.