This example is intended to reproduce the CCG COMPASS dashboard using the new roll-you-own dashboard tool
This file contains hidden or 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/zsh | |
# This zshell script check that homebrew and Xcode Command Line Tools are installed. | |
# If they are, and they still contain the insecure version of Python 3.9 that Apple | |
# bundles into the CL Tools, this script installs an up-to-date version of Python 3.9 | |
# using homebrew, repoints the symlink to the homebrew installation and removes the | |
# insecure version. | |
set -e |
This file contains hidden or 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
require 'json' | |
hash = { 'a' => 1, 'b' => 2 } | |
state = JSON::State.new(indent: ' ', | |
space: ' ', | |
space_before: '', | |
object_nl: "\n", | |
array_nl: "\n") | |
hash.to_json # => "{\"a\":1,\"b\":2}" |
This file contains hidden or 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
# Parses Graphviz .dot files | |
class DotFileParser | |
EDGE_PATTERN = /"([^"]*)" -> "([^"]*)"/ | |
NODE_PATTERN = /\A\t"([^"]*)" \[/ | |
def initialize(filename) | |
@filename = filename | |
end | |
def each_edge |
This file contains hidden or 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
require 'json' | |
require 'csv' | |
hash = JSON.parse(File.read('querydata.json')) | |
CSV.open('data.csv', 'w') do |csv| | |
hash['results'].each do |result| | |
data = result['result']['data'] | |
descriptor = data['descriptor'] | |
dsr = data['dsr'] |
This file contains hidden or 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 bash | |
function assert_http_status { | |
local HTTP_CODE=$(curl -o /dev/null --silent --head --write-out '%{http_code}\n' $2) | |
echo "$2 returned status code $HTTP_CODE" | |
test $HTTP_CODE != $1 && (echo "FAIL: Expected $1"; exit 1) | |
echo | |
} |
This file contains hidden or 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
{ | |
"action.actioninitiated": { | |
"equals": "QA" | |
}, | |
"anomaly.prenatal.exists": { | |
"equals": true | |
}, | |
"diagnosis.providercode": { | |
"equals": "RGT01" | |
}, |
This file contains hidden or 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 | |
# This script is used by Nagios to post alerts into a Slack channel | |
# using the Incoming WebHooks integration. Create the channel, botname | |
# and integration first and then add this notification script in your | |
# Nagios configuration. | |
# | |
# All variables that start with NAGIOS_ are provided by Nagios as | |
# environment variables when an notification is generated. | |
# A list of the env variables is available here: |
This file contains hidden or 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
getDatapoints = function(json, metric) { | |
return json.find(function(d) { | |
return d.target == metric | |
}).datapoints | |
} | |
getProgress = function(graphite_url) { | |
params = jQuery.param({ | |
from: '-20seconds', | |
until: '-20seconds', |
This file contains hidden or 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
# Usage: $ REDMINE_API_KEY=1234567890 ruby planio.rb | |
require 'json' | |
require 'open-uri' | |
require 'statsd-ruby' | |
def parse_api_json(relative_path) | |
include OpenURI | |
# TODO: check the relative path is a json endpoint |
NewerOlder