Skip to content

Instantly share code, notes, and snippets.

@willglynn
willglynn / comparison.diff
Created April 22, 2025 00:25
Rust 1.84.1 to 1.85.0 target feature changes
--- 1.84.1-dev/aarch64-apple-darwin.json 2025-04-21 18:55:38
+++ 1.85.0-dev/aarch64-apple-darwin.json 2025-04-21 19:17:01
@@ -306,6 +306,12 @@
],
"unstable_feature_gate": null,
"globally_enabled": true
+ },
+ {
+ "name": "reserve-x18",
+ "implies_features": [],

I built this branch and made it available via rustup toolchain link stage2 build/host/stage2. This toolchain can run cargo doc, but core and std and such only support my the host as a target.

From here, I made a new crate via cargo new --lib empty, and filled lib.rs with:

#![feature(no_core)]
#![no_std]
#![no_core]
@willglynn
willglynn / gist:1314ebf89bcb2cb49f71ff3a7e016cae
Created June 25, 2024 03:53
Tigo CCA 3.7.7-ct www/cgi-bin/shell
#!/bin/sh
echo -ne "Content-Type: text/plain\r\n\r\n"
sleep $(((RANDOM % 8) + 5))
echo "Done"
@willglynn
willglynn / doc.md
Created November 1, 2023 00:18
Change SMBIOS UUID on AMI firmware PCs

PCs have SMBIOS data containing small amount of identifying information. One piece of information in this SMBIOS data is the universally unique identifier. Some PC and motherboard manufacturers fail to set this, often leaving the UUID set to 03000200-0400-0500-0006-000700080009.

If your system uses an AMI firmware (sometimes called AMIBIOS), you may be able to use AMI utilities to reset the UUID. Obtain AMIDEEFIx86.efi and an EFI shell executable, such as from inside m1ujt73usa.zip for the Lenovo ThinkStation P330 Tiny download center.

Once you have those two files, create USB drive with the FAT32 filesystem and the following structure:

\
  \AMIDEEFIx86.efi
  \efi
@willglynn
willglynn / doc.md
Last active March 27, 2025 11:19
Cloudflare Tunnels/`cloudflared` on Mikrotik RouterOS 7

Why?

In their own words:

Cloudflare Tunnel provides you with a secure way to connect your resources to Cloudflare without a publicly routable IP address. With Tunnel, you do not send traffic to an external IP — instead, a lightweight daemon in your infrastructure (cloudflared) creates outbound-only connections to Cloudflare’s edge. Cloudflare Tunnel can connect HTTP web servers, SSH servers, remote desktops, and other protocols safely to Cloudflare. This way, your origins can serve traffic through Cloudflare without being vulnerable to attacks that bypass Cloudflare.

Beyond cyberattacks, this can be particularly useful if you're behind CGNAT, e.g. on cellular or satellite, and you want to make services on or behind your router available to the broader world.

How?

@willglynn
willglynn / XMC4700-4800 pad class mismatches.csv
Created June 26, 2022 00:12
XMC4700-4800 pad class mismatches
Pin SVD Manual
P7.0 A1+ A2
P7.1 A1+ A2
P7.2 A1+ A2
P7.4 A2 A1+
P7.5 A2 A1+
P7.6 A2 A1+
P7.9 A2 A1+
P8.0 A1+ A2
P8.1 A1+ A2
Running `target/debug/cargo-flash --log trace --chip XMC4800-F100x2048 --elf …/blink`
DEBUG cargo_flash > Changed working directory to .
Flashing …/blink
DEBUG probe_rs::config::registry > Searching registry for chip with name XMC4800-F100x2048
DEBUG probe_rs::config::registry > Exact match for chip name: XMC4800-F100x2048
DEBUG probe_rs::probe::cmsisdap::tools > Searching for CMSIS-DAP probes using libusb
DEBUG probe_rs::probe::cmsisdap::tools > Found 0 CMSIS-DAP probes using libusb, searching HID
DEBUG probe_rs::probe::cmsisdap::tools > Found 0 CMSIS-DAP probes total
DEBUG jaylink > libusb 1.0.24.11584
DEBUG jaylink > libusb has capability API: true
@willglynn
willglynn / gist:2fdc8fce3542dff77fa5e0cb79cbbf2f
Created June 13, 2022 03:37
probe-rs XMC4800 "Unsupported breakpoint comparator" output
% cargo run -- -vv --chip XMC4800-F100x2048 path/to/blink
Finished dev [unoptimized + debuginfo] target(s) in 0.03s
Running `target/debug/probe-run -vv --chip XMC4800-F100x2048 path/to/blink`
(HOST) DEBUG vector table: VectorTable { initial_stack_pointer: 2003fff0, hard_fault: 8001495 }
└─ probe_run::elf @ src/elf.rs:29
(HOST) DEBUG Searching registry for chip with name XMC4800-F100x2048
└─ probe_rs::config::registry @ …/probe-rs/probe-rs/src/config/registry.rs:176
(HOST) DEBUG Exact match for chip name: XMC4800-F100x2048
└─ probe_rs::config::registry @ …/probe-rs/probe-rs/src/config/registry.rs:197
@willglynn
willglynn / poppler-0.74.0.patch
Created March 14, 2019 05:03
Add WPTypographicSymbols support
diff --git a/poppler/GfxFont.cc b/poppler/GfxFont.cc
index 41b8bb9..99fb36d 100644
--- a/poppler/GfxFont.cc
+++ b/poppler/GfxFont.cc
@@ -1242,11 +1242,15 @@ Gfx8BitFont::Gfx8BitFont(XRef *xref, const char *tagA, Ref idA, GooString *nameA
// pass 1: use the name-to-Unicode mapping table
missing = hex = false;
bool isZapfDingbats = name && name->endsWith("ZapfDingbats");
+ bool isWPTypographicSymbols = name && name->endsWith("WPTypographicSymbols");
for (int code = 0; code < 256; ++code) {
We can make this file beautiful and searchable if this error is corrected: It looks like row 10 should actually have 8 columns, instead of 6 in line 9.
Version,Release Date,Platform,Variant,Executable MD5,GUID,NvOptimusEnablement,AmdPowerXpressRequestHighPerformance
0.11.15,2015-02-04,win32,alpha,9f701052b017d07df9f32db5e7715703,8f10f577-56d8-4380-a9be451a8bffa6e1,,
0.11.15,2015-02-04,win64,alpha,5285d8b5217da9aa1bc5003bacc46054,b96b6759-3097-4d23-b35eaa2affa27382,,
0.11.16,2015-02-19,win32,alpha,0bb0ab29a6cf4ee87666ae37c0a1fc61,e6889163-33d8-44c3-9dda687271d69728,,
0.11.16,2015-02-19,win64,alpha,ebc129c6ab06febc149ffab6581d79e9,faabc7eb-9bb8-4872-91214967aab12427,,
0.11.17,2015-03-05,win32,alpha,e8ff279e1d599f7927330b733f1567f6,1dc8b273-6df7-4626-a288881be7b098b0,,
0.11.17,2015-03-05,win64,alpha,4cc69fc99ab330dd71b78dabeb1dd0bb,ce212b0f-c143-4050-ab09b976a6ae10d5,,
0.11.18,2015-03-12,win32,alpha,80db3441b8850a660d080538bb9a136a,68fae073-e7bd-4117-b2e9c0c01a1578fe,,
0.11.18,2015-03-12,win64,alpha,48bc220864c7010e51598272623254ed,c5086ec1-23bc-4823-835a792ea2f2e62e,,
0.11.19,2015-03-20,win32,alpha,b4fecc1462c81201b2c87de858de3807,6ddc86f2-372a-48c7-874423ae24