Skip to content

Instantly share code, notes, and snippets.

@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
@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 }}')
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

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:

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:
@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')
@bzcorn
bzcorn / .bash_profile
Last active May 13, 2017 05:13 — forked from natelandau/.bash_profile
Mac OSX Bash Profile
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management
@bzcorn
bzcorn / mac runner
Created May 13, 2017 05:23
Scripts to get up and running on a new mac
brew install wget
brew install cask
export HOMEBREW_CASK_OPTS="--appdir=/Applications"
brew cask install \
google-chrome \
sublime-text \
dropbox \
firefox \
spotify \
"use strict";
const OktaJwtVerifier = require("@okta/jwt-verifier");
console.log("Loading function");
const issuer = "https://dev-XXXXX.oktapreview.com/oauth2/default";
const cid = "";
exports.handler = (event, context, callback) => {
const verifier = new OktaJwtVerifier({
@bzcorn
bzcorn / mingle_to_trello.py
Last active June 5, 2019 04:05
This takes exported mingle card data and pushes it to trello
'''
MIT License
Copyright (c) 2019 Ben Cornelius
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is