Skip to content

Instantly share code, notes, and snippets.

View Hermann-SW's full-sized avatar

Hermann Stamm-Wilbrandt Hermann-SW

View GitHub Profile
@Hermann-SW
Hermann-SW / phoronix-hpl.txt
Created August 14, 2025 00:52
Phoronix hpl test for Lenovo x3950 X6 system with 8x e7-8880 v3 CPUs
$ head -3 phoronix-hpl.txt && echo -e "...\n..." && tail -28 phoronix-hpl.txt
hermann@x3950-X6:~/phoronix-test-suite$ sudo ./install-sh
-e
Phoronix Test Suite Installation Completed
...
...
Continuing in 5 seconds or press CTRL-C to stop the testing process.
HPL Linpack 2.3:
pts/hpl-1.0.0
@Hermann-SW
Hermann-SW / ml.jscad
Created August 5, 2025 15:52
mona-lisa100K.tsp cities as JSCAD cuboids
This file has been truncated, but you can view the full file.
/*jslint node*/
"use strict";
const jscad = require("@jscad/modeling");
const {vec2, vec3} = jscad.maths;
const {colorize} = jscad.colors;
const {cylinder, sphere, torus, cuboid} = jscad.primitives;
const {rotate, scale, translate} = jscad.transforms;
let edgeCylinder = cylinder({height: 1, radius: 0.01}); // cached
let vertexSphere = cuboid({size: [0.3,0.3,0.01]});
""" pylinted, and code formatted with black """
from math import lcm
from cryptography.hazmat.primitives.asymmetric import rsa
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives import serialization
# P and Q are prime factors of largest factored sofar RSA-250
#
P = 641352894770715802787901901705773890848250147429434472081168596 * 10**62
P += 32024532344630238623598752668347708737661925585694639798853367
@Hermann-SW
Hermann-SW / nohup.out.RSA-155
Created July 28, 2025 10:26
cado-nfs.py nohup output for factoring RSA-155 in 25:13h in total on 16C/32T AMD 7950X CPU with 32GB RAM
This file has been truncated, but you can view the full file.
Info:root: Using default parameter file ./parameters/factor/params.c155
Info:root: No database exists yet
Info:root: Created temporary directory /tmp/cado.10b02n9l
Info:Database: Database URI is db:sqlite3:///tmp/cado.10b02n9l/c155.db
Info:Database: Opened connection to database /tmp/cado.10b02n9l/c155.db
Info:root: Set tasks.linalg.bwc.threads=16 based on detected physical cores
Info:root: Set tasks.threads=32 based on detected logical cpus
Info:root: tasks.threads = 32 [via tasks.threads]
Info:root: tasks.polyselect.threads = 2 [via tasks.polyselect.threads]
Info:root: tasks.sieve.las.threads = 2 [via tasks.sieve.las.threads]
@Hermann-SW
Hermann-SW / hip-magic.cpp
Created July 7, 2025 19:23
Compare single thread pure integer performance of CPUs and [AMD] GPUs
/*
Compare single thread pure integer performance of CPUs and [AMD] GPUs
hipcc hip-magic.hip
cpplint --filter=-legal/copyright hip-magic.hip.cpp
cppcheck --enable=all --suppress=missingIncludeSystem hip-magic.hip.cpp --check-config
*/
#include <sys/time.h>
#include <stdint.h>
#include <hip/hip_runtime.h>
@Hermann-SW
Hermann-SW / dummy.txt
Last active July 10, 2025 19:38
OpenCL example notes
see comments
@Hermann-SW
Hermann-SW / pcb442.cpp
Last active July 21, 2025 11:59
TSP Ruin and Recreate greedy implementation with random+sequential+radial ruins
//
// Developemnt of this gist is stopped, no further updates.
//
// This is the equivalent of this gist in new RR repo:
// https://github.com/Hermann-SW/RR/blob/main/tsp/greedy.cpp
//
// Code is split up, and a loader was added allowing for differnt problems.
// In addition that repo has 111 TSP problems with 108 corresponding
// optimal tours.
/*
@Hermann-SW
Hermann-SW / range_http.c
Created June 23, 2025 17:38
single threaded http server for distribution of disjoint bases from a range to geneferg on many CPUs/GPUs
/* based on:
https://medium.com/@justup1080/tutorial-creating-a-minimalist-http-server-in-c-2303d140c725
gcc -Wall -Wextra -pedantic range_http.c -o range_http
*/
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <netinet/in.h>
@Hermann-SW
Hermann-SW / amdgpu_temp
Created June 11, 2025 20:08
Table display of three temperatures for all installed AMD GPUs every second
#!/bin/bash
d=$(find /sys/class/drm/card?/device/unique_id | wc --l)
printf "%9s" "$(hostname)"
for((c=0;c<d;++c))
do
printf "|%s" "$(cat /sys/class/drm/card$c/device/unique_id)"
done
echo "|"
@Hermann-SW
Hermann-SW / demo_executions.md
Last active June 1, 2025 09:47
Fast discrete log() allows factoring RSA semiprimes easily

See comment below.