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
11 votes
4 answers
1k views

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 ...
Super Tux's user avatar
  • 313
8 votes
1 answer
618 views

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
61 views

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
478 views

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
237 views

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
  • 370
2 votes
1 answer
69 views

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
293 views

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) + ...
MaxiMaxi's user avatar
  • 177
7 votes
3 answers
1k views

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
195 views

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
154 views

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
3 votes
0 answers
116 views

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
5 votes
1 answer
109 views

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
0 votes
1 answer
104 views

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
201 views

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
257 views

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
4 votes
3 answers
858 views

strscpy() is similar to the standard strncpy() except that it always writes a valid null-terminated string (unless ...
ismbks's user avatar
  • 75
1 vote
1 answer
130 views

I'm creating a program that will hopefully operate like linux terminal (basic commands) for learning purposes. ...
depperm's user avatar
  • 1,117
3 votes
2 answers
214 views

...
my_stack_exchange_account's user avatar
5 votes
1 answer
363 views

I've written a wrapper for the mmap syscall. It's quite limited in functionality at the moment (there are lots of flags to support) but it's sufficient for mapping ...
haz's user avatar
  • 255
5 votes
3 answers
826 views

Recently I wrote my own implementation of a utility for recursive output of the directories' contents, kind of similar to the ls Linux utility with the ...
andylvua's user avatar
  • 215
4 votes
1 answer
81 views

As a continuation of this question, I would like a second review from you. Here is the updated sh script: ...
Tobias Grothe's user avatar
4 votes
1 answer
504 views

I've implemented a small single-header library over the C++20 coroutines. This library only works on a single thread and it is limited to Linux because it is also based on epoll. The library does not ...
Pangi's user avatar
  • 370
5 votes
2 answers
450 views

In try to replicate the outcome of the following command sequence using php: netstat -rn | grep "^0.0.0.0 " | cut -d " " -f10 I did this using ...
Dimitrios Desyllas's user avatar
4 votes
2 answers
357 views

I wrote a small LKM that opens the /proc/cpuinfo file, reads it line by line, and attempts to the cpu model name. If the function fails to extract the cpu model ...
766F6964's user avatar
  • 901
3 votes
1 answer
438 views

The expected behavior of the script is to download a file from a URL if the file is not present in the current directory and compare the md5 checksum of the file against the md5 checksum from the ...
Chris Stone's user avatar
0 votes
0 answers
38 views

The complete script works as expected. I am able to download and verify the files. If the file is all ready present verification is retested and downloads if necessary. I'm in the process of teaching ...
Chris Stone's user avatar
2 votes
2 answers
168 views

I wrote a simple script to set permissions for a file or folder for some embedded Linux devices as part of a larger setup script. This method would be called on less than 20 files and folders. It ...
netcat's user avatar
  • 203
5 votes
1 answer
190 views

This is an ongoing project that has undergone a major update to speed up list processing. Here is the homepage for anyone interested. It processes lists defined in ...
T145's user avatar
  • 3,159
4 votes
1 answer
50 views

I'm currently working on a project and currently have this code. I already improved it by having some pointers, but I want to make it more professional looking and right. What should I implement next? ...
user avatar
2 votes
1 answer
192 views

I wrote a bash script that installs Arch Linux. I wanted to simplify the installation of the Arch Linux system by automating things like setting locale, hostname, networking, etc. This is my second ...
whiteman808's user avatar
2 votes
0 answers
83 views

The project is named winlin; it's a portmanteau of the words window and Linux. I'm working on a CPython extension to interact with the X server and manipulate windows. I don't have a ton of ...
gnarlyninja's user avatar
5 votes
1 answer
197 views

I've written a bash script that creates a root filesystem on ZFS for installing Debian or Arch. The purpose of this script is to make it easier installing e.g. Arch without the need to make a ZFS pool ...
whiteman808's user avatar
5 votes
2 answers
678 views

By analogy with std::thread, I've written an RAII POSIX process: ...
jezza's user avatar
  • 205
3 votes
2 answers
105 views

I'm working on a script that will archive, compress, clear old archive files, then remove the source file if it is below a set size. The output when I tested it worked, but I just wanted a second ...
Brad Barnes's user avatar
4 votes
3 answers
512 views

Is this code well written? I'm not doing much, just rendering my battery status for my status bar but the code seems pretty long. I am new to Bash and Linux, so I thought this code could be improved ...
Diwas's user avatar
  • 111
2 votes
1 answer
288 views

This post is a second part of my original post, Add two huge base-10 numbers, which deals with adding two huge base-10 numbers. However, in this case, I'm multiplying two non-negative whole numbers. ...
avighnac's user avatar
  • 331
3 votes
1 answer
58 views

DmenuWacom During my raids, I came across and solved several problems, obviously in my style, very similar to the suckless.org approach and which still works quite well. In fact, I started writing a ...
NFVblog's user avatar
  • 61
5 votes
1 answer
207 views

pacdef is my declarative package manager for Arch Linux. I have written it since I often found myself discovering a new tool at one of my PCs, using it there for a ...
sarema's user avatar
  • 499
5 votes
1 answer
198 views

This is some assembly code I've written to add two base-10 numbers. The input and output are represented as null-terminated ASCII strings, with digits in big-endian order. I have also provided ...
avighnac's user avatar
  • 331
11 votes
3 answers
2k views

I want to remove leading zeroes (for a big integer library I'm currently making) in numbers represented as char arrays. I chose assembly for speed, but in order to simplify making the algorithm and ...
avighnac's user avatar
  • 331
3 votes
1 answer
271 views

So this is a follow up questions to Find proceses listening on the network outside of default package manager I managed to make it a little faster thanks to using ...
N3buchadnezzar's user avatar
4 votes
2 answers
402 views

I have been tinkering with a script that should list things that are listening on the network, but are not part of the base packaging manager. Currently I have only done support for fedora and debian ...
N3buchadnezzar's user avatar
5 votes
1 answer
780 views

My goal is to have a timer function that operates from the bash linux command line. I am looking for review and feedback. Printing the expected number of characters (dots, dashes, or bars) is nice-...
Steve T's user avatar
  • 183
2 votes
1 answer
160 views

The following logic provides iteration over /proc/<PID>/maps for a Linux process. What I'm primarily (though not solely) interested in for this review is ...
Daniel Walker's user avatar
5 votes
1 answer
481 views

...
legale's user avatar
  • 151
2 votes
1 answer
215 views

Preface Please review my implementation of a job queue for linux/unix systems. This is my first time coding in C, although I have quite some experience in C++. I know this is a moderate amount of loc, ...
infinitezero's user avatar
  • 1,112
4 votes
1 answer
146 views

I have a use case where I need to check, whether / is mounted read-only. Here's the module where I implemented this check: ...
user avatar

1
2 3 4 5
12