r/programming • u/Polixa12 • 6h ago
Relaying wakeups in fair locks
kusoroadeolu.github.ioThis was pretty fun for me to write up on. Would love to hear y'all's thoughts on scheduling bottlenecks in fair locks.
r/programming • u/Polixa12 • 6h ago
This was pretty fun for me to write up on. Would love to hear y'all's thoughts on scheduling bottlenecks in fair locks.
r/programming • u/CircumspectCapybara • 20h ago
r/programming • u/Old-Illustrator-8692 • 22h ago
r/programming • u/Nuoji • 17h ago
r/programming • u/philip_schwarz • 5h ago
r/programming • u/jacobs-tech-tavern • 1d ago
r/programming • u/CircumspectCapybara • 1d ago
r/programming • u/KrzysztofLopuchDev • 5h ago
Admin panels with a terminal and a restart button are a big attack surface. If the web app can run docker commands, then anyone who takes over the web app can run them too. Here is a design that keeps the convenience and shrinks that risk. I used it for an internal panel on a single-node Docker Swarm.
1. The panel only reads. The Docker socket is mounted read only, and the panel only sends GET requests (services, tasks, nodes, logs). Metrics come from cgroup v2 and pg_stat_* through a monitoring role. Neither the database role nor the RabbitMQ account can change anything.
2. Actions are requests, not commands. "Restart", "scale to 0" or "prune" doesn't call Docker. The panel writes a small JSON request file to one directory. That directory is the only thing the panel can write to. A systemd unit on the host picks the file up, checks it against its own rules and runs it. The host has its own copy of the limits (max replicas, protected services such as SSO, the reverse proxy and the panel itself), and the host's copy wins. A compromised panel can ask for something, but it can't force it.
3. Risky actions need intent, not just a click. Scaling to 0 and prune require typing the service name. Every action is logged with who asked for it and what the host answered.
4. The browser terminal is treated as the most dangerous feature.
prompt=login.5. Monitoring without a metrics stack. For one server, Prometheus + Grafana + exporters is more to run than what it watches. Instead, a small agent (.deb) samples disk, CPU, RAM and containers every minute into PostgreSQL and deletes data older than 7 days. Alerts are plain SQL over those samples: disk ≥ 80% with hysteresis back at 78%, and CPU only when every minute of the last 10 was ≥ 95%, so short spikes don't page you.
What I'd keep in any similar tool: split "who wants" from "who does". The web app asks, and a separate process with its own config decides. It costs one directory and one systemd unit, and it removes a whole class of "web app → root on the host" bugs.
r/programming • u/fagnerbrack • 1d ago
r/programming • u/fagnerbrack • 1d ago
r/programming • u/BrewedDoritos • 1d ago
r/programming • u/wito-dev • 21h ago
r/programming • u/CircumspectCapybara • 2d ago
r/programming • u/swithek • 3d ago
My goal at the beginning was to write a short list of projects that are good for a first contribution, because I have a few friends who want to get into the open source world and are looking for resources like this. However, most guides I found recommend Next.js, React, Kubernetes or other similarly popular and complex projects and I wasn't sure that was good advice, so I got sidetracked and counted how PRs are treated there. The headline example is that Next.js has 1,553 open PRs that nobody has reviewed in over a month (I have added the queries and scripts I used to count them at the end of the article).
If you're interested about my actual list, you can still find it in the article (in the second half of it): I picked six projects in rust, go, java and python that are less popular than Next.js but review PRs from first-time contributors fairly quickly. I counted their PRs/issues as well and added the stats to each entry
r/programming • u/I_highly_doubt_that_ • 3d ago
r/programming • u/lpmi-13 • 3d ago
After reading the phenomenal article https://kapteko.com/15-million-webservers/, where the author shows how to do some very cool stuff inside one Linux VM with 10GB of RAM, I thought it would be cool to actually see it happen myself.
So I put together a tutorial in a custom iximiuz Labs playground to see it in action.
Feel free to play along as you read the article (which is excellent, btw...short and sweet with just the right amount of technical details).
r/programming • u/Mastbubbles • 1d ago
I've had my share of swear words, usually every time I missed a semicolon. And that sent me down a rabbit hole: what about everyone else? What do other programmers write when the code fights back?
So we pulled every comment out of 64 big projects on GitHub. That's 295,820 comments. Then we went through them and asked one question about each: wh
r/programming • u/Old-Illustrator-8692 • 1d ago