Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env bash
#
# Python MAC OSX Librato Agent install script
# Version: 0.0.2
# Author: Librato
#
# run:
# curl -s "https://raw.githubusercontent.com/librato/python-librato-agent/master/sh/install.sh?" | bash
#
@mbeale
mbeale / gist:4247971
Created December 10, 2012 02:01
Dynamic JSON sample golang #4
type JSONContainer struct {
data []interface{}
}
func (j *JSONContainer) All() (objects []JSONObject) {
for _, v := range j.data {
objects = append(objects, JSONObject{data: v})
}
return
}
@mbeale
mbeale / read_questdb.py
Created May 6, 2020 10:48
Read a QuestDB query into a Pandas DF
import pandas as pd
import requests
def read_questdb(query, host, per_page = 10000, max_records = None):
"""
Sends a SQL query to a specified host.
Parameters
----------------
@mbeale
mbeale / dashboard.yml
Last active March 10, 2020 13:27
yaml for a remote service comparison
---
name: Service Comparison
default_tag_set_id:
charts:
- name: Response Size
type: line
streams:
- group_function: average
summary_function: average
tags:
@mbeale
mbeale / sqlserver.yaml
Last active August 29, 2019 14:15
Example sqlserver.yaml
collector:
sqlserver:
all:
# Specify instances to monitor with a comma-delimited list of connection strings.
# All connection parameters are optional.
# By default, the host is localhost, listening on default port, TCP 1433.
# for Windows, the user is the currently running AD user (SSO).
# See https://github.com/denisenkom/go-mssqldb for detailed connection
# parameters.
servers: |
@mbeale
mbeale / java.yml
Created October 5, 2018 18:36
JAVA dashboard
---
name: Java Profiling (GC)
charts:
- name: OldGen Collections
type: line
streams:
- summary_function: average
downsample_function: average
tags:
- name: "@host"
@mbeale
mbeale / remove_stale_metrics.rb
Last active December 4, 2017 18:31
Removing stale metrics from Librato
#!/usr/bin/env ruby
require 'librato/metrics'
c = Librato::Metrics
email = 'user@example.com'
token = 'abcd1234'
c.authenticate email, token
@mbeale
mbeale / gist:6981298
Last active March 27, 2017 08:36
EasyPost Handle Webhook PHP
$inputJSON = file_get_contents('php://input');
$event = \EasyPost\Event::receive($inputJSON);
if($event.description == 'tracker.updated'){
//process event here
}
#!/usr/bin/env bash
#
# Python MAC OSX Librato Agent install script
# Version: 0.0.2
# Author: Librato
#
# run:
# curl -s "https://raw.githubusercontent.com/librato/python-librato-agent/master/sh/install.sh?" | bash
#
# http://www.graphviz.org/content/cluster
digraph G {
subgraph cluster_level_1 {
style=filled;
color=lightgrey;
node [style=filled,color=white];
integration_0[label="integration"];
custom_space_0[label="custom_space"];