Skip to content

Instantly share code, notes, and snippets.

View cbsmith's full-sized avatar

Christopher Smith cbsmith

View GitHub Profile
{
"detail_output": {
"content.article-lease": {
"lease_type": 2,
"node_identifier": {
"node_name": "content.article-lease"
},
"timestamp": 1422677331539
},
"content.article.shingles-lease": {
@cbsmith
cbsmith / gevent.monkey_patch_all.py
Created February 18, 2015 22:21
monkey patch all
def patch_all(socket=True, dns=True, time=True, select=True, thread=True, os=True, ssl=True, httplib=False,
subprocess=False, sys=False, aggressive=True, Event=False):
"""Do all of the default monkey patching (calls every other function in this module."""
# order is important
if os:
patch_os()
if time:
patch_time()
if thread:
patch_thread(Event=Event)
@cbsmith
cbsmith / gist:1493e6686c8d1be74310
Created March 6, 2015 16:41
Clinton Article from AP Feed
<ns0:entry xmlns:ns0="http://www.w3.org/2005/Atom" xmlns:ns1="http://ap.org/schemas/03/2005/apcm" xmlns:ns2="http://ap.org/schemas/03/2005/apnm">
<ns0:id>urn:publicid:ap.org:f655319a9d09472495e3d7cc400da16a</ns0:id>
<ns0:title>US-DEM-2016-Clinton</ns0:title>
<ns0:updated>2015-03-05T22:05:43.580Z</ns0:updated>
<ns0:published>2015-03-05T22:05:36Z</ns0:published>
<ns0:author>
<ns0:name>AP</ns0:name>
</ns0:author>
<ns0:rights>Copyright 2015 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.</ns0:rights>
<ns0:content type="text/xml">
@cbsmith
cbsmith / cloud-config.yml
Last active September 26, 2016 06:25 — forked from skippy/cloud-config.yml
modifying fleet metadata (from aws meta-data service) before fleet.service start; this is a proof of concept (but it works!)
#cloud-config
---
coreos:
units:
- name: update-fleet-metadata.service
command: start
content: |-
[Unit]
Description=Update Fleet metadata tag
Before=fleet.service
@cbsmith
cbsmith / awscli_functions.sh
Created December 15, 2015 05:13
A handy collection of bash functions to make the aws cli a bit more usable
# Usage: . awscli_functions.sh
# Suggested: add to ~/.bashrc
# This code lazily uses your default profile && region.
# It wouldn't take much to add some logic for using ${PROFILE} and/or ${REGION} as some kind of override.
# Lots more functions would be helpful, but I've been playing with ec2 & vpcs a lot lately, so...
clusters()
{
local __resultvar=$1
local __clusters=$(aws ecs list-clusters | jq -r '.clusterArns[]')
@cbsmith
cbsmith / keybase.md
Created December 27, 2015 22:19
Proving who I am to the world...

Keybase proof

I hereby claim:

  • I am cbsmith on github.
  • I am cbsmith (https://keybase.io/cbsmith) on keybase.
  • I have a public key ASAP-aANv7TdH9M92MiL7AmjcQmFCR4m9bNymFF-1y6LIgo

To claim this, I am signing this object:

@cbsmith
cbsmith / message.proto
Last active January 16, 2016 05:43
Proposed change to Heka message format.
package message;
import "gogo.proto";
option (gogoproto.sizer_all) = true;
option (gogoproto.marshaler_all) = true;
option (gogoproto.unmarshaler_all) = true;
option java_package = "org.mozilla.heka";
option java_outer_classname = "HekaMessage";
@cbsmith
cbsmith / compatible_message.proto
Last active January 16, 2016 05:44
A forward compatible reworking of Heka Message
package message;
import "gogo.proto";
option (gogoproto.sizer_all) = true;
option (gogoproto.marshaler_all) = true;
option (gogoproto.unmarshaler_all) = true;
option java_package = "org.mozilla.heka";
option java_outer_classname = "HekaMessage";
"""Shadow run attack simulator.
Usage:
shadow_combat.py [--debug] [--limit LIMIT | -6 | --rule_of_six] [--threshold THRESHOLD | --opposed_pool OPPOSED [--opposed_limit OPPOSED_LIMIT]] [--dv DV --stun [--soak SOAK] [--armor ARMOR [--ap AP]]] [--contact] [--once | -o | [--iterations ITERATIONS] [-D | --distribution]] [--multi ATTACKS] [--min DAMAGE] ATTACK_POOL
shadow_combat.py [--debug] [--contact] [-6 | --rule_of_six] --threshold THRESHOLD ATTACK_STRING DAMAGE_STRING SOAK_STRING
shadow_combat.py [--debug] [--contact] [-D | --distribution] [-6 | --rule_of_six] --threshold THRESHOLD ATTACK_STRING DAMAGE_STRING SOAK_STRING ITERATIONS
shadow_combat.py [--debug] [--contact] [-6 | --rule_of_six] ATTACK_STRING DAMAGE_STRING DEFENSE_STRING SOAK_STRING
shadow_combat.py [--debug] [--contact] [-D | --distribution] [-6 | --rule_of_six] ATTACK_STRING DAMAGE_STRING DEFENSE_STRING SOAK_STRING ITERATIONS
shadow_combat.py (-h | --help)
shadow_combat.py (-v | --version)
@cbsmith
cbsmith / example.com.html
Created November 23, 2016 04:54
This is what example.com looks like from Southwest.
<!doctype html>
<html>
<head><link href="http://getconnected.southwestwifi.com/unb/unb.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="http://getconnected.southwestwifi.com/unb/jqr44-1.8.3.js"></script>
<script type="text/javascript">var r44_btime=new Date();var r44_smu_time=1479876620.446</script>
<script type="text/javascript" src="http://getconnected.southwestwifi.com/unb/unb.js"></script>
<title>Example Domain</title>