Skip to content

Instantly share code, notes, and snippets.

View initialed85's full-sized avatar
🤦‍♂️

Edward Beech initialed85

🤦‍♂️
View GitHub Profile
@initialed85
initialed85 / README.md
Last active March 31, 2022 01:20
Flashing Kogan (AU) smart devices w/ Tasmota using tuya-convert

Flashing Kogan smart devices w/ Tasmota using tuya-convert

I bought the following devices from Kogan (AU):

  • KASB10WRGBCCTB22A Kogan SmarterHome 10W RGB+CCT Color & Warm/Cool White Smart Bulb (B22)
  • KALEPDLRGBCCTA Kogan SmarterHome Smart LED Downlight
  • KASB10WRGBCCTE27A Kogan SmarterHome 10W RGB+CCT Color & Warm/Cool White Smart Bulb (E27)
  • KASPEMHUSBA Kogan Smart Plug With Energy Meter (and 2 x USB)
    • NOTE: Same device as MS6104 Jaycar Smart Plug WiFi Controlled Main Switch and Energy Monitor with 2 x USB Sockets
@initialed85
initialed85 / nvidia-device-plugin.yml
Created October 17, 2022 13:28
Modified nvidia-device-plugin.yml that works for k3s (at least for me)
# 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
@initialed85
initialed85 / kube-registry.yaml
Created October 17, 2022 16:21
Modified kube-registry.yaml from rook/deploy/examples/csi/cephfs
# 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
@initialed85
initialed85 / jython_example_magicdraw.py
Last active February 7, 2023 17:37
Example Jython script for NoMagic MagicDraw (Cameo Systems Modeler) metachain navigation
import pprint
def log(thing): # append to a log file
if not isinstance(thing, str):
text = repr(thing)
else:
text = thing
try:
@initialed85
initialed85 / iso.nix
Created February 9, 2023 12:53
Use Packer to build a NixOS ISO
{ 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" ];
@initialed85
initialed85 / generate-ssl-key-and-csr-and-pem.md
Last active May 8, 2023 01:59
A helper for generating a self-signed .key and .pem / a .key and .csr for external signing

generate-ssl-key-and-csr-and-pem.sh

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.

Limitations

  • Richer detail (country, organisation, etc) not exposed

Usage

@initialed85
initialed85 / ubiquiti_air_os_scrape.py
Created February 1, 2018 14:18
Example interaction with Ubiquiti AirOS "API"
# Requirements:
#
# Python 2.7
# Requests package (pip install requests)
import pprint
import requests
from requests.packages.urllib3.exceptions import InsecureRequestWarning
USERNAME = 'some_readonly_username'