Skip to content

Instantly share code, notes, and snippets.

@taosx
taosx / strcmp.ts
Created June 1, 2023 07:52
strcmp for uint8array in javascript/typescript
// not tested (just a test)
// fastest I've tested on chrome
function strcmpBitWise(a: Uint8Array, b: Uint8Array): number {
var diff;
for (let i = 0; i < Math.min(a.length, b.length); i++) {
diff = a[i] ^ b[i];
if (diff !== 0) return diff;
}
return a.length - b.length;
#!ipxe
# Set source URI
set mirror http://download.fedoraproject.org/pub/fedora/linux/releases/38
# Detect CPU architecture and calculate repository URI
cpuid --ext 29 && set arch x86_64 || set arch i386
set repo ${mirror}/Everything/${arch}/os
# Start installer
#!ipxe
kernel https://pxe.factory.talos.dev/image/a126c838c9325140f492444bbb10e7854a720c65bae129defd2d9581e4d57e90/v1.6.7/kernel-amd64 talos.platform=metal console=ttyS0 console=tty0 init_on_alloc=1 slab_nomerge pti=on consoleblank=0 nvme_core.io_timeout=4294967295 printk.devkmsg=on ima_template=ima-ng ima_appraise=fix ima_hash=sha512 siderolink.api=https://asoslab.siderolink.omni.siderolabs.io?jointoken=DBYQQHOiqjC4J7JxLt1sG6wZnpJKLs69wksbqOLjeAd talos.events.sink=[fdae:41e4:649b:9303::1]:8090 talos.logging.kernel=tcp://[fdae:41e4:649b:9303::1]:8092
initrd https://pxe.factory.talos.dev/image/a126c838c9325140f492444bbb10e7854a720c65bae129defd2d9581e4d57e90/v1.6.7/initramfs-amd64.xz
boot