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
# Requirements: | |
# | |
# Python 2.7 | |
# Requests package (pip install requests) | |
import pprint | |
import requests | |
from requests.packages.urllib3.exceptions import InsecureRequestWarning | |
USERNAME = 'some_readonly_username' |
{ 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" ]; |
import pprint | |
def log(thing): # append to a log file | |
if not isinstance(thing, str): | |
text = repr(thing) | |
else: | |
text = thing | |
try: |
# 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 |
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' % ( |
""" | |
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 |
Here's one of SAE's BSMs in XER format (size units are centimetres apparently): | |
<BasicSafetyMessage> | |
<coreData> | |
<msgCnt>33</msgCnt> | |
<id>FEF0EFD0</id> | |
<secMark>51333</secMark> | |
<lat>-419231528</lat> | |
<long>158945769</long> | |
<elev>27</elev> |