Skip to content

Instantly share code, notes, and snippets.

@Hermann-SW
Hermann-SW / Kunerth.gp
Last active May 29, 2025 17:35
Kunerth's algorithm from 1878, for determining modular sqrt
assert(b,s)=if(!(b), error(Str(s)));
m=eval(getenv("m"));
b=m.mod;
c=lift(m);
if(ispseudoprime(c),s=sqrt(Mod(-b,c)),issquare(Mod(b,-c),&s));
V=r=lift(s);;
print("V=",r);
@probonopd
probonopd / Wayland.md
Last active June 29, 2025 06:47
Think twice about Wayland. It breaks everything!

Think twice before abandoning Xorg. Wayland breaks everything!

Hence, if you are interested in existing applications to "just work" without the need for adjustments, then you may be better off avoiding Wayland.

Wayland solves no issues I have but breaks almost everything I need. Even the most basic, most simple things (like xkill) - in this case with no obvious replacement. And usually it stays broken, because the Wayland folks mostly seem to care about Automotive, Gnome, maybe KDE - and alienating everyone else (e.g., people using just an X11 window manager or something like GNUstep) in the process.


Update 06/2025: X11 is alive and well, despite what Red Hat wants you to believe. https://github.com/X11Libre/xserver revitalizes the Xorg X11 server as a community project under new leadership.

pragma solidity ^0.5.8;
contract MiMC {
uint constant FIELD_SIZE = 21888242871839275222246405745257275088548364400416034343698204186575808495617;
function MiMCSponge(uint256 xL, uint256 xR) public pure returns (uint256, uint256) {
uint exp;
uint t;
uint xR_tmp;
t = xL;
@fo40225
fo40225 / tmpfs.log
Created August 24, 2019 04:15
linux tmpfs test 9980xe DDR4-2666 quad channel
user@ubuntu:/dev/shm$ ~/fio/fio --loops=5 --size=1g --runtime=10 --stonewall --direct=0 --group_reporting \
--name=SeqQ32T1read --bs=128k --iodepth=32 --rw=read \
--name=SeqQ32T1write --bs=128k --iodepth=32 --rw=write \
--name=4kQ8T8read --bs=4k --iodepth=8 --numjobs=8 --rw=randread \
--name=4kQ8T8write --bs=4k --iodepth=8 --numjobs=8 --rw=randwrite \
--name=4kQ32T1read --bs=4k --iodepth=32 --rw=randread \
--name=4kQ32T1write --bs=4k --iodepth=32 --rw=randwrite \
--name=4kQ1T1read --bs=4k --iodepth=1 --rw=randread \
--name=4kQ1T1write --bs=4k --iodepth=1 --rw=randwrite
SeqQ32T1read: (g=0): rw=read, bs=(R) 128KiB-128KiB, (W) 128KiB-128KiB, (T) 128KiB-128KiB, ioengine=psync, iodepth=32
@4tochka
4tochka / bare_multisig.py
Last active September 18, 2020 17:50
Sign bare MULTISIG 2 of 3 input
>>> from pybtc import *
>>>
>>> # first step we need create 2 of 3 multisig output and add same btc
>>>
>>> a1 = Address("cPBuqn4ZsddXunx6EEev6khbfUzFnh3xxdEUPCrm5uy9qGcmbBEt",
address_type="P2PKH", testnet=True)
>>> a2 = Address("cVgShyj2q4YKFX8VzCffuQcrJVYhp522NFozNi7ih2KgNVbnysKX",
address_type="P2PKH", testnet=True)
>>> a3 = Address("cQWBhFENcN8bKEBsUHvpCyCfWVHDLfn1M65Gd6nenQkpEqL4DNUH",
address_type="P2PKH", testnet=True)
@jproney
jproney / ECC2.md
Last active October 31, 2024 08:20
ECC2_Writeup

PicoCTF 2017: ECC2

A 1064CBread Writeup

Problem

In the file handout.txt, we are given the following parameters for an elliptic curve:

  • y^2 = x^3 + A*x + B mod M -- the curve equation
  • M -- the modulus of the curve
@azureru
azureru / extract android kernel.md
Last active June 9, 2025 07:53
How to Extract Android Kernel And Modify The Boot Ramdisk (Android 4.4) on Allwinner based Processor

Extracting Existing Kernel + Ramfs

Enter the machine using adb shell

Run cat /proc/partitions

  #  Path                     Purpose        Size
  0 /dev/block/mmcblk0                       7761920
  1 /dev/block/mmcblk0p1      data           6085631
@cvan
cvan / set-up-chromium-keys.md
Last active September 18, 2024 15:35
Launch Chromium with API Keys on Mac OS X and Windows

Last Updated: March 2023

IMPORTANT: Ignore the out-of-date steps below for getting Chromium keys.

Instead, read this up-to-date guide (Jan 2023) written by @LearningToPi.

P.S. Thank you to every contributor below who provided tips over the years on what should be a straightforward process: setting up Chromium for local development.

Long live the web!