Skip to content

Instantly share code, notes, and snippets.

View bahamas10's full-sized avatar

Dave Eddy bahamas10

View GitHub Profile
diff --git a/src/vm/node_modules/VM.js b/src/vm/node_modules/VM.js
index 30280a8..429bb55 100644
--- a/src/vm/node_modules/VM.js
+++ b/src/vm/node_modules/VM.js
@@ -884,51 +884,273 @@ function validateImage(image, log, callback)
});
}
-function createConfigDir(zonepath, log, cb) {
- var configDir = path.join(zonepath, 'config');
@bahamas10
bahamas10 / readme.md
Created October 2, 2018 21:52
zfs properties vminfod
21:51:17.898Z DEBUG VM: optionally setting ZFS properties (req_id=7007b604-9bc1-e2a4-aca8-f3f56702ff83, action=reprovision, vm=1cbb4361-1a8d-4202-b57d-b1bef1d2d0e4)
    props: [
      {
        "key": "zfs_root_compression",
        "zfs_prop": "compression"
      },
      {
        "key": "zfs_root_recsize",
        "zfs_prop": "recsize"
@bahamas10
bahamas10 / 00-README.md
Created September 25, 2018 19:27
vminfod and bhyve debugging

sysevent-zoneadm.js can be thought of as a very mini vminfod. It watches for zone-related sysevents and pushes them into a serializing queue when received. The queue processes the events by forking zoneadm -z <uuid> -u <uuid> list -p and extracting the third field (the state) much like vminfod does. As a result, the state as reported by zoneadm will be sometime after the state as reported by the sysevent.

Stopping a VM with:

vmadm stop d0fa8256-0bbf-c5ec-c931-e2f1c2e50c2

Results in:

@bahamas10
bahamas10 / notes.md
Created September 25, 2018 16:23
vminfod and bhyve

Trying to stop a bhyve vm:

VMADM_DEBUG_LEVEL=debug vmadm stop <uuid> 2>&1 | bunyan -o short

16:17:26.514Z DEBUG vmadm: vminfod watchForChanges 1/1 changes remaining (req_id=3b69005e-2485-61f6-965c-afca69d1bce0, action=stop, vm=bc5cdd31-e964-c361-afb9-a5b9ff1a7369, remaining=1, total=1)
    client: VM.js VM.stop (bc5cdd31-e964-c361-afb9-a5b9ff1a7369)
16:17:26.708Z  INFO vmadm: zone is halted (req_id=3b69005e-2485-61f6-965c-afca69d1bce0, action=stop, vm=bc5cdd31-e964-c361-afb9-a5b9ff1a7369)

@bahamas10
bahamas10 / README.md
Created September 6, 2018 16:49
manta 350

Manta Client Tools and SDK

manta is a Node.js SDK for interacting with Joyent's Manta system.

This repository is part of the Joyent Manta project. See CONTRIBUTING.md for contribution guidelines.

Installation

@bahamas10
bahamas10 / README.md
Created August 3, 2018 06:29
sdcadm require tree

Tree maxDepth: 0

[root@headnode (emy-12) ~]# ptime sdcadm --version
-> util 0.000s
-> fs 0.000s
-> path 0.000s
-> cmdln 0.022s
-> strsplit 0.001s
-> vasync 0.005s
@bahamas10
bahamas10 / remove-old-unfinished-torrents
Created August 3, 2018 05:44
Remove transmission torrents after a certain amount of time
#!/usr/bin/env bash
#
# Remove torrents from transmission that are done and over a certain age
#
# Author: Dave Eddy <dave@daveeddy.com>
# Date: August 03, 2018
# License: MIT
epoch() {
node -pe 'Math.floor(new Date(process.argv[1]).getTime()/1000)' "$1"
@bahamas10
bahamas10 / open-zwave.diff
Created June 15, 2018 20:28
openzwave smartos
diff --git a/cpp/build/Makefile b/cpp/build/Makefile
index 078c733f..28d04076 100644
--- a/cpp/build/Makefile
+++ b/cpp/build/Makefile
@@ -23,6 +23,9 @@ top_srcdir := $(abspath $(dir $(lastword $(MAKEFILE_LIST)))../../)
include $(top_srcdir)/cpp/build/support.mk
+# Used to detect SmartOS (variable will be "joyent")
+UNAME_V := $(shell uname -v 2>/dev/null | sed -e 's/_.*//')
@bahamas10
bahamas10 / bunyan-logs.md
Last active April 27, 2018 18:08
nightly-1 vm stop failures
$ bunyan stderr.log
[2018-04-27T12:46:34.169Z]  INFO: vmadm/50269 on headnode: Stopping VM 4f9afb1c-b99c-6e0b-c8d8-f9e7599840d0 (req_id=948e581d-bd35-6c4d-a1fc-83ff9cc55e89, action=stop, vm=4f9afb1c-b99c-6e0b-c8d8-f9e7599840d0, transition_to=stopped)
{"name":"vmadm","req_id":"948e581d-bd35-6c4d-a1fc-83ff9cc55e89","hostname":"headnode","pid":50269,"action":"stop","vm":"4f9afb1c-b99c-6e0b-c8d8-f9e7599840d0","client":"VM.js VM.stop (4f9afb1c-b99c-6e0b-c8d8-f9e7599840d0)","level":20,"vms":29,"msg":"vminfod took 0.000871461s (871.46us) to parse \\"ready\\" event, 29 vms total","time":"2018-04-27T12:46:34.196Z","v":0}
[2018-04-27T12:46:34.197Z] DEBUG: vmadm/50269 on headnode: vminfod event stream ready - took 0.023437870s (23.44ms) (req_id=948e581d-bd35-6c4d-a1fc-83ff9cc55e89, action=stop, vm=4f9afb1c-b99c-6e0b-c8d8-f9e7599840d0)
    client: VM.js VM.stop (4f9afb1c-b99c-6e0b-c8d8-f9e7599840d0)
[2018-04-27T12:46:34.197Z] DEBUG: vmadm/50269 on headnode: setting autoboot=false (req_id=948e581d-bd35-6c4d-a1fc-83ff9
@bahamas10
bahamas10 / 00-readme.md
Created March 18, 2018 23:24
missingno pixel

24 pixels wide by 56 pixels high.

$ wc -l < missingno.txt 
56
$ head -1 missingno.txt | tr -d ' ' | tr -d '\n' | wc -c
24