Skip to content

Instantly share code, notes, and snippets.

View zommiommy's full-sized avatar
💤
i need to sleep more

Tommaso Fontana zommiommy

💤
i need to sleep more
View GitHub Profile
@zommiommy
zommiommy / measurements.jsonl
Last active August 24, 2026 16:57
Qwen3.8-27B per-layer KV cache: measured 64K greedy frontier and uniform comparisons
{"ts": 1787251577.3300862, "spec": "3=q8_0/f16", "kld": 0.653984, "top1_pct": 88.778, "rc": 0, "sec": 54.2, "attempt": 1, "eta": "unknown", "remaining_steps": 96}
{"ts": 1787251625.0608952, "spec": "3=f16/q8_0", "kld": 0.655893, "top1_pct": 88.61, "rc": 0, "sec": 47.7, "attempt": 1, "eta": "1d 22h 15m", "remaining_steps": 96}
{"ts": 1787251672.7003484, "spec": "7=q8_0/f16", "kld": 0.571146, "top1_pct": 89.483, "rc": 0, "sec": 47.6, "attempt": 1, "eta": "1d 19h 29m", "remaining_steps": 96}
{"ts": 1787251720.1224434, "spec": "7=f16/q8_0", "kld": 0.586447, "top1_pct": 89.261, "rc": 0, "sec": 47.4, "attempt": 1, "eta": "1d 18h 32m", "remaining_steps": 96}
{"ts": 1787251767.8411736, "spec": "11=q8_0/f16", "kld": 0.51183, "top1_pct": 89.911, "rc": 0, "sec": 47.7, "attempt": 1, "eta": "1d 18h 0m", "remaining_steps": 96}
{"ts": 1787252127.1609387, "spec": "11=f16/q8_0", "kld": 0.548732, "top1_pct": 89.554, "rc": 0, "sec": 47.1, "attempt": 1, "eta": "1d 17h 44m", "remaining_steps": 96}
{"ts": 1787252174.1313019, "spec
@zommiommy
zommiommy / shell.nix
Created September 10, 2024 20:00
Nix-shell that can run idapro 9.0
{ pkgs ? import <nixpkgs> {} }:
let
idaProPath = "$PWD"; # Adjust this to your IDA Pro installation path
idaExecutable = "${idaProPath}/ida64"; # Adjust if needed for different executables
fhsEnv = pkgs.buildFHSUserEnv {
name = "ida-pro-env";
targetPkgs = pkgs: (with pkgs; [
glibc
libGL
@zommiommy
zommiommy / vmmap.py
Last active July 16, 2024 14:42
make lldb usable. use `command script import /path/to/vmmap.py` to import it. It's important that the file is named vmmap
def parse_maps(pid):
with open("/proc/{pid}/maps".format(pid=pid)) as f:
for line in f.readlines():
vals = (
val.strip()
for val in line.split(" ")
if val.strip()
)
addrs = next(vals)
@zommiommy
zommiommy / data.csv
Last active March 20, 2024 13:37
Bisect the stack needed to sort a vec of a given size using rayon par sort unstable
1 1
2 1
3 1
4 1
5 1
6 1
7 1
8 1
9 1
10 1
#![no_std]
extern crate alloc;
use alloc::vec::Vec;
use primitive::Primitive;
/// Implementation of:
/// > An Efficient Representation for Sparse Sets
/// > by Preston Briggs and Linda Torczon
/// > <https://dl.acm.org/doi/pdf/10.1145/176454.176484>
/// > <https://research.swtch.com/sparse>
@zommiommy
zommiommy / sip.rs
Created July 28, 2023 10:51
Hashes impl
//! Implementation of SipHash from [Jean-Philippe Aumasson](https://www.aumasson.jp/) and Daniel J. Bernstein.
//!
//! SipHash is a general-purpose hashing function: it runs at a good
//! speed (competitive with Spooky and City) and permits strong _keyed_
//! hashing. This lets you key your hash tables from a strong RNG, such as
//! [`rand::os::OsRng`](https://docs.rs/rand/latest/rand/rngs/struct.OsRng.html).
//!
//! Although the SipHash algorithm is considered to be generally strong,
//! it is not intended for cryptographic purposes. As such, all
//! cryptographic uses of this implementation are _strongly discouraged
@zommiommy
zommiommy / main.rs
Created May 28, 2023 19:57
Implementation of online first and second order ordinary least squares regression
/// A simple online linear regression algorithm.
/// See https://en.wikipedia.org/wiki/Simple_linear_regression#Fitting_the_regression_line
/// for details.
pub struct FirstOrderOLS {
x: f64,
y: f64,
xx: f64,
xy: f64,
n: usize,
@zommiommy
zommiommy / bench.rs
Created May 12, 2023 15:28
Code for benchmarking all the implementations of the cardinality extimations of hyperloglog
#![feature(test)]
extern crate test;
use test::{black_box, Bencher};
// Optionally include some setup
const NUMBER_OF_ELEMENTS: usize = 10_000;
const BITS: usize = 5;
fn gen_data() -> Vec<u8> {
let mut res = Vec::with_capacity(NUMBER_OF_ELEMENTS);
@zommiommy
zommiommy / lib.rs
Last active January 14, 2023 18:43
Better num-traits ?
#![deny(unconditional_recursion)]
use core::fmt::{Debug, Display, LowerHex, Binary};
use core::ops::*;
use core::sync::atomic::*;
use core::num::*;
/// Trait of operations possible on both Signed and Unsiged words
pub trait Number: Sized + Send + Sync +
Display + LowerHex +
@zommiommy
zommiommy / .env
Created October 4, 2022 15:41
Elastic + Kibana + TheHive + Cortex
# Version of Elastic products
STACK_VERSION=8.4.2
# Port to expose Elasticsearch HTTP API to the host
ES_PORT=9200
# Port to expose Kibana to the host
KIBANA_PORT=5601
# RAM for each service 4GB