Skip to content

Instantly share code, notes, and snippets.

Avatar

Dave Voutila voutilad

View GitHub Profile
@voutilad
voutilad / badclient.go
Last active Nov 28, 2020
POC code for checking Neo4j server bolt protocol behavior after an invalid auth attempt
View badclient.go
/*
Build via `go build`...should just work. Use the "-mangle" flag to simulation a
bad password (it just tacks on an extra char). This lets you play with testing
the behavior of good vs bad auth attempts.
NOTE: don't give a bolt uri...just ip/host and port!
Usage of ./authtest:
-host string
hostname:ip for neo4j (default "localhost:7687")
@voutilad
voutilad / gcloud.patch
Created Oct 14, 2020
Make gcloud work better on Win10 with OpenSSH
View gcloud.patch
diff --git a/lib/surface/compute/config_ssh.py b/lib/surface/compute/config_ssh.py
index 41bd6794..f9d14517 100644
--- a/lib/surface/compute/config_ssh.py
+++ b/lib/surface/compute/config_ssh.py
@@ -193,7 +193,7 @@ def _CreateAlias(instance_resource):
return '.'.join(parts)
-def _BuildComputeSection(instances, private_key_file, known_hosts_file):
+def _BuildComputeSection(user, instances, private_key_file, known_hosts_file):
@voutilad
voutilad / vmd-thread-safety-07062020-v1.patch
Last active Jun 8, 2020
vmd(8) thread safety patch - solves event base corruption so your non-OpenBSD guests live longer, healthier lives
View vmd-thread-safety-07062020-v1.patch
Index: i8253.c
===================================================================
RCS file: /cvs/src/usr.sbin/vmd/i8253.c,v
retrieving revision 1.31
diff -u -p -u -p -r1.31 i8253.c
--- i8253.c 30 Nov 2019 00:51:29 -0000 1.31
+++ i8253.c 7 Jun 2020 13:53:52 -0000
@@ -30,6 +30,7 @@
#include "i8253.h"
@voutilad
voutilad / vmd-thread-safety-03062020.patch
Created Jun 3, 2020
vmd(8) patch to add thread safety to use of libevent (v2)
View vmd-thread-safety-03062020.patch
? parse.c
Index: Makefile
===================================================================
RCS file: /cvs/src/usr.sbin/vmd/Makefile,v
retrieving revision 1.22
diff -u -p -u -p -r1.22 Makefile
--- Makefile 18 Jan 2019 01:24:07 -0000 1.22
+++ Makefile 3 Jun 2020 12:38:27 -0000
@@ -7,6 +7,7 @@ SRCS= vmd.c control.c log.c priv.c proc
SRCS+= vm.c loadfile_elf.c pci.c virtio.c i8259.c mc146818.c
@voutilad
voutilad / sai.js
Last active Jun 2, 2020
Quick and dirty example of the Neo4j 4.0 js driver promise api
View sai.js
const neo4j = require('neo4j-driver')
const queryTemplate = `
MATCH (u:User {id: 'some-user-id'})-[:POSTED_ON_2020_05_10|POSTED_ON_2020_05_17]->(p:Post)
RETURN p ORDER BY p.createdAt;
`
let driver = neo4j.driver(
'neo4j://localhost',
neo4j.auth.basic('neo4j', 'password')
@voutilad
voutilad / vmd-thread-safety-02062020.patch
Created Jun 2, 2020
Initial patch for hacking vmd(8) into using both multiple device threads as well as protect event_base from corruption
View vmd-thread-safety-02062020.patch
Index: Makefile
===================================================================
RCS file: /cvs/src/usr.sbin/vmd/Makefile,v
retrieving revision 1.22
diff -u -p -u -p -r1.22 Makefile
--- Makefile 18 Jan 2019 01:24:07 -0000 1.22
+++ Makefile 2 Jun 2020 12:43:26 -0000
@@ -7,6 +7,7 @@ SRCS= vmd.c control.c log.c priv.c proc
SRCS+= vm.c loadfile_elf.c pci.c virtio.c i8259.c mc146818.c
SRCS+= ns8250.c i8253.c vmboot.c ufs.c disklabel.c dhcp.c packet.c
@voutilad
voutilad / dmesg
Created May 24, 2020
Alpine 3.11.6 with custom Linux 5.4.42 kernel built for OpenBSD hypervisor
View dmesg
[ 0.000000] BIOS-e820: [mem 0x000000000009f800-0x000000000009ffff] reserved
[ 0.000000] BIOS-e820: [mem 0x00000000000f0000-0x00000000000fffff] reserved
[ 0.000000] BIOS-e820: [mem 0x0000000000100000-0x00000000efffdfff] usable
[ 0.000000] BIOS-e820: [mem 0x00000000efffe000-0x00000000efffffff] reserved
[ 0.000000] BIOS-e820: [mem 0x00000000fffc0000-0x00000000ffffffff] reserved
[ 0.000000] BIOS-e820: [mem 0x0000000100000000-0x000000010fffffff] usable
[ 0.000000] NX (Execute Disable) protection: active
[ 0.000000] SMBIOS 2.4 present.
[ 0.000000] DMI: OpenBSD VMM, BIOS 1.11.0p2-OpenBSD-vmm 01/01/2011
[ 0.000000] Hypervisor detected: OpenBSD VMM
@voutilad
voutilad / another-run.txt
Last active May 17, 2020
investigating a ghost in the machine
View another-run.txt
(gdb) p i8253_channel [22/1216]
$4 = {{ts = {tv_sec = 128267, tv_nsec = 181506930}, start = 32767, olatch = 0,
ilatch = 32767, last_r = 1 '\001', last_w = 0 '\000', mode = 4 '\004', rbs = 0 '\000',
timer = {ev_next = {tqe_next = 0x0, tqe_prev = 0x0}, ev_active_next = {tqe_next = 0x0,
tqe_prev = 0xba9f9cb8810}, ev_signal_next = {tqe_next = 0x0, tqe_prev = 0x0},
min_heap_idx = 0, ev_base = 0xba9a852d000, ev_fd = -1, ev_events = 0, ev_ncalls = 0,
ev_pncalls = 0xbaa0149b76a, ev_timeout = {tv_sec = 128267, tv_usec = 20
@voutilad
voutilad / egdb-output.txt
Created May 17, 2020
investigating a ghost in the machine
View egdb-output.txt
Thread 3 hit Breakpoint 1, event_queue_insert (base=0xba9a8534800,
ev=0xba76e0afeb0 <i8253_channel+32>, queue=1) at event.c:879
879 event_errx(1, "%s: %p(fd %d) already on queue %x", __func__,
(gdb) l
874 if (ev->ev_flags & queue) {
875 /* Double insertion is possible for active events */
876 if (queue & EVLIST_ACTIVE)
877 return;
878
879 event_errx(1, "%s: %p(fd %d) already on queue %x", __func__,
@voutilad
voutilad / doom.json
Created May 6, 2020
Doom (or rather Groom) data model export
View doom.json
{
"metadata": {
"title": "Groom",
"dateCreated": "1585243751657",
"dateUpdated": "1588788283205",
"description": "The Doom Graph Model",
"notes": "See https://github.com/voutilad/groom",
"tags": [],
"customers": [],
"owners": [
You can’t perform that action at this time.