Skip to content

Instantly share code, notes, and snippets.

@lukts30
lukts30 / pl2303.c
Created May 2, 2026 17:58
NuttX PL2303 Emulation Fix for Linux Host detection
/****************************************************************************
* drivers/usbdev/pl2303.c
*
* SPDX-License-Identifier: Apache-2.0
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. The
* ASF licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the
function watchSelectionAndScroll() {
const element = $0;
if (!element) {
console.error('No element selected! Use $0 to select an element first.');
return;
}
if (!('selectionStart' in element)) {
console.warn('Selected element does not support selectionStart property:', element);
remote_transmitter:
pin: GPIO13
carrier_duty_percent: 50%
# Power Controls
switch:
- platform: template
name: "SAMSUNG_KEY_POWER_TOGGLE"
diff --git a/src/core/jupyter/jupyter-fixups.ts b/src/core/jupyter/jupyter-fixups.ts
index de0bbe3..cfe0673 100644
--- a/src/core/jupyter/jupyter-fixups.ts
+++ b/src/core/jupyter/jupyter-fixups.ts
@@ -181,7 +181,7 @@ export function fixupFrontMatter(nb: JupyterNotebook): JupyterNotebook {
nbLines(jupyterCellSrcAsLines(cell)).join(""),
);
if (headingText && !contentBeforeHeading) {
- title = headingText;
+ // title = headingText;
@lukts30
lukts30 / bigE.patch
Created February 21, 2025 21:24
Rdm4 big endian
diff --git a/rdm4lib/src/lib.rs b/rdm4lib/src/lib.rs
index 07a933a..4dd2b26 100644
--- a/rdm4lib/src/lib.rs
+++ b/rdm4lib/src/lib.rs
@@ -107,7 +107,7 @@ impl RdModell {
fn new(buf: Vec<u8>) -> Self {
let mut reader = std::io::Cursor::new(&buf);
- let rdm: RdmFile<RdmKindMesh> = reader.read_le().unwrap();
+ let rdm: RdmFile<RdmKindMesh> = reader.read_be().unwrap();
@lukts30
lukts30 / shell.nix
Last active August 13, 2026 09:38
libguestfs NixOS 25.11 appliance
{
pkgs ? import <nixpkgs> { },
}:
let
stub-pacman = pkgs.writeTextFile {
name = "stub-pacman";
text = ''
#!/bin/sh
exit 0
'';
<domain type="kvm">
<name>win11-2</name>
<uuid>de5a3f63-d63e-496f-84d9-ce849b304231</uuid>
<metadata>
<libosinfo:libosinfo xmlns:libosinfo="http://libosinfo.org/xmlns/libvirt/domain/1.0">
<libosinfo:os id="http://microsoft.com/win/11"/>
</libosinfo:libosinfo>
</metadata>
<memory unit="KiB">8388608</memory>
<currentMemory unit="KiB">8388608</currentMemory>
@lukts30
lukts30 / gist:a2333f4b405cb19a6e5f24285e8c5304
Created August 10, 2024 19:31
slow 20min but works: make-disk-image.nix under qemu-user
nixos-disk-image> error while reading directory /build/root: Cannot allocate memory
nixos-disk-image> [ 118.933097] reboot: Restarting system
nixos-disk-image> WARNING: Image format was not specified for 'nixos.raw' and probing guessed raw.
nixos-disk-image> Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted.
nixos-disk-image> Specify the 'raw' format explicitly to remove the restrictions.
nixos-disk-image> kvm version too old
nixos-disk-image> qemu-system-aarch64: failed to initialize kvm: Inappropriate ioctl for device
nixos-disk-image> qemu-system-aarch64: falling back to tcg
nixos-disk-image> loading kernel modules...
nixos-disk-image> cat: can't open '/nix/store/4dsqx50k3x8yxa5akmxfi733fv07ak8r-linux-6.6.44-shrunk/insmod-list': No such file or directory
#include <Uefi.h>
#include <Library/UefiLib.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Library/UefiRuntimeServicesTableLib.h>
#include <Library/BaseLib.h>
#include <Library/DebugLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/MemoryAllocationLib.h>