Skip to content

Instantly share code, notes, and snippets.

@adamjarret
adamjarret / c9ssh.sh
Last active Apr 11, 2018
Get ssh command for connecting to AWS Cloud9 EC2 Environment (forward port 8080)
View c9ssh.sh
#!/bin/bash
WAN=$(curl -s https://api.ipify.org)
LAN=$(ip addr show eth0 | grep "inet\b" | awk '{print $2}' | cut -d/ -f1)
echo "ssh ec2-user@$WAN -L 8080:$LAN:8080"
@adamjarret
adamjarret / LogShipToCloudWatch.js
Created Oct 13, 2017
AWS Lambda for shipping logs from S3 to CloudWatch
View LogShipToCloudWatch.js
const aws = require('aws-sdk');
const s3 = new aws.S3({apiVersion: '2006-03-01'});
const cw = new aws.CloudWatchLogs({apiVersion: '2015-01-28'});
const AlreadyExists = 'ResourceAlreadyExistsException';
const months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
// Thanks https://github.com/caolan/async/blob/master/lib/waterfall.js
function cascade(tasks, callback, ignoreError)
View keybase.md

Keybase proof

I hereby claim:

  • I am adamjarret on github.
  • I am atj (https://keybase.io/atj) on keybase.
  • I have a public key ASD05HPxI3ZcvsRS52voRRB4HaIcVOzCw2yKVxRbISlQ2wo

To claim this, I am signing this object:

You can’t perform that action at this time.