Skip to content

Instantly share code, notes, and snippets.

Avatar

Alistair Young cerebrate

View GitHub Profile
@cerebrate
cerebrate / README.md
Last active Aug 10, 2022
Recompile your WSL2 kernel - support for snaps, apparmor, lxc, etc.
View README.md

WARNING

THIS GIST IS EXTREMELY OBSOLETE. DO NOT FOLLOW THESE INSTRUCTIONS. SERIOUSLY.

IF YOU IGNORE THE ABOVE WARNING, YOU AGREE IN ADVANCE THAT YOU DIDN'T GET THESE INSTRUCTIONS FROM ME, THAT I WARNED YOU, AND THAT I RESERVE THE RIGHT TO POINT AND LAUGH MOCKINGLY IF AND WHEN SOMETHING BREAKS HORRIBLY.

I'll do a write-up of current custom-kernel procedures over on Random Bytes ( https://randombytes.substack.com/ ) one day soon.

NOTE

@cerebrate
cerebrate / homeassistant.yaml
Created Aug 4, 2022
Bluetooth in Home Assistant on Kubernetes
View homeassistant.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: homeassistant
name: homeassistant
namespace: homeassistant
spec:
replicas: 1
selector:
View homeassistant.yaml
---
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: homeassistant
name: homeassistant
namespace: homeassistant
spec:
replicas: 1
@cerebrate
cerebrate / Dockerfile
Created Jul 16, 2022
Home Assistant MySQL fix
View Dockerfile
FROM homeassistant/home-assistant:2022.7.5
RUN apk add --no-cache mariadb-connector-c
View Dockerfile
FROM archlinux:base-devel
LABEL org.opencontainers.image.authors="avatar@arkane-systems.net"
RUN pacman -Syu --noconfirm pacman-contrib git
# makepkg user and workdir
ARG pkguser=makepkg
RUN useradd --system --create-home $pkguser \
&& echo "$pkguser ALL=(ALL:ALL) NOPASSWD:ALL" > /etc/sudoers.d/$pkguser
@cerebrate
cerebrate / plant.yaml
Created Jul 2, 2021
STEMMA soil sensor for ESPHome
View plant.yaml
sensor:
- platform: custom
lambda: |-
auto soil_sensor = new StemmaSoilSensor();
App.register_component(soil_sensor);
return {soil_sensor->temperature_sensor, soil_sensor->moisture_sensor};
sensors:
- name: "Plant Temperature"
- name: "Plant Moisture"
@cerebrate
cerebrate / apparmor_wsl.patch
Last active May 19, 2022
Better patch for apparmor under WSL
View apparmor_wsl.patch
--- rc.apparmor.functions 2021-11-08 13:27:06.461249682 -0600
+++ rc.apparmor.functions 2021-11-08 13:30:05.766141212 -0600
@@ -68,7 +68,7 @@
# something like `systemd-detect-virt --container`.
#
# The only known container environments capable of supporting internal policy
-# are LXD and LXC environment.
+# are LXD and LXC environments and Windows Subsystem for Linux.
#
# Returns 0 if the container environment is capable of having its own internal
@cerebrate
cerebrate / mosquitto.yaml
Last active May 5, 2022
Mosquitto config for my Kubernetes cluster
View mosquitto.yaml
---
apiVersion: v1
kind: ConfigMap
metadata:
name: mosquitto-configmap
labels:
app.kubernetes.io/name: mosquitto
data:
mosquitto.conf: |
listener 1883
@cerebrate
cerebrate / kernel-config
Last active Feb 10, 2022
Kernel config for my custom WSL kernel 5.10.93.2
View kernel-config
#
# Automatically generated file; DO NOT EDIT.
# Linux/x86 5.10.93.2 Kernel Configuration
#
CONFIG_CC_VERSION_TEXT="gcc (Debian 11.2.0-16) 11.2.0"
CONFIG_CC_IS_GCC=y
CONFIG_GCC_VERSION=110200
CONFIG_LD_VERSION=237900000
CONFIG_CLANG_VERSION=0
CONFIG_LLD_VERSION=0
@cerebrate
cerebrate / .config
Created Oct 14, 2021
Kernel config for my custom WSL kernel 5.10.60.1
View .config
#
# Automatically generated file; DO NOT EDIT.
# Linux/x86 5.10.60.1 Kernel Configuration
#
CONFIG_CC_VERSION_TEXT="gcc (Debian 11.2.0-9) 11.2.0"
CONFIG_CC_IS_GCC=y
CONFIG_GCC_VERSION=110200
CONFIG_LD_VERSION=236010000
CONFIG_CLANG_VERSION=0
CONFIG_LLD_VERSION=0