kosayoda's Avatar

kosayoda

@kosalab.dev

i do things some days and write on https://kosalab.dev

34
Followers
88
Following
67
Posts
04.12.2024
Joined
Posts Following

Latest posts by kosayoda @kosalab.dev

I've been meaning to see how far I can go with my own devcontainer cli implementation, with blackjack and hoo

Version 1.0 should of course include `stop` and `down`, because how are we 4 years in without??

07.02.2026 06:24 πŸ‘ 1 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0

β€œSummoned an unusually powerful claude instance”

07.02.2026 01:04 πŸ‘ 146 πŸ” 7 πŸ’¬ 7 πŸ“Œ 2
Preview
Michael Stapelberg 🐧🐹😺 (@zekjur@mas.to) Attached: 4 images PSA: Did you know that it’s **unsafe** to put code diffs into your commit messages? Like https://github.com/i3/i3/pull/6564 for example Such diffs will be applied by patch(1) (also git-am(1)) as part of the code change! This is how a sleep(1) made it into i3 4.25-2 in Debian unstable.

in-band signaling is always a mistake and unix tooling is full of in-band signaling https://mas.to/@zekjur/116022397626943871

06.02.2026 08:05 πŸ‘ 95 πŸ” 28 πŸ’¬ 1 πŸ“Œ 5
Person: say, i am alive.

Computer: I am alive.

Person: oh my god.

Person: say, i am alive. Computer: I am alive. Person: oh my god.

01.02.2026 23:48 πŸ‘ 23428 πŸ” 5147 πŸ’¬ 85 πŸ“Œ 141
Post image
27.01.2026 02:23 πŸ‘ 4565 πŸ” 907 πŸ’¬ 5 πŸ“Œ 1

edit: over the past week I've been very entertained and amused watching amos gradually replacing every single core dependency with a homegrown bearcove alternative

15.12.2025 05:41 πŸ‘ 2 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0

Recently found out about @fasterthanli.me's project github.com/bearcove/dod... and it has many good ideas I will shamelessly incorporate into my site

04.12.2025 21:15 πŸ‘ 2 πŸ” 0 πŸ’¬ 1 πŸ“Œ 1

Yep, I want my site to break only when I break it 🫑

19.05.2025 00:58 πŸ‘ 2 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0

...beforehand, but it's still wild to me that musl is able to just save and restore two variables while glibc ends up performing 4 extra system calls every time `perror` is called (dup, fcntl, fstat, close)

07.04.2025 21:42 πŸ‘ 0 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0

...and if so _duplicates stderr's file descriptor, creates a FILE* from the new file descriptor, uses that, then closes the file!!_

Now `perror` is unlikely to be on the hot path by any means, and this only happens if you haven't interacted with stderr at all...

07.04.2025 21:42 πŸ‘ 1 πŸ” 0 πŸ’¬ 1 πŸ“Œ 0

although it must work as if the stream is byte-oriented.

Musl handles this in 4 lines of code: 2 to save the locale and orientation before printing the message, and 2 to restore them afterwards.

Glibc on the other hand checks if the orientation is unset...

07.04.2025 21:42 πŸ‘ 0 πŸ” 0 πŸ’¬ 1 πŸ“Œ 0

So the standard I/O streams in C (stdin/stdout/stderr) are unoriented by default until first use (ie. calling fgetc vs fgetwc on stdin determines if it is a byte-oriented stream or wide-oriented stream).

However, POSIX forbids `perror` from changing the orientation of unoriented streams,

07.04.2025 21:42 πŸ‘ 0 πŸ” 0 πŸ’¬ 1 πŸ“Œ 0
kosalab kosayoda's personal website.

Thinking of ways to hint more strongly that the KOSALAB at kosalab.dev is clickable and leads to a lot more content without putting another link down somewhere else

31.03.2025 17:48 πŸ‘ 0 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0
Preview
CSS nesting: use with caution Is CSS nesting an exciting new feature or a potential disaster waiting to happen? I note down my worries and prior experience with one of it predecessors: Sass nesting, along with some gotchas native ...

I realized that my initial post was pretty vague, sorry! An example is the "It stems from pre-processors" heading at piccalil.li/blog/css-nes.... The heading is linkable and the markup includes an SVG link icon to the heading, but the link icon does not show up at all.

25.03.2025 15:23 πŸ‘ 0 πŸ” 0 πŸ’¬ 1 πŸ“Œ 0

@piccalil.li Are article heading links broken on the site right now? I see markup indicating support in the HTML so the CSS might be borked

24.03.2025 20:38 πŸ‘ 1 πŸ” 0 πŸ’¬ 1 πŸ“Œ 0

Collaborative task tracker and management calling it now

05.03.2025 22:41 πŸ‘ 0 πŸ” 0 πŸ’¬ 1 πŸ“Œ 0
DuckDuckGo AI Assist that reads:
Ectoplasm is a Spectral Card in Balatro that reduces your hand size by 1 each time it is used, but the reduction increases with each subsequent use during a run. For example, the first use reduces hand size by 1, the second by 2, and the third by 3, making it important to use carefully.

DuckDuckGo AI Assist that reads: Ectoplasm is a Spectral Card in Balatro that reduces your hand size by 1 each time it is used, but the reduction increases with each subsequent use during a run. For example, the first use reduces hand size by 1, the second by 2, and the third by 3, making it important to use carefully.

Thanks duckduckgo AI

22.02.2025 06:33 πŸ‘ 1 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0

snrub www.youtube.com/watch?v=HRIt... by dankmus and delorean www.youtube.com/watch?v=JNaN... by toconoma have a similar tune

19.02.2025 21:45 πŸ‘ 0 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0
~/Documents/code/projects/pspsps β€Ί ps a -o pid,comm,pri,priority,opri,pri_foo,pri_bar,pri_baz
    PID COMMAND         PRI PRI PRI FOO BAR BAZ
   1022 fish             19  20  80   0  21 120
   1095 fish             19  20  80   0  21 120
   1110 niri-session     19  20  80   0  21 120
   1122 systemctl        19  20  80   0  21 120
   4204 fish             19  20  80   0  21 120
   5946 fish             19  20  80   0  21 120
  17244 fish             19  20  80   0  21 120
  25935 fish             19  20  80   0  21 120
  29913 fish             19  20  80   0  21 120
  84350 nvim             19  20  80   0  21 120
  84372 nvim             19  20  80   0  21 120
  90456 fish             19  20  80   0  21 120
  93851 fish             19  20  80   0  21 120
  93873 man              19  20  80   0  21 120
  93881 sh               19  20  80   0  21 120
  93883 bat              19  20  80   0  21 120
  93891 less             19  20  80   0  21 120
 104296 fish             19  20  80   0  21 120
 107004 ps               19  20  80   0  21 120

~/Documents/code/projects/pspsps β€Ί ps a -o pid,comm,pri,priority,opri,pri_foo,pri_bar,pri_baz PID COMMAND PRI PRI PRI FOO BAR BAZ 1022 fish 19 20 80 0 21 120 1095 fish 19 20 80 0 21 120 1110 niri-session 19 20 80 0 21 120 1122 systemctl 19 20 80 0 21 120 4204 fish 19 20 80 0 21 120 5946 fish 19 20 80 0 21 120 17244 fish 19 20 80 0 21 120 25935 fish 19 20 80 0 21 120 29913 fish 19 20 80 0 21 120 84350 nvim 19 20 80 0 21 120 84372 nvim 19 20 80 0 21 120 90456 fish 19 20 80 0 21 120 93851 fish 19 20 80 0 21 120 93873 man 19 20 80 0 21 120 93881 sh 19 20 80 0 21 120 93883 bat 19 20 80 0 21 120 93891 less 19 20 80 0 21 120 104296 fish 19 20 80 0 21 120 107004 ps 19 20 80 0 21 120

That's not including the _other_ "priorities" a Linux system can have, which isn't documented in the manpage of ps and can only be found in the source code, which are (and I kid you not) pri_foo, pri_bar, and pri_baz...

07.02.2025 07:03 πŸ‘ 0 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0
~/Documents/code/projects/pspsps β€Ί ps a -o pid,comm,pri,priority,opri
    PID COMMAND         PRI PRI PRI
   1022 fish             19  20  80
   1095 fish             19  20  80
   1110 niri-session     19  20  80
   1122 systemctl        19  20  80
   4204 fish             19  20  80
   5946 fish             19  20  80
  17244 fish             19  20  80
  25935 fish             19  20  80
  29913 fish             19  20  80
  84350 nvim             19  20  80
  84372 nvim             19  20  80
  90456 fish             19  20  80
  93851 fish             19  20  80
  93873 man              19  20  80
  93881 sh               19  20  80
  93883 bat              19  20  80
  93891 less             19  20  80
 104296 fish             19  20  80
 106185 ps               19  20  80

~/Documents/code/projects/pspsps β€Ί ps a -o pid,comm,pri,priority,opri PID COMMAND PRI PRI PRI 1022 fish 19 20 80 1095 fish 19 20 80 1110 niri-session 19 20 80 1122 systemctl 19 20 80 4204 fish 19 20 80 5946 fish 19 20 80 17244 fish 19 20 80 25935 fish 19 20 80 29913 fish 19 20 80 84350 nvim 19 20 80 84372 nvim 19 20 80 90456 fish 19 20 80 93851 fish 19 20 80 93873 man 19 20 80 93881 sh 19 20 80 93883 bat 19 20 80 93891 less 19 20 80 104296 fish 19 20 80 106185 ps 19 20 80

Did you know that `ps` has 3 different priorities that have the same column name in the output?

07.02.2025 07:03 πŸ‘ 1 πŸ” 0 πŸ’¬ 1 πŸ“Œ 0
NoNewPrivs:     0
Seccomp:        0
Seccomp_filters:        0
Speculation_Store_Bypass:       vulnerable
Cpus_allowed:   00000001
Cpus_allowed_list:      0
Mems_allowed:   1
Mems_allowed_list:      0
voluntary_ctxt_switches:        150
nonvoluntary_ctxt_switches:     545

NoNewPrivs: 0 Seccomp: 0 Seccomp_filters: 0 Speculation_Store_Bypass: vulnerable Cpus_allowed: 00000001 Cpus_allowed_list: 0 Mems_allowed: 1 Mems_allowed_list: 0 voluntary_ctxt_switches: 150 nonvoluntary_ctxt_switches: 545

Don't you just love how `/proc/pid/status` has CamelCase, Capital_snake_case, Camel_Snake_Case, and snake_case fields

07.02.2025 00:33 πŸ‘ 1 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0

The security fix for CVE-2018-1124, CVE-2018-1126, CVE-2018-1125, CVE-2018-1123, and CVE-2018-1122 has included the change that if the string is longer than 15 bytes you will not find the command name as it does not fit.

The security fix for CVE-2018-1124, CVE-2018-1126, CVE-2018-1125, CVE-2018-1123, and CVE-2018-1122 has included the change that if the string is longer than 15 bytes you will not find the command name as it does not fit.

ah C, you never fail to impress me

05.02.2025 21:54 πŸ‘ 0 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0

The equivalent to `ps j` with only unix syntax is:

ps -Nt - -u $(ps -eo user= | sort -u | grep -v "^$(whoami)$" | paste -sd, -) -o ppid,pid,pgid,sid,tty,tpgid,stat,uid,time,command

Which says "get every process that is NOT 'all processes that do not have a terminal and whose user isn't me'".

05.02.2025 16:41 πŸ‘ 0 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0

The `ps` command from procps-ng has so many options, all in different styles, all that may or may not clash with one another it's kinda funny.

For example, you can't get the same output as `ps j` (without using BSD syntax) without multiple commands.

05.02.2025 16:41 πŸ‘ 0 πŸ” 0 πŸ’¬ 1 πŸ“Œ 0

today I realized I lost one of my blog posts

I forgot to migrate it when I redid my site, and thought I was losing it when I couldn't find it on my website...had to dig through the old codebase to find it

02.02.2025 01:59 πŸ‘ 2 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0
EOF Is and Is Not a Character It depends on the context.

New post! This time it's about EOF and the many things it is and isn't: kosalab.dev/posts/eof-is...

29.01.2025 17:49 πŸ‘ 0 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0

w3schools has done it

they've ruined their only useful page, www.w3schools.com/cssref/css_s... by splitting the content into multiple different pages

22.01.2025 02:52 πŸ‘ 0 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0

Somewhat miffed I can't style `::before::selection` because `::selection` does not apply to other pseudo-elements

10.01.2025 06:08 πŸ‘ 0 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0

Unfortunately it did not play nice with Svelte 5, so I ended up making my own. Thanks for the suggestion though!

10.01.2025 06:07 πŸ‘ 0 πŸ” 0 πŸ’¬ 1 πŸ“Œ 0

Mobile app idea: power-user alarm

I want alarm groups
I want to be able to say "set an alarm every 10 minutes between 7am and 8am"

06.01.2025 05:37 πŸ‘ 0 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0