Questions tagged [linux]
Use this tag for code that specifically targets the Linux operating system (consider [unix] for more portable code that should run on other Unix-like systems).
574 questions
7 votes
3 answers
861 views
Bash Backup script for password DB
Can you please comment on the script below? It backs up my local password database to a remote repository if a change is detected. It works as intended. I'd like some comments in terms of syntax, ...
11 votes
4 answers
1k views
A simple server-client application in C
I am reading "The Linux Programming Interface" by Michael Kerrisk. I'm studying about sockets, and I made a simple application using sockets on the unix domain. I want to know if I'm using ...
8 votes
1 answer
621 views
Shared-Memory Queue Implementation in C
Recently I am working on implementing a shared-memory based IPC message queue in C programming language on Linux system. A few design choices I've made include The queue will have only 1 producer, ...
3 votes
0 answers
62 views
library variant during application startup
I wrote some PoC for load library with best optimization version during application startup. The goal for it check in the _init function code checking by cpuid ...
8 votes
2 answers
483 views
Disabling local accounts on Azure Linux virtual machines
We’re enforcing Azure Entra authentication across all Linux VMs, so we’ll disable all local accounts via a custom script. The script will also create a single “break-glass” user with a randomly ...
2 votes
1 answer
242 views
CoLib - A C++ Coroutine Library in a Single Header
I've developed a coroutine library for C++ that is contained within a single header file. It is compatible with both Windows and Linux platforms. This library is not multi-threaded; instead, it is ...
2 votes
1 answer
74 views
NodeJS discord bot that starts systemd services
I am writing a discord bot that can start and stop my minecraft server. It currently works, but I am still learning NodeJS and I could use some tips on how to optimize my code. Calling a command will ...
4 votes
3 answers
304 views
Calculation of consumed resources by subprocess
I've created a script that executes arbitrary user code in Python, written in a .py file, and returns execution result (contents of stdout, stderr, exec code) + ...
7 votes
3 answers
1k views
C++ code reading from a text file, storing value in int, and outputting properly rounded float
Late important updates (unified) I found, that on my Pi's Debian 12 Bookworm (arm64), there is just an older g++-12 available. ...
3 votes
1 answer
199 views
How to refactor this (sort of) getline implementation?
Goals: Create a function char *get_next_line(int fd) such as: Repeated calls (e.g., using a loop) to your get_next_line() ...
5 votes
2 answers
159 views
Bash Script for Docker Image Cleanup
I’ve been working on a bash script to clean up old Docker images while keeping the latest tag for each repository and skipping images currently in use. I’m sharing the script below and would ...
3 votes
0 answers
118 views
MIDI router in Rust
I am working on a small MIDI router application for the Jack audio connection kit in Rust. The goal of the application is to route MIDI signals from an instrument to one or multiple applications in ...
5 votes
1 answer
111 views
Re-implementing head in x86-64 assembly targeting linux
I'm pretty new to x64 programming and tried to recreate parts of head for study (targeting linux). Are there any stylistic issues? The head function uses a buffer ...
0 votes
1 answer
104 views
Rust code to print shell prompt
I'm new to Rust, and this is my first successful significant Rust code. It prints a prompt(which is technically a string) to the console. I'm struggling with concepts like ...