Skip to content

Instantly share code, notes, and snippets.

@bzcorn
bzcorn / lambda-to-sumo-example.py
Created January 4, 2017 20:19
Forward VPC Flow Logs to Sumologic
from botocore.vendored import requests
from base64 import b64decode
from json import loads, dumps
from zlib import compress, decompress, MAX_WBITS
ENDPOINT = ""
def lambda_handler(event, context):
data = event.get('awslogs', {}).get('data')
def hotel_cost(nights):
return 140 * nights
def plane_ride_cost(city):
if city == "Charlotte":
return 183
def rental_car_cost(days):
car = 40 * days
if days >= 7:

Keybase proof

I hereby claim:

  • I am bzcorn on github.
  • I am bzcorn (https://keybase.io/bzcorn) on keybase.
  • I have a public key whose fingerprint is 2A23 2AC7 AA08 469B E1F8 D78B 768E 4F4F F926 9E2D

To claim this, I am signing this object:

aws iam upload-server-certificate \
--server-certificate-name subdomain.domain.tld \
--certificate-body file://subdomain.domain.tld.crt \
--private-key file://subdomain.domain.tld.key \
--certificate-chain file://ca.crt \
--path /subdomain.domain.tld/ \
aws iam delete-server-certificate \
--server-certificate-name subdomain.domain.tld
@bzcorn
bzcorn / gist:ea4ae9a60d0f70c92e4a
Created January 19, 2015 18:54
pysphere get IP ansible
#!/usr/bin/python
import pysphere
vCenterServer = pysphere.VIServer()
vCenterServer.connect('{{ vcenter_hostname }}', '{{ vcenter_username }}', '{{ vcenter_password }}')
vm1 = vCenterServer.get_vm_by_name('{{ vm_guest_name }}')
@bzcorn
bzcorn / gist:8ea27dfda85be0ea4a41
Created January 19, 2015 18:51
vsphere-create
---
- name: Install prereqs
command:
yum install -y libselinux-python python-pip
- name: Install python modules
pip:
name={{ item }}
state=present