Skip to content

Instantly share code, notes, and snippets.

View josh-authy's full-sized avatar

Josh Authy josh-authy

View GitHub Profile
@josh-authy
josh-authy / verifyhmac.js
Last active February 23, 2017 19:32
Function to verify the HMAC sig w/ Node
var qs = require('qs');
var crypto = require('crypto');
/**
* Verify HMAC
* @param proto
* @param hostname
* @param url
* @param method
* @param params
@josh-authy
josh-authy / hmac-verification.js
Last active August 13, 2017 14:45
HMAC Verification with Node.js
var qs = require('qs');
var crypto = require('crypto');
/**
* @param {http request} req
* @param {!string} apiKey
* @return {Boolean} True if verified
*/
function verifyCallback(req, apiKey) {
@josh-authy
josh-authy / ec2.sh
Created June 14, 2016 19:45
Get EC2 Information
sudo apt-get install cloud-utils
And then you can:
EC2_INSTANCE_ID=$(ec2metadata --instance-id)
You can get most of the metadata associated with the instance this way:
ec2metadata --help
Syntax: /usr/bin/ec2metadata [options]
Query and display EC2 metadata.