Skip to content

Instantly share code, notes, and snippets.

View adamlwgriffiths's full-sized avatar
💭
Working in a silo

Adam Griffiths adamlwgriffiths

💭
Working in a silo
  • Twisted Pair Development
  • Melbourne, Australia
View GitHub Profile
# fix issue with periodic hangs caused by HW bug when using HW accelerated packet processing
# this results in network device re-initialisation which is viewable in /var/log/syslog
# and results in VMs breaking connections and disconnecting users
auto lo
iface lo inet loopback
auto eno1
iface eno1 inet manual
# start fix for e1000 hang on HP desktops
@adamlwgriffiths
adamlwgriffiths / journalctl -b -1
Created August 11, 2022 12:18
ASUS Zephyrus G15 Display Crash
Aug 11 22:00:23 dygra kernel: Linux version 5.19.0 (nixbld@localhost) (gcc (GCC) 11.3.0, GNU ld (GNU Binutils) 2.38) #1-NixOS SMP PREEMPT_DYNAMIC Sun Jul 31 21:03:01 UTC 2022
Aug 11 22:00:23 dygra kernel: Command line: initrd=\efi\nixos\fcm3w7ilxaarh9q4wq2fpfpqc9drjyl3-initrd-linux-5.19-initrd.efi init=/nix/store/pgfkzhi3ifnlv55zw9l8mdgkv0cl3rzv-nixos-system-dygra-22.05.2351.e4c9d950a3c/init idle=nomwait splash loglevel=4 nvidia-drm.modeset=1 nvidia.NVreg_PreserveVideoMemoryAllocations=1
Aug 11 22:00:23 dygra kernel: x86/fpu: Supporting XSAVE feature 0x001: 'x87 floating point registers'
Aug 11 22:00:23 dygra kernel: x86/fpu: Supporting XSAVE feature 0x002: 'SSE registers'
Aug 11 22:00:23 dygra kernel: x86/fpu: Supporting XSAVE feature 0x004: 'AVX registers'
Aug 11 22:00:23 dygra kernel: x86/fpu: Supporting XSAVE feature 0x200: 'Protection Keys User registers'
Aug 11 22:00:23 dygra kernel: x86/fpu: xstate_offset[2]: 576, xstate_sizes[2]: 256
Aug 11 22:00:23 dygra kernel: x86/fpu: xstate_offset[9]: 832, xst
@adamlwgriffiths
adamlwgriffiths / headless: $ dmesg
Created July 7, 2022 02:35
Raspberry Pi 4B 2GB + NixOS 22.05 + 4K TV
[nixos@nixos:~]$ dmesg
[ 0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd083]
[ 0.000000] Linux version 5.15.50 (nixbld@localhost) (gcc (GCC) 9.3.0, GNU ld (GNU Binutils) 2.38) #1-NixOS SMP Sat Jun 25 13:18:40 UTC 2022
[ 0.000000] Machine model: Raspberry Pi 4 Model B Rev 1.2
[ 0.000000] efi: UEFI not found.
[ 0.000000] Reserved memory: created CMA memory pool at 0x0000000037400000, size 64 MiB
[ 0.000000] OF: reserved mem: initialized node linux,cma, compatible id shared-dma-pool
[ 0.000000] NUMA: No NUMA configuration found
[ 0.000000] NUMA: Faking a node at [mem 0x0000000000000000-0x000000007fffffff]
[ 0.000000] NUMA: NODE_DATA [mem 0x7fbf8140-0x7fbfafff]
@adamlwgriffiths
adamlwgriffiths / app.py
Last active August 30, 2021 04:06
pywebview + python-socketio
# a self-contained example demonstrating using websockets with pywebview + eventlet wsgi
####################################################
# Monkey patching
import webview.serving
import threading
def get_wsgi_server(app):
CXXFLAGS += -fPIC
CXXFLAGS += -O3
CFLAGS=-I../raylib/src -I../raygui/src
all: lib/libraygui.so lib/libphysac.so
%.o: %.c
$(CC) -c -o $@ $< $(CFLAGS)
lib/libraygui.so: src/raygui.o lib
{ stdenv, lib, fetchFromGitHub, cmake,
mesa, libGLU, glfw,
libX11, libXi, libXcursor, libXrandr, libXinerama,
alsaSupport ? stdenv.hostPlatform.isLinux, alsaLib,
pulseSupport ? stdenv.hostPlatform.isLinux, libpulseaudio,
includeEverything ? true
}:
stdenv.mkDerivation rec {
pname = "raylib";
@adamlwgriffiths
adamlwgriffiths / diff.patch
Created November 3, 2020 03:35
teletype-server merge conflict
diff --cc lib/github-identity-provider.js
index 86b3c4f,1ae21bc..0000000
--- a/lib/github-identity-provider.js
+++ b/lib/github-identity-provider.js
@@@ -1,12 -1,10 +1,15 @@@
const {StatusCodeError} = require('request-promise-core/lib/errors')
module.exports =
++<<<<<<< HEAD:lib/github-identity-provider.js
+class GithubIdentityProvider {
@adamlwgriffiths
adamlwgriffiths / README.md
Last active October 2, 2020 11:42
Pi-hole update Cron job

Copy to /etc/cron.d/pihole-update You cannot edit the existing /etc/cron.d/pihole script as it will over-write itself on first update.

Why this isn't shipped with PiHole itself, is just fucking beyond me.

I for one LOVE SSH'ing into all my IoT devices every week to run random commands just to keep them up to date.

All hail our PHP overlords.

@adamlwgriffiths
adamlwgriffiths / commands.md
Last active October 2, 2020 11:18
NixOS installation commands

NixOS Installation Commands

Changes to standard installation

  • moved /home on a different hard-drive
  • used percentages with parted's mkpart to avoid non-aligned performance warnings.

Note: these commands are relevant to my particular machine. Specific values that may differ for you:

  • HDD names (/dev/sda*, /dev/nvme0np1)
  • partition sizes
@adamlwgriffiths
adamlwgriffiths / bitwarden_rs.md
Last active August 3, 2021 07:39
Setup Bitwarden_rs on Synology DiskStation NAS

Synology Bitwarden_rs Setup

Bitwarden_rs is an API compatible Rust re-write of the Bitwarden server. It is uses less resources than the standard Bitwarden server and is ideal for the Synology NAS.

Please note, without HTTPS, you will not be able to access Bitwarden using Google Chrome. See here: dani-garcia/vaultwarden#958

Install Docker