Skip to content

Instantly share code, notes, and snippets.

Theo Schlossnagle postwait

Block or report user

Report or block postwait

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:4ff4c78f1b02f99200644a876f8d7b79
diff --git a/src/datasource.ts b/src/datasource.ts
index 25e4427..e5aa5df 100644
--- a/src/datasource.ts
+++ b/src/datasource.ts
@@ -126,12 +126,14 @@ export default class IrondbDatasource {
headers['X-Circonus-App-Name'] = this.appName;
}
if ('standalone' == this.irondbType && !isCaql) {
+ headers['X-Circonus-Account'] = this.accountId;
baseUrl = baseUrl + '/graphite/' + this.accountId;
View iolat.sh
#!/bin/bash
SECONDS=5
bail() {
echo "Error: $@"
exit 1
}
DIR=`mktemp -d`
cd $DIR || bail "temp directory failure"
View gist:81eed089f1e90a083f204cde526631c5
Version: 17.12.0-ce-win46 (15048)
Channel: stable
Sha1: 0ac7325e4f480d6458b9d4ef12b50d8fcf782fae
Started on: 2018/01/09 17:15:42.081
Resources: C:\Program Files\Docker\Docker\Resources
OS: Windows 10 Enterprise Insider Preview
Edition: Professional
Id: 1709
Build: 17063
BuildLabName: 17063.1000.amd64fre.rs_prerelease.171213-1610
@postwait
postwait / hex.js
Created Oct 30, 2017 — forked from valentinkostadinov/hex.js
JavaScript HEX encoding
View hex.js
function toHex(s) {
// utf8 to latin1
var s = unescape(encodeURIComponent(s))
var h = ''
for (var i = 0; i < s.length; i++) {
h += s.charCodeAt(i).toString(16)
}
return h
}
View sparkpost.coffee
# Description:
# interacts with the Sparkpost reporting API.
#
# Dependencies:
# None
#
# Configuration:
# HUBOT_SPARKPOST_API_TOKEN your API token with reporting privileges
# HUBOT_SPARKPOST_TIMEZONE the timezone (default America/New_York)
#
View gist:95362773f2c13588abfd4c4eb95bba1c
#!/usr/bin/python
# This program was created as a modification to Brendan Gregg's
# biolatency script.
from __future__ import print_function
from bcc import BPF
from time import sleep, strftime
import argparse
# arguments
examples = """examples:
View gist:0a0d9dd6c1d0fd07530489f240ca9ea2
bool
BindingInstance::construct()
{
ink_release_assert(this->lua == nullptr);
if ((this->lua = luaL_newstate())) {
luaL_openlibs(this->lua);
// Push a pointer to ourself into the well-known registry key.
@postwait
postwait / sparkpost.coffee
Created Oct 4, 2016
sparkpost.coffee (for hubot)
View sparkpost.coffee
# Description:
# interacts with the Sparkpost reporting API.
#
# Dependencies:
# None
#
# Configuration:
# HUBOT_SPARKPOST_API_TOKEN your API token with reporting privileges
# HUBOT_SPARKPOST_TIMEZONE the timezone (default America/New_York)
#
View gist:798ac915ced9b90a2e318f72ff558a50
diff --git a/src/modules-lua/noit/module/resmon.lua b/src/modules-lua/noit/module/resmon.lua
index d23388f..9eb5e5a 100644
--- a/src/modules-lua/noit/module/resmon.lua
+++ b/src/modules-lua/noit/module/resmon.lua
@@ -325,9 +325,9 @@ function initiate(module, check)
-- this is handled later as we need our challenge.
client = HttpClient:new(callbacks)
- rv, err = client:connect(reverse_str, port, use_ssl)
+ rv, err = client:connect(reverse_str, port, use_ssl, headers.Host)
View timetrials.c
#include <stdio.h>
#include <sys/time.h>
#include <pthread.h>
#include <stdlib.h>
void log_results(const char *name, int nt, double nops, double tdiff) {
printf(" === %s (%d threads, %0.0f total ops) ===\n", name, nt, nops);
printf("\tTotal time: %0.2f ms\n", tdiff*1000);
printf("\tTime per op: %0.1f ns\n", 1000000000.0 * (tdiff/nops));
printf("\tOps per sec: %0.0f ops\n", nops/tdiff);
You can’t perform that action at this time.