Skip to content

Instantly share code, notes, and snippets.

View sam-bristow's full-sized avatar
😶‍🌫️
yak-shaving

Sam Bristow sam-bristow

😶‍🌫️
yak-shaving
  • Auckland, New Zealand
View GitHub Profile
@bvssvni
bvssvni / gist:9674632
Last active December 23, 2023 22:56
A Rust Chain Macro
//! Chain macro in Rust
//!
//! A typical usage is to avoid nested match expressions.
//!
//! Supports:
//! - Pattern matching
//! - Or expressions (A | B => ...)
//! - Guarded statements (x if <cond> => ...)
//! - Implicit else (requires all arms to return same type)
#!/bin/env bash
# I don't know way, but without this line gcc start to compile stdout :\
exec 1>&2
set -x
# build the linux targets with {linux_headers_path}/build;
# compile it to the our Makefile's path and read
# our Makefile from stdin to make its path simpler.
@smoser
smoser / README.md
Last active July 19, 2024 20:55
qemu to linux mapping of smbios / dmi information

Mappings for DMI/SMBIOS to Linux and dmidecode

Information can be put into dmi tables via some qemu-system hosts (x86_64 and aarch64). That information is exposed in Linux under /sys/class/dmi/id and can be read with dmidecode. The names are very annoyingly inconsistent. The point of this doc is to map them.

Mappings

Example qemu cmdline:

qemu-system-x86_64 -smbios type=<type>,field=value[,...]

qemu-system-x86_64 -smbios type=0,vendor=superco,version=1.2.3