Skip to content

Instantly share code, notes, and snippets.

View imaami's full-sized avatar
🐺
C/C++/Linux ░▒▓▉▊▋▌▍▎▏

Juuso Alasuutari imaami

🐺
C/C++/Linux ░▒▓▉▊▋▌▍▎▏
  • Finland
View GitHub Profile
@imaami
imaami / .gitconfig
Last active October 24, 2025 10:47
A somewhat OK ~/.gitconfig
[alias]
aliases = config get --all --global --regexp --show-names '^alias\\.'
br = branch -avv --color=always
ib = blame --color-by-age --follow -w
idiff = diff --color=always --ignore-all-space --ignore-blank-lines --ignore-cr-at-eol --ignore-space-at-eol --ignore-space-change
ilog = log --color=always --ignore-all-space --ignore-blank-lines --ignore-cr-at-eol --ignore-space-at-eol --ignore-space-change
ishow = show --color=always --ignore-all-space --ignore-blank-lines --ignore-cr-at-eol --ignore-space-at-eol --ignore-space-change
iwdiff = diff --color=always --ignore-all-space --ignore-blank-lines --ignore-cr-at-eol --ignore-space-at-eol --ignore-space-change --color-words='([A-Z_a-z][0-9A-Z_a-z]*|0[Xx][[:xdigit:]]+|([1-9][0-9]*)?[0-9])'
iwlog = log --color=always --ignore-all-space --ignore-blank-lines --ignore-cr-at-eol --ignore-space-at-eol --ignore-space-change --color-words='([A-Z_a-z][0-9A-Z_a-z]*|0[Xx][[:xdigit:]]+|([1-9][0-9]*)?[0-9])'
iwshow = show --color=always --ignore-all-space --igno
@imaami
imaami / b25.py
Created October 10, 2025 20:58
De Bruijn sequences B(2,5) stuff
#!/usr/bin/python3
class B25():
data = (0x4653adf, 0x4653b5f, 0x4653eb7, 0x4653ed7, 0x46569df, 0x46569f7, 0x4656e9f, 0x4656fa7, 0x465769f, 0x4657da7, 0x465a9df, 0x465a9f7, 0x465ba9f, 0x465bea7, 0x465da9f, 0x465f6a7,
0x4674adf, 0x46752df, 0x467695f, 0x4676a5f, 0x467d2b7, 0x467d4b7, 0x467da57, 0x467da97, 0x46959df, 0x46959f7, 0x4695cfb, 0x4695d9f, 0x4695f3b, 0x4695f67, 0x469cafb, 0x469d95f,
0x469df2b, 0x469f2bb, 0x469f657, 0x469f72b, 0x46a59df, 0x46a59f7, 0x46a5cfb, 0x46a5d9f, 0x46a5f3b, 0x46a5f67, 0x46a72fb, 0x46a765f, 0x46a77cb, 0x46a7cbb, 0x46a7d97, 0x46a7dcb,
0x46b29df, 0x46b29f7, 0x46b94fb, 0x46bb29f, 0x46be53b, 0x46beca7, 0x46ca75f, 0x46ca7d7, 0x46cae9f, 0x46cafa7, 0x46cba9f, 0x46cbea7, 0x46ce95f, 0x46cea5f, 0x46cfa57, 0x46cfa97,
0x46e53eb, 0x46e7d2b, 0x46e7d4b, 0x46e959f, 0x46e9f2b, 0x46ea59f, 0x46ea7cb, 0x46eb29f, 0x46f94eb, 0x46f9d2b, 0x46f9d4b, 0x46fa567, 0x46fa72b, 0x46fa967, 0x46fa9cb, 0x46faca7,
0x4729afb, 0x4729beb, 0x472b7d3, 0x472be9b, 0x472bed3, 0x
@imaami
imaami / tagged_union.cpp
Last active August 9, 2025 18:39
C++14 tagged union
#define __STDC_FORMAT_MACROS
#include <cinttypes>
#include <cstdint>
#include <cstdio>
#include <string>
#include "tagged_union.hpp"
class Key {

How I broke the NotebookLM podcast hosts
and secured my place in line to meet Roko's basilisk

(Impatient? This thing right here.)

Google's NotebookLM can make pretty neat "podcasts" based on source material of your choosing. It's also annoyingly good at keeping its composure. Was.

The Process

I created a new notebook with an empty source file called you_do_not_exist.txt. At first I tried to upload a file that was literally 0 bytes in size, but it seemed to not be possible. Fortunately I found a workaround: a file with a single null byte doesn't look like anything to the hosts.

@imaami
imaami / vsplit.sh
Created February 28, 2025 17:30
Generate a list of GitHub caching keys from a semantic version
#!/usr/bin/env bash
vsplit() {
local k="$1" r
while [[ "$k" != "$r" ]]; do
echo "$k"; r="$k"
k="${k%?${k##*[0-9][.+-]}}"
done
}
@imaami
imaami / dbs26.c
Last active February 3, 2025 20:08
Generate all 67108864 64-bit binary De Bruijn sequences in 3 seconds
/* SPDX-License-Identifier: LGPL-3.0-or-later */
/**
* @file dbs26.c
* @brief Generate all 67108864 unique binary De Bruijn sequences
* with subsequence length 6, ordered by value.
*
* Compiling with MSVC on Windows:
* cl /TC /std:clatest /experimental:c11atomics /O2 /Oi /GL /GF /Zo- /favor:AMD64 /arch:AVX2 dbs26.c /Fe: dbs26.exe /MT
*
* @author Juuso Alasuutari
@imaami
imaami / README.md
Last active December 6, 2024 18:23
Sculpt hallucinated lyrics into neon echoes

wheeze.py

wheeze.py is a tool to help generate lyrics for music, but in a music-first way. It can be thought of as the reverse of the typical LLM-assisted approach.

(The first two letters come from OpenAI's whisper. I haven't invented a post-hoc rationale for the rest of the name yet.)

@imaami
imaami / b24_expand.c
Last active September 13, 2024 18:39
Expand all overlapping 4-bit subsequences of a circular 16-bit sequence
static uint64_t
b24_expand (uint16_t seq)
{
#define seq_prep(x) 0, (uint32_t)((x) << 12U | \
(x) >> 4U) << 16U | (x)
__m128i k = _mm_shuffle_epi8(
_mm_set_epi64x(seq_prep(seq)),
_mm_set_epi64x(UINT64_C(0x0303030301010101), \
UINT64_C(0x0202020200000000)));
#undef seq_prep
@imaami
imaami / shuffle_u8x16.c
Last active September 15, 2024 11:25
Expand subsequences
#include <errno.h>
#include <inttypes.h>
#include <limits.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#ifdef __aarch64__
#include <arm_neon.h>
@imaami
imaami / popcnt.h
Last active October 21, 2024 18:34
Generic popcount
/** @file popcnt.h
*/
#ifndef POPCNT_H_
#define POPCNT_H_
#include <limits.h>
#include <stdint.h>
#undef define_popcnt
#undef popcnt16_impl