Skip to content

Instantly share code, notes, and snippets.

View sirspudd's full-sized avatar

Donald sirspudd

View GitHub Profile
@sirspudd
sirspudd / latency.txt
Created January 5, 2022 14:50 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@sirspudd
sirspudd / gist:78cf33703895c1f2c87aba062e7dca93
Last active November 6, 2019 10:14
CPUID.01H:ECX.x2apic Bug and amd Threadripper kvm stuff
kvm: warning: host doesn't support requested feature: CPUID.01H:ECX.x2apic [bit 21]
kvm: Host doesn't support requested features
start failed: command '/usr/bin/kvm -id 104 -name win1607 -chardev 'socket,id=qmp,path=/var/run/qemu-server/104.qmp,server,nowait' -mon 'chardev=qmp,mode=control' -chardev 'socket,id=qmp-event,path=/var/run/qemu-server/104-event.qmp,server,nowait' -mon 'chardev=qmp-event,mode=control' -pidfile /var/run/qemu-server/104.pid -daemonize -smbios 'type=1,uuid=4478887a-76d1-4cbb-b63e-30141c1107bf' -smp '1,sockets=1,cores=1,maxcpus=1' -nodefaults -boot 'menu=on,strict=on,reboot-timeout=1000,splash=/usr/share/qemu-server/bootsplash.jpg' -vga std -vnc unix:/var/run/qemu-server/104.vnc,x509,password -no-hpet -cpu 'kvm64,+lahf_lm,+sep,+kvm_pv_unhalt,+kvm_pv_eoi,hv_spinlocks=0x1fff,hv_vapic,hv_time,hv_reset,hv_vpindex,hv_runtime,hv_relaxed,hv_synic,hv_stimer,enforce' -m 2048 -device 'vmgenid,guid=13e0bd2c-bfa5-4f6b-a1ec-757144e38226' -readconfig /usr/share/qemu-server/pve-q35.cfg -device 'usb-ta
@sirspudd
sirspudd / gist:37a94da9eaf6a0e2814f333c26c4382d
Created November 6, 2019 10:14
CPUID.01H:ECX.x2apic Bug and amd Threadripper kvm stuff
kvm: warning: host doesn't support requested feature: CPUID.01H:ECX.x2apic [bit 21]
kvm: Host doesn't support requested features
start failed: command '/usr/bin/kvm -id 104 -name win1607 -chardev 'socket,id=qmp,path=/var/run/qemu-server/104.qmp,server,nowait' -mon 'chardev=qmp,mode=control' -chardev 'socket,id=qmp-event,path=/var/run/qemu-server/104-event.qmp,server,nowait' -mon 'chardev=qmp-event,mode=control' -pidfile /var/run/qemu-server/104.pid -daemonize -smbios 'type=1,uuid=4478887a-76d1-4cbb-b63e-30141c1107bf' -smp '1,sockets=1,cores=1,maxcpus=1' -nodefaults -boot 'menu=on,strict=on,reboot-timeout=1000,splash=/usr/share/qemu-server/bootsplash.jpg' -vga std -vnc unix:/var/run/qemu-server/104.vnc,x509,password -no-hpet -cpu 'kvm64,+lahf_lm,+sep,+kvm_pv_unhalt,+kvm_pv_eoi,hv_spinlocks=0x1fff,hv_vapic,hv_time,hv_reset,hv_vpindex,hv_runtime,hv_relaxed,hv_synic,hv_stimer,enforce' -m 2048 -device 'vmgenid,guid=13e0bd2c-bfa5-4f6b-a1ec-757144e38226' -readconfig /usr/share/qemu-server/pve-q35.cfg -device 'usb-ta
@sirspudd
sirspudd / fix-infinality.md
Created June 6, 2019 23:22 — forked from cryzed/fix-infinality.md
A set of instructions on how to fix the harfbuzz + Infinality issue and restoring good-looking, Infinality-like font rendering.

Disclaimer: Please follow this guide being aware of the fact that I'm not an expert regarding the things outlined below, however I made my best attempt. A few people in IRC confirmed it worked for them and the results looked acceptable.

Attention: After following all the steps run gdk-pixbuf-query-loaders --update-cache as root, this prevents various gdk-related bugs that have been reported in the last few hours. Symptoms are varied, and for Cinnamon the DE fails to start entirely while for XFCE the icon theme seemingly can't be changed anymore etc.

Check the gist's comments for any further tips and instructions, especially if you are running into problems!

Screenshots

Results after following the guide as of 11.01.2017 13:08:

@sirspudd
sirspudd / s3-upload-aws4.sh
Created October 25, 2017 18:20 — forked from vszakats/s3-upload-aws4.sh
AWS S3 Upload using signature v4
#!/bin/sh -u
# To the extent possible under law, Viktor Szakats (vszakats.net)
# has waived all copyright and related or neighboring rights to this
# script.
# CC0 - https://creativecommons.org/publicdomain/zero/1.0/
# Upload a file to Amazon AWS S3 using Signature Version 4
#
# docs:
@sirspudd
sirspudd / gist:6791405
Created October 2, 2013 09:48
QtNetwork meets -flto
make[3]: Leaving directory `/opt/dev/spdy-src/build/qt-5.2-libc++-lto/qtbase/src/network'
LLVM ERROR: Cannot select: 0x4ed0320: v16i8 = X86ISD::PSHUFB 0xb36db30, 0xb2e4f70 [ID=70]
0xb36db30: v16i8 = bitcast 0xbde5490 [ID=69]
0xbde5490: v4i32 = X86ISD::SHUFP 0xb2399c0, 0xb2e4470, 0x4ed0420 [ID=67]
0xb2399c0: v4i32 = bitcast 0xb7fe730 [ID=55]
0xb7fe730: v16i8,ch = llvm.x86.sse3.ldu.dq 0xb2390c0, 0xb113730, 0xb7fe130 [ORD=2752] [ID=54]
0xb113730: i64 = TargetConstant<2157> [ORD=2746] [ID=1]
0xb7fe130: i64 = add 0xb36d430, 0xb2e4a70 [ORD=2751] [ID=33]
0xb36d430: i64,ch = CopyFromReg 0xb0e19e8, 0x75c2790 [ORD=2746] [ID=24]
0x75c2790: i64 = Register %vreg22 [ORD=2746] [ID=2]