Skip to content

Instantly share code, notes, and snippets.

Avatar

Mike Putnam mikeputnam

View GitHub Profile
@fuxingloh
fuxingloh / app.js
Last active May 10, 2020
How to use express.js and passport.js with G Suite SAML Apps SSO
View app.js
const express = require('express')
const SamlStrategy = require('passport-saml').Strategy
const passport = require('passport')
const cookieSession = require('cookie-session')
const cookieParser = require('cookie-parser')
// Create express instance
const app = express()
@halberom
halberom / extras.py
Last active Sep 14, 2017
ansible - example of merging lists of dicts
View extras.py
# ansible_plugins/filter_plugins/extras.py
def merge_dicts(value, dict1):
# return a merged dict
result = {}
result = value
result.update(dict1)
return result
def merge_lists_of_dicts(list1, list2):
# return a merged list
View blue-green.md

Production Blue-Green Deployment Pattern

came up during IRIS call with Zac, Joel, Julian & Robb - This is Robb's write-up on the matter.

  1. Blue-Green deployment: two Production ASGs & ELBs
  • only one is live at any time (Route53 Alias)
  • standby ASG can be deployed-to (rollforward or rollback), warmed-up (scaling, caching ,etc), and verified (smoke tests, etc. aginst standby.us-east-1.iris.tv) BEFORE being made live
  • Route53 API [ChangeResourceRecordSets] are transactional
  • Post-swap, the newly standby ASG can be updated to 0 desired instances (min and max = 0 too).
  • DNS changing is how AWS Elastic Beanstalk works too (SWAP CNAME API call).
@woloski
woloski / auth0.py
Last active Jun 14, 2017
this shows a very simple bare bones example of authenticating with Auth0 using standard python libraries
View auth0.py
import webapp2
import urllib2
import urllib
import json
## CHANGE THIS
CLIENT_ID = "vYPeq7LGf1utg2dbDlGKCwGKgy94lPH0"
CLIENT_SECRET = "DLQ5dWkNMwPlUWo2jqVkbG1PFyeMvV60HEJaW0FioeI4ZxGaAW73BiqRBZmRk29v"
DOMAIN = "contoso.auth0.com"
CALLBACK_URL = "http://localhost:8080/callback"
@afresh1
afresh1 / find_networks.sh
Last active Jul 16, 2018
A script to find and connect to known wifi networks on OpenBSD. Works for me on my iwn card in my laptop
View find_networks.sh
#!/bin/sh
# find_network.sh - An OpenBSD Wireless Network configurator
# Looks for available networks listed at the end of the script
# Use this by adding "!/path/to/find_network.sh \$if" to your wlan hostname.if
if=$1
if [ -z "$if" ]; then
echo "Usage: $0 interface" >&2
exit 2;
fi
@mnot
mnot / RSS.py
Created Oct 29, 2009
RSS.py: work with RSS channels as data structures
View RSS.py
#!/usr/bin/env python
"""
RSS.py
Classes for working with RSS channels as arbitrary data structures.
Requires Python 2.2 or newer and PyXML 0.7.1 or newer.
ChannelBase - Base class for RSS Channels.
CollectionChannel - RSS Channel modeled as a URI-per-entry
@endolith
endolith / Has weird right-to-left characters.txt
Last active Dec 30, 2020
Unicode kaomoji smileys emoticons emoji
View Has weird right-to-left characters.txt
ּ_בּ
בּ_בּ
טּ_טּ
כּ‗כּ
לּ_לּ
מּ_מּ
סּ_סּ
תּ_תּ
٩(×̯×)۶
٩(̾●̮̮̃̾•̃̾)۶
You can’t perform that action at this time.