Skip to content

Instantly share code, notes, and snippets.

View martinus's full-sized avatar
😎
warp! Help, I'm trapped in a time

Martin Leitner-Ankerl martinus

😎
warp! Help, I'm trapped in a time
View GitHub Profile
@theStack
theStack / arm_32bit_qemu.txt
Last active November 22, 2023 15:15
Running Bitcoin Core on an emulated 32-bit ARM system using qemu
# Running Bitcoin Core on an emulated 32-bit ARM system using qemu (for reproducing issue #28906 and testing the fix PR #28913)
# guide based on https://translatedcode.wordpress.com/2016/11/03/installing-debian-on-qemus-32-bit-arm-virt-board/
# tested on Ubuntu 22.04 LTS
$ sudo apt-get install qemu-system-arm libguestfs-tools
$ wget -O installer-vmlinuz http://http.us.debian.org/debian/dists/bookworm/main/installer-armhf/current/images/netboot/vmlinuz
$ wget -O installer-initrd.gz http://http.us.debian.org/debian/dists/bookworm/main/installer-armhf/current/images/netboot/initrd.gz
$ qemu-img create -f qcow2 myarmdisk.qcow2 80G
$ qemu-system-arm -M virt -m 2048 -kernel installer-vmlinuz -initrd installer-initrd.gz \
-drive if=none,file=myarmdisk.qcow2,format=qcow2,id=hd \
@imneme
imneme / randutils.hpp
Last active September 25, 2024 13:41
Addresses common issues with C++11 random number generation; makes good seeding easier, and makes using RNGs easy while retaining all the power.
/*
* Random-Number Utilities (randutil)
* Addresses common issues with C++11 random number generation.
* Makes good seeding easier, and makes using RNGs easy while retaining
* all the power.
*
* The MIT License (MIT)
*
* Copyright (c) 2015-2022 Melissa E. O'Neill
*
@jboner
jboner / latency.txt
Last active December 21, 2024 05:15
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