Skip to content

Instantly share code, notes, and snippets.

@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"
#!/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
#
#!/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"];
@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 / papertrail.go
Last active August 29, 2015 14:23
Papertrail with Go
package main
import (
// "log"
"log/syslog"
)
func main() {
pt, err := syslog.Dial("udp", "<host>.papertrailapp.com:11111", syslog.LOG_ERR, "My_App_Name")
if err != nil {
@mbeale
mbeale / gist:8569047
Last active January 4, 2016 04:29
Ruby fetch IDs EasyPost
require "easypost"
EasyPost.api_key = 'YOUR API KEY'
shipment_ids = #fetch a list of shipment ids from your end
shipment_ids.each do |id|
shipment = EasyPost::Shipment.retrieve(id)
if shipment.tracker.status == 'pre_transit'
begin
shipment.refund