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
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 |
from threading import RLock | |
class Something(object): | |
def __init__(self, a, b): | |
self.a = a | |
self.b = b | |
self._lock = RLock() # this is not pickleable |