Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
Working in a silo

Adam Griffiths adamlwgriffiths

💭
Working in a silo
  • Twisted Pair Development
  • Melbourne, Australia
View GitHub Profile
@adamlwgriffiths
adamlwgriffiths / journalctl -b -1
Created Aug 11, 2022
ASUS Zephyrus G15 Display Crash
View journalctl -b -1
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 Jul 7, 2022
Raspberry Pi 4B 2GB + NixOS 22.05 + 4K TV
View headless: $ dmesg
[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 Aug 30, 2021
pywebview + python-socketio
View app.py
# a self-contained example demonstrating using websockets with pywebview + eventlet wsgi
####################################################
# Monkey patching
import webview.serving
import threading
def get_wsgi_server(app):
View Makefile
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
View nix-raylib-default.nix
{ 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 Nov 3, 2020
teletype-server merge conflict
View diff.patch
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 Oct 2, 2020
Pi-hole update Cron job
View README.md

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 Oct 2, 2020
NixOS installation commands
View commands.md

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 Aug 3, 2021
Setup Bitwarden_rs on Synology DiskStation NAS
View bitwarden_rs.md

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

@adamlwgriffiths
adamlwgriffiths / gitea.md
Last active Oct 2, 2020
Setup Gitea on Synology DiskStation NAS
View gitea.md

Synology Gitea setup

Install Docker

Package Centre > Docker > Install

Create folders

    /docker/gitea/postgresql
 /docker/gitea/gitea