Skip to content

Instantly share code, notes, and snippets.

@ssummer3
ssummer3 / codebuild.py
Last active June 28, 2018 02:36
Local CodeBuild
#! /usr/bin/env python
""" local codebuild implementation
Parses buildspec.yml files, and executes them locally, as per:
http://docs.aws.amazon.com/codebuild/latest/userguide/build-spec-ref.html#build-spec-ref-example
"""
from __future__ import print_function
import functools
import glob
import os
@ssummer3
ssummer3 / convert.json
Last active March 29, 2018 17:39
Contentful Stuffs
{
"universityarchives": "5561",
"reservesmicrotextandmediadesk": "5557",
"medievalinstitutelibrary": "5558",
"circulationservicedesk": "1483",
"engineeringlibrary": "5566",
"architecturelibrary": "5563",
"kelloggkroclibrary": "5567",
"mahaffeybusinesslibrary": "5564",
"chemistryphysicslibrary": "5565",
@ssummer3
ssummer3 / aws_tags_parameters.yml
Last active October 10, 2017 12:59
Ansible Scratchpad
---
- name: create AWS Style Tags and Parameters (from default_tags + stack_tags and default_parameters + stack_parameters)
set_fact:
Tags: |
[{% for key, value in (default_tags | default({}) | combine(stack_tags | default({}))).iteritems() %}{
'Key': '{{ key }}', 'Value': '{{ value }}'
},{% endfor %}]
Parameters: |
[{% for key, value in (default_parameters | default({}) | combine(stack_parameters | default({}))).iteritems() %}{
'ParameterKey': '{{ key }}', 'ParameterValue': '{{ value }}'
@ssummer3
ssummer3 / codebuild.yml
Created July 25, 2017 03:35
CodeBuild for Github Projects
AWSTemplateFormatVersion: '2010-09-09'
Description: '{{ application_stage }} CodeBuild'
Metadata:
AWS::CloudFormation::Interface:
ParameterLabels:
@ssummer3
ssummer3 / create_and_attach_volume.yaml
Last active March 19, 2020 00:45
AWS: Create and Attach a Volume to an EC2 Instance
AWSTemplateFormatVersion: '2010-09-09'
Description: Create a Volume from scratch and attach it to an instance.
Metadata:
AWS::CloudFormation::Interface:
@ssummer3
ssummer3 / JythonJsonToJsonExample.xml
Last active February 6, 2017 04:38 — forked from mattyb149/JythonJsonToJsonExample.xml
An Apache NiFi template that uses ExecuteScript (with Jython) to perform JSON-to-JSON conversion
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><template><description></description><name>JythonJsonToJsonExample</name><snippet><connections><id>02d12142-26da-459b-938c-427d4f2e44cc</id><parentGroupId>68f8be3e-335a-457d-b83f-96ddaae929e6</parentGroupId><backPressureDataSizeThreshold>0 MB</backPressureDataSizeThreshold><backPressureObjectThreshold>0</backPressureObjectThreshold><destination><groupId>68f8be3e-335a-457d-b83f-96ddaae929e6</groupId><id>60403007-026d-40fe-ba2e-d3f48b6d235f</id><type>PROCESSOR</type></destination><flowFileExpiration>0 sec</flowFileExpiration><labelIndex>1</labelIndex><name></name><selectedRelationships>success</selectedRelationships><source><groupId>68f8be3e-335a-457d-b83f-96ddaae929e6</groupId><id>45c28ea4-b46f-46d3-93f2-3dac1ffadcff</id><type>PROCESSOR</type></source><zIndex>0</zIndex></connections><connections><id>3aa46389-b79d-42b4-93f3-d494ce7338da</id><parentGroupId>68f8be3e-335a-457d-b83f-96ddaae929e6</parentGroupId><backPressureDataSizeThreshold>0 MB</backPressureDa
@ssummer3
ssummer3 / read-flowfile-contents.py
Last active February 1, 2017 13:14 — forked from ijokarumawak/read-flowfile-contents.py
Example Python script to use from NiFi ExecuteScript processor which reads the first line from an incoming flow file.
from org.python.core.util.FileUtil import wrap
from org.apache.nifi.processors.script import ExecuteScript
first_line = None
flow_file = session.get()
def read_first_line(input):
@ssummer3
ssummer3 / ec2.yml
Last active March 29, 2018 17:40
AWS LIBND
AWSTemplateFormatVersion: '2010-09-09'
Description: Template to create libnd EC2
Conditions:
HasNetworkInterfaceId: !Not [!Equals [!Ref NetworkInterfaceId, '']]
HasPrivateIpAddress: !Not [!Equals [!Ref PrivateIpAddress, '']]
Parameters:
AMI:
ConstraintDescription: must be an AMI available in the EC2 instance's region
Default: ami-6869aa05
Description: Base AMI
@ssummer3
ssummer3 / Dockerfile
Last active November 2, 2016 21:01
Docker Stack: Zucchetto/Vatican
FROM node:5.5.0
ARG app
RUN useradd --user-group --create-home --shell /bin/false app
ENV HOME=/home/app
WORKDIR ${HOME}
RUN git clone --depth 1 https://github.com/ndlib/${app}
RUN chown -R app:app ${HOME}/*
USER app
WORKDIR ${HOME}/${app}
RUN npm install && npm cache clean
@ssummer3
ssummer3 / keybase.md
Created April 22, 2016 20:15
ssummer3 Keybase proof

Keybase proof

I hereby claim:

  • I am ssummer3 on github.
  • I am ssummer3 (https://keybase.io/ssummer3) on keybase.
  • I have a public key whose fingerprint is 81BC 674A 5250 83F9 7082 AA8F BF61 1CD4 8935 2BE5

To claim this, I am signing this object: