Skip to content

Instantly share code, notes, and snippets.

View postwait's full-sized avatar

Theo Schlossnagle postwait

View GitHub Profile
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 October 4, 2016 13:28
sparkpost.coffee (for hubot)
# 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)
#
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)
#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);
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>
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) {
; 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
@postwait
postwait / V
Created October 23, 2015 22:26
Verifying that +postwait is my blockchain ID. https://onename.com/postwait
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') ||
#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;