Skip to content

Instantly share code, notes, and snippets.

View jonmabe's full-sized avatar

Jonathan Mabe jonmabe

View GitHub Profile

Keybase proof

I hereby claim:

  • I am jonmabe on github.
  • I am jonmabe (https://keybase.io/jonmabe) on keybase.
  • I have a public key whose fingerprint is 892E B322 7469 FA2C 0A50 E3B3 729C 7483 6D76 DEBA

To claim this, I am signing this object:

@jonmabe
jonmabe / count-commits.sh
Created March 17, 2017 23:44
count commits and lines of git projects that are in subfolders of current folder
#!/bin/sh
for d in */;
do
( cd $d && git rev-list --count HEAD --since 2016-01-01 --until 2017-01-01 )
done
@jonmabe
jonmabe / s3-create-24hr-url.sh
Created January 30, 2014 01:11
script to generate a 24hr url to a s3 file given a bucket and key. expects AWS access and secret key to be at $AWS_SECRET_KEY and $AWS_ACCESS_KEY
#!/bin/sh
BUCKET=$1
KEY=$2
#create 24hr user public url
S3EXPIRES=$(($(date +%s) + 24*60*60))
S3STRINGTOSIGN="GET\n\n\n$S3EXPIRES\n/$BUCKET/$KEY\c"
S3SIGNATURE=$(echo "$S3STRINGTOSIGN" | openssl dgst -binary -sha1 -hmac $AWS_SECRET_KEY | openssl base64)
S3SIGNATURE="$(perl -MURI::Escape -e 'print uri_escape($ARGV[0]);' "$S3SIGNATURE")"