programming.dev

9,536 readers
325 users here now

Welcome Programmers!

programming.dev is a collection of programming communities and other topics relevant to software engineers, hackers, roboticists, hardware and software enthusiasts, and more.

The site is primarily english with some communities in other languages. We are connected to many other sites using the activitypub protocol that you can view posts from in the "all" tab while the "local" tab shows posts on our site.


🔗 Site with links to all relevant programming.dev sites

🟩 Not a fan of the default UI? We have alternate frontends we host that you can view the same content from

ℹ️ We have a wiki site that communities can host documents on


⚖️ All users are expected to follow our Code of Conduct and the other various documents on our legal site

❤️ The site is run by a team of volunteers. If youre interested in donating to help fund things such as server costs you can do so here

💬 We have a microblog site aimed towards programmers available at https://bytes.programming.dev

🛠️ We have a forgejo instance for hosting git repositories relating to our site and the fediverse. If you have a project that relates and follows our Code of Conduct feel free to host it there and if you have ideas for things to improve our sites feel free to create issues in the relevant repositories. To go along with the instance we also have a site for sharing small code snippets that might be too small for their own repository.

🌲 We have a discord server and a matrix space for chatting with other members of the community. These are bridged to each other (so you can interact with people using matrix from discord and vice versa.

Fediseer


founded 2 years ago
ADMINS

Broken communities have been fixed, report any issues to ategon

1
 
 
2
 
 
3
265
Version Control (lemmy.blahaj.zone)
submitted 12 hours ago by [email protected] to c/programmer_humor
 
 
4
2
Day 13 - Users and Groups (linuxupskillchallenge.org)
submitted 9 minutes ago by livialima to c/linuxupskillchallenge
5
6
 
 

I would like a TrayTip that one of my scripts puts out to open the same, specific file when clicked, but I see nothing about this in the documentation.

While I'm at it, is there a way to change the height of the tray tip?

7
8
 
 

I dunno if this is appropriate for this community, so mods, please delete if not.

I have been writing a screen clone in rust.

https://github.com/cameroncros/PoorMansScreen/tree/better_screen (The main branch is how I currently use it, not at all screen-like, the better_screen branch is much closer to a screen replacement.)

It all currently works fine, albeit quite simple, and I suspect not following best practices. Please talk shit about my code so I can fix that :D

For my next stage of development, I would like to use some combo of vt100 and ratatui to wrap the shell in a border, or add a menu bar at the top or bottom to make it clear when the user is inside a "screen". Does anyone have any thoughts on how to go about doing that? I am very unskilled at ratatui.

9
12
Copyleft GDExtension? (lemmy.kde.social)
submitted 12 hours ago* (last edited 12 hours ago) by [email protected] to c/godot
 
 

So, I started working on a new project, and I'm thinking of how to license it. Specifically, how to make it as copyleft as possible without making it unusable.

By unusable I mean the license blocking the game (or in a more likely case, any later project that reuses the code) from being published on platforms like Steam. I know that steamshim exists, but I'm not sure if that can be a real solution. Linking against the SDK seems completely optional in Steam's case, but license compatibility is listed as a hard requirement regardless.

The game code consists entirely of a GDExtension written in Rust, so I think I can just neatly LGPL the GDExtension "library" without restricting the game executable itself. It sounds like it should work, but there are some things that I'm not sure of, like hardcoded references to assets.

I really don't enjoy thinking licenses so I usually slap on either GPL or something permissive and be done with it. Anyone notice any holes in my plan, or am I good to go?

I know I can use my own code however I please, but it gets more difficult once there are multiple people involved; I've had one person express vague interest so far.

Thanks.

10
11
 
 

cross-posted from: https://sopuli.xyz/post/22778737

I'm still figuring out the details but I have a working prototype and it uses (somewhat) accurate sail physics.

12
12
GNU awk idioms explained (learnbyexample.github.io)
submitted 8 hours ago by [email protected] to c/linux
13
 
 

I'm still figuring out the details but I have a working prototype and it uses (somewhat) accurate sail physics.

14
 
 

Hector Martin (Marcan42) was the lead developer of Asahi Linux, until he recently resigned. He had a Mastodon page where he would talk about AL development and hardware stuff, as well as frustrations dealing with kernel maintainers to upstream things like Rust stuff (long before the beef that went down this month).

Marcan has made it clear he needs a break, but I really wish he at least kept his Mastodon page up, perhaps in read-only. I'll admit, I liked his posts so much I looked at it daily. I had a bookmark keyword in Firefox: I'd type tr in the URL bar to go to https://social.treehouse.systems/@marcan.

15
16
17
18
19
20
 
 

The University of Pennsylvania offers a free series of books called Software Foundations with the following description:

The Software Foundations series is a broad introduction to the mathematical underpinnings of reliable software.

The principal novelty of the series is that every detail is one hundred percent formalized and machine-checked: the entire text of each volume, including the exercises, is literally a "proof script" for the Coq proof assistant.

The series includes Verifiable C, which seems very appealing as a way to avoid some of C's infamous "footguns." I haven't read the series myself, but I might in the future because I like math, logic & programs that do what they're supposed to do.

Are there any materials that would be good as alternatives or complements to this series?

Edit: Adding the Vercors Wiki to the resources in this thread

21
 
 

I'm rebuilding my home server in nixos.

Rather that configuring the various services natively in nixos, I decided to run containers via virtualisation.oci-containers whenever possible, mostly to be able to independently update the system and the various services.

Everything is going smoothly, but whenever I (for whatever reason) do nixos-rebuild boot and reboot after adding a container instead of nixos-rebuild switch, I run into this issue where podman isn't able to resolve the host (below you see the docker hub host, but it also happened with ghcr.io):

podman-apprise-start[1352]: Trying to pull docker.io/caronc/apprise:1.1.8...
podman-apprise-start[1352]: Pulling image //caronc/apprise:1.1.8 inside systemd: setting pull timeout to 5m0s
podman-apprise-start[1352]: Error: initializing source docker://caronc/apprise:1.1.8: pinging container registry registry-1.docker.io: Get "https://registry-1.docker.io/v2/": dial tcp: lookup registry-1.docker.io: no such host

I thought that my podman-* services were missing a dependency on network-online and that they were started before the network was available, but it is't the case:

# systemctl list-dependencies podman-apprise.service 
podman-apprise.service
● ├─system.slice
● ├─network-online.target
● │ └─systemd-networkd-wait-online.service
● └─sysinit.target
●   ├─dev-hugepages.mount
[...snip...]

Do you happen to know what the issue is?

PS: Manually running systemctl start podman-whatever once fixes the issue, of course, but I wonder if there's a more robust solution?


update:

After investigating based on balsoft input below, the issue seems to be that systemd-networkd-wait-online doesn't behave as expected (by me).

Basically, systemd-networkd-wait-online waits for network interfaces to have a carrier (working ethernet cable) and an IP address. This is what in systemd-networkd docs is called the "degraded" state (no, it doesn't mean that something got worse than before... don't think too much of what "degraded" implies in English).

In my case, I have an interface that is setup via DHCP and that also has static IPs assigned:

$ cat /etc/systemd/network/00-lan1.network 
[Match]
Name=lan1

[Network]
DHCP=ipv4
IPv6AcceptRA=no
LinkLocalAddressing=no

[Address]
Address=192.168.10.10/24

[Address]
Address=192.168.10.99/24

If you are wondering, the reason I do this is that I want static IPs for my dns server and reverse proxy, but I also want my home server to use DHCP to fetch some network-wide configuration which, critically, includes the default route.

Back to the issue: IIUC, since the interface has a non-link-local address (which systemd-networkd confusingly calls a "routable" address), it is immediately considered "routable" (a state that is moar better than "degraded") and so not only it's basically ignored by the default systemd-networkd-wait-online configuration, but even adding

[Link]
RequiredForOnline=routable

to /etc/systemd/network/00-lan1.network doesn't make a difference whatsoever.

For now, my stopgap solution is to explicitly set the default route for the "lan1" network:

[Network]
Gateway=192.168.10.1

this seems to solve the issue with podman and, while the system still thinks to be "online" before being fully configured, it will suffice until I find a more elegant/robust way (ping me in a while if you are interested).

refs:
systemd-networkd-wait-online man page
systemd-networkd docs on "RequiredForOnline"
networkctl man page

22
22
submitted 18 hours ago* (last edited 18 hours ago) by [email protected] to c/linux
 
 

Limine 9.0 is out today as the newest major release for this open-source modern multi-protocol bootloader and boot manager. Limine also boasts its own Limine Boot Protocol in addition to the native Linux support and chainloading/multiboot capabilities.

One change that will surprise some readers is Limine 9.0 doing away with EXT4 file-system support as well as older EXT2 and EXT3 support. The change-log notes of dropping the EXT4 file-system support:

23
 
 

There's no perhaps about the FBI and CISA getting snippy at buffer overflows. These people worry about exploits that threaten car-crash incidents in enterprise IT, and they've seen enough to get angry. It's not that making mistakes is a crime when writing code. No human endeavor worth doing is without error. It's more that this class of bug is avoidable, and has been for decades, yet it pours out of big tech like woodworm from a church pew. Enough already, they say. They are right.

24
 
 

cross-posted from: https://lemm.ee/post/55921070

25
view more: next ›