Skip to main content

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).

Filter by
Sorted by
Tagged with
6 votes
1 answer
80 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, ...
Yukun Jiang's user avatar
3 votes
0 answers
40 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 ...
Jakub Juszczakiewicz's user avatar
8 votes
2 answers
454 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 ...
Dev's user avatar
  • 81
2 votes
1 answer
178 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 ...
Pangi's user avatar
  • 178
2 votes
1 answer
42 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 ...
LitWaffle's user avatar
4 votes
3 answers
256 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) + ...
Max Azatian's user avatar
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. ...
Vlastimil Burián's user avatar
3 votes
1 answer
172 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() ...
ismbks's user avatar
  • 75
5 votes
2 answers
120 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 ...
Ilgar's user avatar
  • 51
2 votes
0 answers
96 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 ...
Green 绿色's user avatar
6 votes
2 answers
737 views

Bash script to create a Termux sandbox nested in an extant Termux environment suitable for script and package installation testing

...
Beauford A. Stenberg's user avatar
5 votes
1 answer
94 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 ...
Knogger's user avatar
  • 359
1 vote
1 answer
75 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 ...
candifloss__'s user avatar
6 votes
1 answer
185 views

Function for listing processes holding a specified file open

The function's prototype is: int processes_using(const char *name, pid_t pidlist[], int size) It searches through all processes it can to find any that have an ...
jenkins's user avatar
  • 63
3 votes
1 answer
233 views

An example of hello world LKM

In 2021 I spent a lot of time studying low-level in Linux, as I'm a low-level addict in general, I only now decided to change my area to introduce myself to the market, and I wrote a repository on ...
Bruno Ciccarino's user avatar

15 30 50 per page
1
2 3 4 5
39