Skip to content

Instantly share code, notes, and snippets.

View battand's full-sized avatar

Drew Battaglia battand

View GitHub Profile
const _ = require('lodash');
const AWS = require('aws-sdk');
const csv = require('csv');
const fs = require('fs')
var parse = require('csv-parse')
const dynamoClient = new AWS.DynamoDB();
exports.CreateProductNotification = async (ProductId, Emails) => {
let result = await dynamoClient

Keybase proof

I hereby claim:

  • I am battand on github.
  • I am battand (https://keybase.io/battand) on keybase.
  • I have a public key ASAlsefjB_sZnIXQEAbWyPEvtTbPg_zk-1Nv4Tw7EWpU6Ao

To claim this, I am signing this object:

@battand
battand / process_s3_logs.py
Last active April 17, 2017 20:46
Ever wanted to parse all those ELB logs to find out which requests were taking a long time? This is for you. Set your AWS creds in your environment, and set S3_BUCKET, and S3_PREFIX! Please don't judge the code quality, I timeboxed this to an hour.
#!/usr/bin/env python
import boto3
from csv import DictReader
from io import StringIO
from pprint import pprint
import json
from os import environ
s3 = boto3.resource('s3')

The following instructions assume that the Curiosity and CuriosityFrontend projects are checked out in the /curiosity directory on the VM. These instructions also assume that there is a virtualenv for each project.

  1. Create new directory '/curiosity', clone Curiosity and CursiosityFrontned repos into this directory.

  2. Copy the files in this Gist to the following locations on the VM:

  • vhost.conf -> /etc/nginx/sites-enabled/curiosity.conf
  • environment.conf -> /etc/nginx/environment/curiosity.conf
  • cacert.pem -> /etc/nginx/cacert.pem
  • private.key -> /etc/nginx/private.key