Skip to content

Instantly share code, notes, and snippets.

View cavaliercoder's full-sized avatar
💭
Trying to find time for open source projects

Ryan Armstrong cavaliercoder

💭
Trying to find time for open source projects
View GitHub Profile
@cavaliercoder
cavaliercoder / agg_writer.go
Created July 15, 2021 07:38
Go aggregated writer
package agg_writer
import (
"io"
)
// AggregatedWriter tracks the cumulative number of bytes written and any error
// that occurs across multiple writes to the underlying writer. If an error is
// returned by the underlying writer, all subsequent calls will return the same
// error and the write is dropped.
(node:46031) UnhandledPromiseRejectionWarning: NetworkingError: XMLHttpRequest is not defined
at t.constructor.t.constructor.handleRequest (/Users/rarmstrong/Development/volley/node/lambda/api/dist/index.js:8:209257)
at s (/Users/rarmstrong/Development/volley/node/lambda/api/dist/index.js:8:102022)
at constructor.<anonymous> (/Users/rarmstrong/Development/volley/node/lambda/api/dist/index.js:8:102421)
at constructor.callListeners (/Users/rarmstrong/Development/volley/node/lambda/api/dist/index.js:8:58229)
at constructor.emit (/Users/rarmstrong/Development/volley/node/lambda/api/dist/index.js:8:
@cavaliercoder
cavaliercoder / Makefile
Last active May 7, 2016 08:46
Go runtime misbehaves in forked processes
all: cbin golib.so
cbin: cbin.c
gcc -ldl -o cbin cbin.c
golib.so: golib.go
go build -x -buildmode=c-shared -o golib.so golib.go
clean:
rm -vf cbin golib.so
all: cbin golib.dylib
cbin: cbin.c
gcc -o cbin cbin.c
golib.dylib: golib.go
go build -buildmode=c-shared -o golib.dylib golib.go
clean:
rm -vf cbin golib.dylib
@cavaliercoder
cavaliercoder / rpmfile.go
Created December 3, 2015 10:32
go-rpm - a naive rpm implementation in go
// see:
// https://github.com/rpm-software-management/rpm/tree/master/lib
// http://www.rpm.org/max-rpm/s1-rpm-file-format-rpm-file-format.html
package main
import (
"bytes"
"fmt"
"math"
"os"
@cavaliercoder
cavaliercoder / ax_prog_git.m4
Created December 1, 2015 16:04
Autoconf macro for detecting git
# SYNOPSIS
#
# AX_PROG_GIT()
#
# DESCRIPTION
#
# This macro provides tests of availability of git.
#
# The --with-git option takes one of three possible values:
#
@cavaliercoder
cavaliercoder / nested-hypervisor.vmx
Last active August 29, 2015 14:27
Enable nested hypervisors in ESXi
vhv.enable = "TRUE"
hypervisor.cpuid.v0 = "FALSE"
@cavaliercoder
cavaliercoder / ZBXNEXT-1368.patch
Last active August 29, 2015 14:15
Windows service discovery in Zabbix v2.2.8
diff -ur zabbix-2.2.8/include/sysinfo.h ZBXNEXT-1368/include/sysinfo.h
--- zabbix-2.2.8/include/sysinfo.h 2014-12-16 14:38:17.000000000 +0800
+++ ZBXNEXT-1368/include/sysinfo.h 2015-02-16 14:51:38.800892200 +0800
@@ -243,6 +243,7 @@
int PERF_COUNTER(AGENT_REQUEST *request, AGENT_RESULT *result);
int SERVICE_STATE(AGENT_REQUEST *request, AGENT_RESULT *result);
int SERVICES(AGENT_REQUEST *request, AGENT_RESULT *result);
+int SERVICE_DISCOVERY(AGENT_REQUEST *request, AGENT_RESULT *result);
int PROC_INFO(AGENT_REQUEST *request, AGENT_RESULT *result);
int NET_IF_LIST(AGENT_REQUEST *request, AGENT_RESULT *result);