Skip to content

Instantly share code, notes, and snippets.

View ivan's full-sized avatar
🕸️

Ivan Kozik ivan

🕸️
View GitHub Profile
@ivan
ivan / setfacl with dynamic systemd users.txt
Created July 22, 2023 08:31
setfacl with dynamic systemd users
# setfacl -R -m u:photoprism:rX Pictures
setfacl: Option -m: Invalid argument near character 3
08:25:14 <ivan> why can I `setfacl -R -m u:photoprism:rX` on one machine but not another
08:25:42 <ivan> neither machine has a `photoprism` user or group
08:25:59 <ivan> nixos configuration is the same with a simple photoprism service enable = true;
08:27:32 <ivan> I _can_ u: another user that actually exists so it's not a btrfs issue
08:28:34 <ivan> oh my god
08:28:35 <ivan> systemctl restart photoprism; setfacl -R -m u:photoprism:rX Pictures
08:28:43 <ivan> it works while photoprism is running with its DynamicUser
@ivan
ivan / freedom.md
Last active July 19, 2023 02:24
the freedom to make things a little worse without getting punished for it immediately

Someone made the product worse, but not so much that it has become a priority for me to do something about it.

The corollary is that if you make something a little worse, people won't necessarily be moved to expend their time and social capital to tell you about it. You largely have to critique your own work and notice your own little regressions.

@ivan
ivan / meta.md
Created July 9, 2023 05:57
educator

If you see someone teaching something online properly, save the irrational gift from the gods while you can, before they realize their time is better spent doing anything but being an educator in public. These kinds of surpluses come and go.

@ivan
ivan / information.md
Last active July 8, 2023 01:28
Questions to ask when managing the deluge of information to consume
  1. Is this something you can save and look up later when your work context makes it more salient? You'll get a lot more out of it then.

  2. Does random sampling of the text or its conclusions suggest that this is worth your time? Generally, things are either fractally good or fractally bad.

  3. Can you get 50% of the value in 1% of the time? Sometimes you can, if what you needed was just a reference to something you didn't know about.

  4. Is this information more general and useful, or are you in some backwater of meaning? Gossip, ephemera, personalities and memoirs, half-baked ideas.

  5. Did you arrive at this information through your own attentional mechanisms? Consuming the feed can be fun but costly in time. How much more interesting is it, really, than the information that is relevant to your goals? Are you prioritizing momentary pleasure over information hygiene and attentional control?

@ivan
ivan / thoughts.md
Last active May 12, 2024 04:02
Thoughts on online dating and social networking apps after 7 years

OLD and SNS apps claim to provide value that is generally not delivered unless you are elite, or above some kind of threshold for attracting enough people to make it worthwhile; within a month or so you should be able to determine where you stand, and if you are below the threshold the only rational thing to do is cease use and do anything else with your time; popularity will not come from improved skill in using them; it's not like programming where years of practice will make it better, so said apps can easily deceive people with prior skill acquisition experiences, more hope, or long-term thinking.


If we exclude the rare and random rewards of friendship or good information (better than you'd get through other uses of time), a rational person would:

  • keep using online dating app if it were a semi-reliable source of dates with people they might like
  • keep using social networking app if it were improving their distribution through being retweeted/recommended, or semi-reliably connecting them with re
@ivan
ivan / expand-blocked-and-muted-tweets.js
Last active June 30, 2023 19:12
Sort-of archiving a bunch of Twitter accounts' profile tabs
// ==UserScript=
// @name Click to show tweets from blocked and muted users
// @version 1.0
// @match https://twitter.com/*
// @match https://mobile.twitter.com/*
// @grant none
// ==/UserScript==
(() => {
@ivan
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
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
ivan / yt-dlp-use-deno-for-nsig.patch
Created May 13, 2023 00:41
yt-dlp: use deno for nsig extraction
diff --git a/yt_dlp/extractor/youtube.py b/yt_dlp/extractor/youtube.py
index b9623cbf8..abe996273 100644
--- a/yt_dlp/extractor/youtube.py
+++ b/yt_dlp/extractor/youtube.py
@@ -19,6 +19,8 @@
import urllib.error
import urllib.parse
import urllib3
+import tempfile
+import subprocess
@ivan
ivan / nixpkgs patch to build fewer kernel things.patch
Created May 12, 2023 02:37
nixpkgs patch to build fewer kernel things
From 283f99d20990d094d74ac60b98e082a16511389b Mon Sep 17 00:00:00 2001
From: Ivan Kozik <[email protected]>
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
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
From ec04e3f0df7615cd3fd05155636c52fc0e8469b7 Mon Sep 17 00:00:00 2001
From: Ivan Kozik <[email protected]>
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