Skip to content

Instantly share code, notes, and snippets.

View mcr's full-sized avatar

Michael Richardson mcr

View GitHub Profile
@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: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 / 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: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 / 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
sns-[~] mcr 10002 %mtr -r 2607:f0b0:f:85:1200:ff:fe66:4d02
Start: Sat Nov 5 04:33:24 2016
HOST: sns.cooperix.net Loss% Snt Last Avg Best Wrst StDev
1.|-- 2600:3c03::8678:acff:fe57 0.0% 10 1.1 1.1 0.9 1.3 0.0
2.|-- 2600:3c03:6666:2::1 20.0% 10 1.1 1.1 1.0 1.2 0.0
3.|-- gw2-nyc.bb.allstream.net 0.0% 10 1.5 1.7 1.4 3.0 0.5
4.|-- 2001:4c8:100f:2a::c1 0.0% 10 19.6 20.1 19.5 24.4 1.5
5.|-- 2001:4c8:100f:2a::c1 0.0% 10 19.6 19.6 19.5 19.6 0.0
6.|-- 2607:f0b0:f:5::1 0.0% 10 25.0 25.2 24.9 25.8 0.0
7.|-- obiwan.sandelman.ca 0.0% 10 26.1 25.5 25.1 26.1 0.0
grasp-message = (message .within message-structure) / noop-message
message-structure = [MESSAGE_TYPE, session-id, ?initiator, *grasp-option]
MESSAGE_TYPE = 0..255
session-id = 0..16777215 ;up to 24 bits
grasp-option = any
message /= discovery-message
discovery-message = [M_DISCOVERY, session-id, initiator, objective]
obiwan-[~](2.2.1) mcr 10043 %openssl s_client -crlf -no_tls1_2 -connect imap.ietf.org:143 -starttls imap
CONNECTED(00000003)
depth=3 C = US, O = "Starfield Technologies, Inc.", OU = Starfield Class 2 Certification Authority
verify error:num=19:self signed certificate in certificate chain
---
Certificate chain
0 s:/OU=Domain Control Validated/CN=*.ietf.org
i:/C=US/ST=Arizona/L=Scottsdale/O=Starfield Technologies, Inc./OU=http://certs.starfieldtech.com/repository//CN=Starfield Secure Certificate Authority - G2
1 s:/C=US/ST=Arizona/L=Scottsdale/O=Starfield Technologies, Inc./OU=http://certs.starfieldtech.com/repository//CN=Starfield Secure Certificate Authority - G2
i:/C=US/ST=Arizona/L=Scottsdale/O=Starfield Technologies, Inc./CN=Starfield Root Certificate Authority - G2
# -*- ruby -*-
class OpenSSL::PKey::EC
def private?
private_key?
end
end
namespace :highway do
obiwan-[~/C/credil](2.2.1) mcr 10006 %xrandr
Screen 0: minimum 8 x 8, current 4096 x 1152, maximum 32767 x 32767
DP1 disconnected (normal left inverted right x axis y axis)
DP2 disconnected (normal left inverted right x axis y axis)
DP3 connected (normal left inverted right x axis y axis)
1024x768 60.00
800x600 60.32 56.25
848x480 60.00
640x480 59.94
HDMI1 connected 2048x1152+2048+0 (normal left inverted right x axis y axis) 510mm x 287mm