Skip to content

Instantly share code, notes, and snippets.

Theo Schlossnagle postwait

View GitHub Profile
@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);
View gist:a2483861c6e7557560c6be0c1b6855f6
diff --git a/lptree.c b/lptree.c
index 6973aac..36f301e 100644
--- a/lptree.c
+++ b/lptree.c
@@ -7,6 +7,7 @@
#include <limits.h>
#include <string.h>
#include <stdlib.h>
+#include <pthread.h>
View gist:4b6e983544378bdb07ad94bdd611374f
diff --git a/src/utils/mtev_log.c b/src/utils/mtev_log.c
index 9fead3e..658d5db 100644
--- a/src/utils/mtev_log.c
+++ b/src/utils/mtev_log.c
@@ -475,6 +475,16 @@ void asynch_log_ctx_free(asynch_log_ctx *tf) {
free(tf);
}
+static void
+asynch_logio_drain(asynch_log_ctx *actx) {
View gist:b589da4e5c0d993b5941735253bf0899
; ssh garage.fabric.home.l42.org -lroot sliver
OmniOS 5.11 omnios-33c53a8 February 2016
root@garage:/root# zoneadm list -v
ID NAME STATUS PATH BRAND IP
0 global running / ipkg shared
1 eye running /zones/eye lipkg excl
2 tank running /zones/tank lipkg excl
root@garage:/root# /usr/bin/pkg update
Packages to remove: 1
Packages to update: 390
View V
Verifying that +postwait is my blockchain ID. https://onename.com/postwait
View gist:6bc6885fe2cf45b5fd4d
diff --git a/src/modules/fq_driver.c b/src/modules/fq_driver.c
index 52016ea..5636720 100644
--- a/src/modules/fq_driver.c
+++ b/src/modules/fq_driver.c
@@ -229,6 +229,7 @@ noit_fq_submit(iep_thread_driver_t *dr,
if(*payload == 'M' ||
*payload == 'S' ||
*payload == 'C' ||
+ (*payload == 'H' && payload[1] == '1') ||
(*payload == 'F' && payload[1] == '1') ||
View gist:69b063800dcfad329998
#include <stdio.h>
#include <stdlib.h>
static void print_line(char *name, char *name2, char *val) {
char *typename = NULL, *endptr, newval[128];
(void)strtod(val, &endptr);
if(*endptr == '\0') typename = "n";
if(NULL == typename) {
long foo, base = 10;
View gist:9325f3375bd4dfed965d
HttpServerSession::do_io_write+0xb()
HttpSM::state_api_callout+0x2d0()
HttpSM::do_http_server_open+0x268()
HttpSM::set_next_state+0x510()
HttpSM::state_api_callout+0x2d0()
HttpSM::set_next_state+0x248()
HttpSM::do_hostdb_lookup+0x272()
HttpSM::set_next_state+0xd9f()
HttpSM::state_api_callout+0x2d0()
HttpSM::state_cache_open_read+0x188()
You can’t perform that action at this time.