This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"context" | |
"errors" | |
"fmt" | |
"code.cloudfoundry.org/lager" | |
"github.com/cloudfoundry-community/go-cfclient" | |
"github.com/pivotal-cf/brokerapi" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; Goal: Page if the firehose stops sending to riemann, and close pages if it resumes | |
;; Replace all firehose events with synthetic heartbeat events and index, then merge with existing stream and listen for expiration | |
;; h/t @sharms | |
(where (service #"^cf.*") | |
(smap (fn [ev] (if (= (:state ev) nil) (event {:service "cf.nozzle.heartbeat" :host "internal" :metric 1 :state "ok" :ttl 30}) ev)) index | |
(where (service "cf.nozzle.heartbeat") | |
(changed-state {:init "ok"} | |
(where (state "ok") (:resolve pd) | |
(else (where (state "expired") (:trigger pd)))))))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
meta: | |
name: (( param "specify name" )) | |
aws: | |
bucket: (( param "specify bucket name" )) | |
access_key_id: (( param "specify access key" )) | |
secret_access_key: (( param "specify secret key" )) | |
region: (( param "specify region" )) | |
tasks: | |
url: (( param "specify tasks url" )) | |
branch: (( param "specify tasks branch" )) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import re | |
import time | |
import uuid | |
import base64 | |
import httplib2 | |
from apiclient import discovery | |
import oauth2client | |
from oauth2client import client |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import faker | |
import locust | |
import pyquery | |
fake = faker.Faker() | |
username, password = os.getenv('AUTH_USER'), os.getenv('AUTH_PASS') | |
auth = (username, password) if username and password else () |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# encoding: utf-8 | |
import re | |
import sys | |
import yaml | |
parameter = re.compile(r'{{(.+)}}') | |
def extract(templated, complete): | |
if isinstance(templated, list): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/expect | |
set timeout 30 | |
set target [lindex $argv 0]; | |
set environment [lindex $argv 1]; | |
spawn ./trigger.sh $target $environment | |
expect "choose a container" | |
set lines [split $expect_out(buffer) \n] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e -x | |
TODAY=$(date +%Y.%m.%d) | |
YESTERDAY=$(date -d "1 day ago" +%Y.%m.%d) | |
TTL=${TTL:-600} | |
JQ_PATH=${JQ_PATH:-jq} | |
INTERVAL=${INTERVAL:-5m} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* global console */ | |
var urijs = require('urijs'); | |
var Promise = require('bluebird'); | |
var request = Promise.promisifyAll(require('request')); | |
var mongodb = Promise.promisifyAll(require('mongodb')); | |
var baseUrl = 'https://api.travis-ci.org'; | |
var client = mongodb.MongoClient.connect('mongodb://localhost:27017/dashboard'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Scrapy includes an `ItemLoader` class and associated helpers to abstract | |
data extraction from `Reponse` objects. But this API is verbose and easily | |
result in more boilerplate, not less. The following is a quick sketch of | |
a possible interface for using marshmallow, with a few custom fields, to | |
pull data from Scrapy responses. | |
""" | |
class PersonSchema(Schema): | |
name = fields.XPath('//title/text()', fields.Str) |