Skip to content

Instantly share code, notes, and snippets.


Ivan Kozik ivan

View GitHub Profile
ivan /
Last active May 28, 2023 05:40
Using single-file-cli on NixOS without Docker
# or properly via environment.systemPackages
nix-env -iA google-chrome-dev nodePackages.pnpm nodejs_latest
(cd ~/ && git clone
(cd ~/single-file-cli && pnpm import && pnpm install --ignore-scripts --no-optional --prod)
~/single-file-cli/single-file --browser-executable-path google-chrome-unstable --dump-content ""
ivan / use-decimal-sizes.patch
Last active May 27, 2023 04:27
qBittorrent 4.5.2 (actually fcd38a497eac275fa01cac4e04f27aa806df6d30) patch to use decimal sizes everywhere instead of binary prefix sizes
View use-decimal-sizes.patch
diff --git a/src/app/application.cpp b/src/app/application.cpp
index 5a74d27a4..09751de77 100644
--- a/src/app/application.cpp
+++ b/src/app/application.cpp
@@ -114,12 +114,12 @@ namespace
const Path DEFAULT_PORTABLE_MODE_PROFILE_DIR {u"profile"_qs};
- const int MIN_FILELOG_SIZE = 1024; // 1KiB
- const int MAX_FILELOG_SIZE = 1000 * 1024 * 1024; // 1000MiB
ivan /
Last active May 27, 2023 00:59
2023 reading list

Wherein I try to prioritize reading for the limited amount of time I have this year, and to remind myself to read more than just comments on the Internet. Because of problems of time and shifting interests, I will consider this a success if I read a third of the list. I'll reflect on the reading and deviations from the plan in Jan 2024.

{+} = added after initial planning

ivan / yt-dlp-use-deno-for-nsig.patch
Created May 13, 2023 00:41
yt-dlp: use deno for nsig extraction
View yt-dlp-use-deno-for-nsig.patch
diff --git a/yt_dlp/extractor/ b/yt_dlp/extractor/
index b9623cbf8..abe996273 100644
--- a/yt_dlp/extractor/
+++ b/yt_dlp/extractor/
@@ -19,6 +19,8 @@
import urllib.error
import urllib.parse
import urllib3
+import tempfile
+import subprocess
ivan / nixpkgs patch to build fewer kernel things.patch
Created May 12, 2023 02:37
nixpkgs patch to build fewer kernel things
View nixpkgs patch to build fewer kernel things.patch
From 283f99d20990d094d74ac60b98e082a16511389b Mon Sep 17 00:00:00 2001
From: Ivan Kozik <>
Date: Fri, 12 May 2023 02:18:33 +0000
Subject: [PATCH] linux/common-config: don't build things that we'll never use
.../linux/kernel/common-config.nix | 114 ++----------------
1 file changed, 8 insertions(+), 106 deletions(-)
diff --git a/pkgs/os-specific/linux/kernel/common-config.nix b/pkgs/os-specific/linux/kernel/common-config.nix
ivan / Cults are patronage
Last active May 2, 2023 17:29
Cults are patronage networks
View Cults are patronage

Cults are patronage networks. They distribute benefits. The benefits could be intangible, they don't have to be money. Belonging is a benefit, acceptance is a benefit, access to [partners] is a benefit, money is a benefit of course, but also power is a benefit; an internal hierarchy. It's a fantasy, it's what we call in psychology is a paracosm. A paracosm is an alternative cosmos; it's detached, it's a bubble. And so within this bubble you can create an entire universe with its own laws of physics of you wish, and then if you play by these rules, you're mightily rewarded, emotionally, materially, in other ways. And if you don't, of course, you're sanctioned, similarly. So it's what we call a reinforcement system. It's a reward-punishment system. Positive and negative. And it's fairly intermittently by the way, it's fairly intermittent in the sense that very often, the leader kind of punished you to remind you that you're still at his mercy. He demotes you, he criticizes you publicly, he does something to

ivan / zshrc
Last active April 23, 2023 17:03
View zshrc
# This is meant to be sourced; shebang line is for editors
umask 027
# Let me type a ! in a filename without escaping it
set +o histexpand
ivan / 0001-nixos-environment-also-create-a-bin-bash.patch
Last active April 22, 2023 17:11
nixpkgs patch to make NixOS also create a /bin/bash, for compatibility with everyone's bad shebang lines
View 0001-nixos-environment-also-create-a-bin-bash.patch
From ec04e3f0df7615cd3fd05155636c52fc0e8469b7 Mon Sep 17 00:00:00 2001
From: Ivan Kozik <>
Date: Sat, 22 Apr 2023 17:06:58 +0000
Subject: [PATCH] nixos/environment: also create a /bin/bash
nixos/modules/config/shells-environment.nix | 3 +++
1 file changed, 3 insertions(+)
diff --git a/nixos/modules/config/shells-environment.nix b/nixos/modules/config/shells-environment.nix
ivan /
Last active April 13, 2023 04:25
A conversation from Discord about overclocking CPUs

<Thomas> Dude 7800x3d "overclocks" pretty decently. 4.82 ghz all core or 4.97 single core.

<Thomas> Got a much better overclock: 5.0 ghz all core stable. 5.2 single core.

<Thomas> And I'm still like 100 mv below what I could get to, but my cooler won't be able to go much higher all core load lmao.

<Thomas> tmax is 89c, and I'm at 80c right now, but I'm also running in an open case config.

<Ivan> the software and tests used to qualify CPUs at the Intel | AMD | ... factory are secret and we have no complete substitute, so there is no way to qualify a CPU yourself for any non-default voltage and speed that can be guaranteed stable under all system conditions, especially rarer or more IO-loaded states

ivan / gist:3f80ed7d34cebd8a450c9eea82d9d35a
Last active April 12, 2023 01:29
ChatGPT hallucinates a PostgreSQL setting that doesn't exist & someone tries to help in #postgresql
View gist:3f80ed7d34cebd8a450c9eea82d9d35a
12:39:17 <heanol> i'm testing an application built for postgresql 9 on postgresql 14 now
12:39:25 <heanol> one of the queries seem to work fine in pg9, but not pg14
12:39:46 <heanol> ERROR: column "xxx" must appear in the GROUP BY clause or be used in an aggregate function
12:39:54 <ilmari> "pg9" is 7 different versions. 9 point what?
12:39:56 <heanol> did the handling of that become stricter in a version?
12:40:11 <heanol> 9.5.24
12:43:22 <ilmari> not that I can see in
12:43:26 <Naktibalda> heanol: there is configuration option called sql_group_by_fixup
12:43:31 <ilmari> can you show the actual query and table definitions?
12:44:58 <ilmari> Naktibalda: postgres doesn't have and has never had such an option