Skip to content

Instantly share code, notes, and snippets.

@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 1, 2023 03:38
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
@willglynn
willglynn / gist:3395441349765803a5b28657a782c719
Created July 28, 2016 17:20
ec2-bundle-and-upload-image example
$ wget -q http://stable.release.core-os.net/amd64-usr/1068.8.0/coreos_production_ami_image.bin.bz2
$ ec2-bundle-and-upload-image -image coreos_production_ami_image.bin.bz2 -s3-bucket totally-not-official-ami -s3-prefix ec2-bundle-and-upload-image/ -name "CoreOS-stable-1068.8.0"
2016/07/28 12:08:19 Using "-region us-east-1" to match S3 bucket
2016/07/28 12:08:19 Using "-account 123456789012" based on active credentials
2016/07/28 12:08:19 Determining size of compressed image...
2016/07/28 12:09:18 Compressed image is 4756340736 bytes
2016/07/28 12:09:18 Writing to s3://totally-not-official-ami/ec2-bundle-and-upload-image/CoreOS-stable-1068.8.0.part.0
2016/07/28 12:09:23 Writing to s3://totally-not-official-ami/ec2-bundle-and-upload-image/CoreOS-stable-1068.8.0.part.1
2016/07/28 12:09:28 Writing to s3://totally-not-official-ami/ec2-bundle-and-upload-image/CoreOS-stable-1068.8.0.part.2
2016/07/28 12:09:31 Writing to s3://totally-not-official-ami/ec2-bundle-and-upload-image/CoreOS-stable-1068.8.0.part.3
@willglynn
willglynn / full-output.txt
Created July 26, 2016 16:24
CoreOS oem/ami/import-instance-store.sh output
$ export AWS_ACCESS_KEY_ID=AKI…
$ export AWS_SECRET_ACCESS_KEY=…
$ export AWS_ACCESS_KEY=$AWS_ACCESS_KEY_ID
$ export AWS_SECRET_KEY=$AWS_SECRET_ACCESS_KEY
$ VERSION=1068.8.0
$ oem/ami/import-instance-store.sh -V $VERSION -g stable -u http://stable.release.core-os.net/amd64-usr/$VERSION/coreos_production_ami_image.bin.bz2 -B totally-not-official-ami -c /home/ec2-user/secrets/cert.pem -k /home/ec2-user/secrets/pk.pem -a <123456789012> -X
Building AMI in zone us-east-1e
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 255M 100 255M 0 0 122M 0 0:00:02 0:00:02 --:--:-- 122M