Skip to content

Instantly share code, notes, and snippets.

View mcr's full-sized avatar

Michael Richardson mcr

View GitHub Profile
@mcr
mcr / gist:e6f78eb106e44d88cc0852f7543c7539
Created February 6, 2017 17:30
Documentation for Chart of Account CSV upload for LedgerSMB
based upon code at: https://github.com/ledgersmb/LedgerSMB/blob/master/lib/LedgerSMB/Scripts/import_csv.pm#L308
There are 9 columns, 0-9. In spreadsheet terms "A" through "I"
A/0 - account number, like "1001"
B/1 - description, free form text
C/2 - charttype: 'A' for account, 'H' for heading
D/3 - category: A = asset, L = liability, Q = Equity, I = Income, E = expense
E/4 - contra: f for regular account, t for contra accounts, such as Liability and Expense
F/5 - tax: t if a tax account, f otherwise
@mcr
mcr / gist:b1c9dd9cfcab249e73200d0d056ac0da
Created February 7, 2017 17:43
check for derivation of public key
require 'base64'
require 'ecdsa'
sig01_key_base64 = {
kty:"EC",
kid:"11",
crv:"P-256",
x:"usWxHK2PmfnHKwXPS54m0kTcGJ90UiglWiGahtagnv8",
y:"IBOL-C3BttVivg-lSreASjpkttcsz-1rb7btKLv8EX4",
d:"V8kgd2ZBRuh2dgyVINBUqpPDr7BOMGcF22CQMIUHtNM"
@mcr
mcr / basic-keying.yang
Created February 16, 2017 20:01
YANG description of keying
module ietf-6tisch-symmetric-keying {
yang-version 1.1;
namespace
"urn:ietf:params:xml:ns:yang:6tisch-keys";
prefix "6keys";
import ietf-yang-types { prefix yang; }
import ietf-inet-types { prefix inet; }
@mcr
mcr / gist:49e8c7034658120013c1fe49da77c2ac
Last active October 25, 2017 16:15
patches to capistrano for deploying multiple times to the same server
This turned into a fork of capistrano and capistrano-bundler.
https://github.com/mcr/capistrano/tree/per-host-deploy-to
https://github.com/mcr/bundler/tree/per-host-deploy-to
and I've started a thread to make it more sane.
@mcr
mcr / gist:a0e003af6d3e400a7553543c19da8b95
Created February 9, 2018 01:35
IPv6 literals vs URI and Addrinfo
Either URI should be removing the [], or Addrinfo should be accepting it. Given that Addrinfo is just getaddrinfo(3), and it does not peel off the [], I think the fault is URI.
2.4.1 :007 > n = URI.parse("https://[::2]:1234/")
=> #<URI::HTTPS https://[::2]:1234/>
2.4.1 :008 > Addrinfo.udp(n.host, n.port)
SocketError: getaddrinfo: Name or service not known
2.4.1 :009 > n = URI.parse("coaps://[::2]:5684/")
=> #<URI::Generic coaps://[::2]:5684/>
@mcr
mcr / gist:8e9b0ca1d66fd2c104172bcc11d212ce
Created December 28, 2018 22:32
backing store investigation
taylor-[~/DrTaylorPlumage] mcr 10113 %sudo -u libvirt-qemu qemu-img info --backing-chain /srv/openswan-testing/build/images/alice.qcow2
image: /srv/openswan-testing/build/images/alice.qcow2
file format: qcow2
virtual size: 3.0G (3221225472 bytes)
disk size: 4.5M
cluster_size: 65536
backing file: /srv/openswan-testing/build/images/root.OPENSWAN.work2.6.52.qcow2
Format specific information:
compat: 1.1
lazy refcounts: false
@mcr
mcr / gist:96000bdfd516306dbedfadf16953733a
Last active March 16, 2019 22:27
ACME-Client and DNS-Update example
# something wrong with authenticating the SSL key for staging server.
OpenSSL::SSL::VERIFY_PEER = OpenSSL::SSL::VERIFY_NONE
# AcmeKeys is a local class that collects stuff including the key pair for authenticating and options,
# and which server to talk to, and DNS update options for my dasblinkenled.org zone.
puts "Server at: #{AcmeKeys.acme.server}"
client = Acme::Client.new(private_key: AcmeKeys.acme.acmeprivkey,
directory: AcmeKeys.acme.server)
account = client.new_account(contact: 'mailto:[email protected]',
terms_of_service_agreed: true)
obiwan-[projects/shg/shg_highway](2.5.3) mcr 10091 %spotify &
[1] 8902
obiwan-[projects/shg/shg_highway](2.5.3) mcr 10092 %ATTENTION: default value of option force_s3tc_enable overridden by environment.
[0316/211419.546229:ERROR:nss_util.cc(748)] After loading Root Certs, loaded==false: NSS error code: -8018
[0316/211422.011001:ERROR:input_method_base.cc(146)] Not implemented reached in virtual ui::InputMethodKeyboardController *ui::InputMethodBase::GetInputMethodKeyboardController()Using InputMethodKeyboardControllerStub
[xcb] Unknown sequence number while processing queue
[xcb] Most likely this is a multi-threaded client and XInitThreads has not been called
[xcb] Aborting, sorry about that.
/usr/share/spotify/spotify: ../../src/xcb_io.c:259: poll_for_event: Assertion `!xcb_xlib_threads_sequence_lost' failed.
elros-[projects/shg/staging] mcr 10113 %cat staging.sh
#!/bin/sh
set -e
MOUNT="--mount source=comet_certs,target=/app/certificates --mount source=eeylops_devices,target=/app/devices"
if docker ps | grep eeylops; then
docker stop eeylops_staging
docker rm eeylops_staging || true
fi
@mcr
mcr / gist:edf3a31ecfeb78564b46ae3b2ff00742
Created June 27, 2019 15:44
starting mud_telemetry
export LD_LIBRARY_PATH=/usr/local/rvm/rubies/ruby-2.6.3/lib/
. /etc/profile.d/rvm.sh
rvm use 2.6.3 >/dev/null
export CERTDIR=/app/certificates
export SERVCERT=${CERTDIR}/jrc_prime256v1.crt
export SERVKEY=${CERTDIR}/jrc_prime256v1.key