A script to take some of the toil out of generating a self-signed .key and .pem / a .key and a .csr for external signing.
- Richer detail (country, organisation, etc) not exposed
| -- | |
| -- I was using https://gist.github.com/jarnaldich/d5952a134d89dfac48d034ed141e86c5 but (I think) some of the | |
| -- joins in there are quite slow; I could probably integrate what I've learned here back into there but this | |
| -- one is good enough for what I'm currently doing | |
| -- | |
| -- The MATERIALIZED CTEs seemed to be what fixed the performance- I think without it all joins on .constraint_name | |
| -- (which I guess doesn't have an index) were being done sequentially, each time | |
| WITH | |
| tc AS MATERIALIZED ( |
| package post_generate | |
| import ( | |
| "fmt" | |
| "go/format" | |
| "reflect" | |
| "strings" | |
| "time" | |
| "github.com/google/uuid" |
| { config, pkgs, ... }: | |
| { | |
| imports = [ | |
| <nixpkgs/nixos/modules/installer/cd-dvd/installation-cd-minimal.nix> | |
| <nixpkgs/nixos/modules/installer/cd-dvd/channel.nix> | |
| ]; | |
| systemd.services.sshd.wantedBy = pkgs.lib.mkForce [ "multi-user.target" ]; |
| # this modification adds a service w/ a LoadBalancer presence on port 5000 | |
| apiVersion: v1 | |
| kind: PersistentVolumeClaim | |
| metadata: | |
| name: cephfs-pvc | |
| namespace: kube-system | |
| spec: | |
| accessModes: | |
| - ReadWriteMany |
| # tweaked from https://raw.githubusercontent.com/NVIDIA/k8s-device-plugin/v0.12.2/nvidia-device-plugin.yml | |
| # credit to https://github.com/hansaya for the comment at https://github.com/k3s-io/k3s/issues/4391#issuecomment-1194627754 | |
| # note: you need to label your GPU nodes with gpu=yes for this to work (I had some non-GPU nodes and the discovery pods kept crashlooping | |
| # on those nodes without the system working out they had no GPUs) | |
| # | |
| # prerequisites | |
| # | |
| apiVersion: node.k8s.io/v1 |
| """ | |
| Synapse Wireless RF200 devices use some terribly hobbled version of Python2 coupled with a terribly limited library. | |
| They are in general terrible devices. | |
| Anyway- to read SMBus (a protocol layer on top of i2c- see Page 41 of 85 of http://smbus.org/specs/SMBus_3_0_20141220.pdf) the process is as follows: | |
| - write 2 bytes to i2c | |
| - byte 0 = slave address shifted left by 1 bit, write bit of 0 | |
| - byte 1 = command |
I bought the following devices from Kogan (AU):
| import glob | |
| import os | |
| import sys | |
| import time | |
| from math import sqrt | |
| from pyproj import Geod, Transformer | |
| try: | |
| sys.path.append(glob.glob('../carla/dist/carla-*%d.%d-%s.egg' % ( |
| # to simulate DGPS generation | |
| # python pktgen.py tb 3784 1 305 | |
| # to receive | |
| # python pktgen.py rb 3784 1 305 | |
| # to simulate AMP generation | |
| # python pktgen.py tm 13000 2.77 372 | |
| # to receive | |
| # python pktgen.py rm 13000 2.77 372 |