Skip to content

Instantly share code, notes, and snippets.

View jfryman's full-sized avatar

James Fryman jfryman

View GitHub Profile
@jfryman
jfryman / mongo
Last active August 29, 2015 14:11
---
name: 'st2.webhook.cicd.github.events'
description: 'Webhook listening for pushes to our CI/CD (SeatShare) repository'
trigger:
type: core.st2.webhook
parameters:
url: cicd/github/events
criteria:
trigger.body.hook.events:
pattern: push
@jfryman
jfryman / CLI
Created December 29, 2014 18:57
root@st2server:/opt/stackstorm/packs/cicd/actions/workflows# mistral workbook-create test.yaml
Starting new HTTP connection (1): localhost
+------------+----------------------------+
| Field | Value |
+------------+----------------------------+
| Name | test |
| Tags | <none> |
| Created at | 2014-12-29 18:54:52.956522 |
| Updated at | None |
+------------+----------------------------+
class LibratoBaseAction(Action):
def __init__(self, config):
super(LibratoBaseAction, self).__init__(config)
self.librato = self._get_client()
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jfryman
jfryman / ac-graph.rb
Last active August 29, 2015 14:12
Graph Generators for ActionChain/Mistral
#!/usr/bin/env ruby
# damn ugly spike to generate dot files from an actionchain workflow
require 'yaml'
require 'erb'
module ActionChain
class Graph
include ERB::Util
attr_reader :title, :workflow
---
chain:
-
name: get_canary_version
ref: consul.get
params:
key: "{{project}}::canary_version"
on-success: query_if_production_deploy
-
name: query_if_production_deploy
@jfryman
jfryman / btt-voicecode.io.settings
Created February 16, 2015 18:03
Better Touch Tool - voicecode.io Settings
436f 7265 4461 7461 0000 0001 0804 0800
0000 0000 0000 0fb2 0000 0000 0000 04bb
0000 0000 0000 0040 0000 0000 0000 0f72
0000 0000 0000 000d 0000 0000 0000 0000
6270 6c69 7374 3030 d400 0100 0200 0300
0400 0500 0602 2202 2358 2476 6572 7369
6f6e 5824 6f62 6a65 6374 7359 2461 7263
6869 7665 7254 2474 6f70 1200 0186 a0af
106c 0007 0008 0027 0028 0029 002a 002b
002c 002d 002e 002f 0030 0031 0032 0033
---
name: autoscale.asg.create
version: "2.0"
workflows:
main:
description: "Main workflow to provision a VM"
type: direct
input:
- name
root = !pwd
s = status -su
lol = log --graph --decorate --pretty=oneline --abbrev-commit
lola = log --graph --decorate --pretty=oneline --abbrev-commit --all
ls = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate
ll = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --numstat
lnc = log --pretty=format:"%h\\ %s\\ [%cn]"
ld = log --pretty=format:"%C(yellow)%h\\ %ad%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --date=relative
lds = log --pretty=format:"%C(yellow)%h\\ %ad%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --date=short
filelog = log -u
import time
import eventlet
import ast
from st2reactor.sensor.base import PollingSensor
__all_ = [
'AutoscaleGovernorSensor'
]
eventlet.monkey_patch(