Skip to content

Instantly share code, notes, and snippets.

@emalloy
emalloy / kms_encrypt.sh
Created November 17, 2017 02:54
kms_encrypt.sh
#!/usr/bin/env bash
if [ -z ${KMS_KEY_ID} ]; then
echo "KMS_KEY_ID unset! Exiting";
exit 1
fi
_INPUT=$1
cat $_INPUT \
@emalloy
emalloy / kms_decrypt.sh
Created November 17, 2017 02:53
kms_decrypt.sh
#!/usr/bin/env bash
_INPUT=$1
cat $_INPUT \
| aws kms decrypt \
--ciphertext-blob fileb://<(cat -) \
--output text \
--query Plaintext \
@emalloy
emalloy / keybase.md
Created May 24, 2017 18:19
keybase.md

Keybase proof

I hereby claim:

  • I am emalloy on github.
  • I am emalloy (https://keybase.io/emalloy) on keybase.
  • I have a public key whose fingerprint is 0ABB 181D 72FF BAA6 42FD 46DB 789A 0B7F 1D30 669F

To claim this, I am signing this object:

@emalloy
emalloy / circle.yml
Created January 27, 2017 16:25
Need postgresql-9.6 on the circleci build container? Here goes
machine:
pre:
# custom steps for postgresql-9.6 on circleci build container
- sudo service postgresql stop
- sudo apt-get purge -y postgresql*
- sudo apt-get update
- sudo apt-get install postgresql lsof
- sudo mkdir -p /etc/postgresql/9.6/main/
- >
sudo cp -v /usr/share/postgresql/9.6/postgresql.conf.sample \
@emalloy
emalloy / get_fingerprint.sh
Created November 25, 2016 22:26
get pkcs8 fingerprint from private key
#!/usr/bin/env bash
openssl pkcs8 \
-in $1 -nocrypt -topk8 -outform DER \
|openssl sha1 -c
@emalloy
emalloy / 0_reuse_code.js
Created November 16, 2016 18:13
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@emalloy
emalloy / rmvb_to_mp4.sh
Created September 22, 2016 22:52
convert realMedia to mp4 , viewable over dlna
#!/usr/bin/env bash
# crafted specifically to handle filenames with a large number of spaces. hence the xargs 0 and i switches
find -name \*.rmvb -print0 \
| xargs -0 -i{} ffmpeg -i {} -c:v libx264 -crf 19 -strict experimental {}.mp4
@emalloy
emalloy / mbp-pubkey
Created September 13, 2016 23:36
pubkey
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCy6tz0JrXD9gIM3uN6Gs5RN8mip/OOPKUcUjilIq2uCwA7XiwXv9V77NtzRVsvmECHowNMgdmdYb23TU7fmubQj40Za3zs1f/QhCIghI7Bqxj7KYvFBnYLTgpFm4YKdt8CRVq/mxcXZceDhbn0M4vaKUsEcDyMV+UzK0Ktx24gC7ur2aQY6+rml0/K7Jg4V52tOssmuSezSAgi4FWfOUfzs/9E0ZwRqIth+KZbxVdCvvFoezNLRz2EBU6slWp9+SsvOvaCyzkDg6R/RnWEOgmd+bDh5AF2xyveUzHfQbmebYeWlwGvW5H5VT0AAoWUxP8bQdtMv6X54AbRs0+GJSGr ericmalloy@Erics-MBP
from __future__ import print_function
import boto3
route53 = boto3.client('route53')
ec2 = boto3.resource('ec2')
def lambda_handler(event, context):
instance_id = event['detail']['instance-id']
@emalloy
emalloy / JSON
Created August 3, 2016 18:04
readme-extension
MongoDB shell version: 3.2.8
connecting to: admin
{
"set" : "mongoreplicas",
"date" : ISODate("2016-08-03T17:59:24.864Z"),
"myState" : 2,
"term" : NumberLong(1),
"syncingTo" : "10.253.2.135:27017",
"heartbeatIntervalMillis" : NumberLong(2000),
"members" : [