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).
562
questions
3
votes
1
answer
213
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 ...
4
votes
3
answers
713
views
Implementing strscpy(): Is using errno as a negative return value a bad practice?
strscpy() is similar to the standard strncpy() except that it always writes a valid null-terminated string (unless ...
1
vote
1
answer
93
views
Linux terminal like parsing
I'm creating a program that will hopefully operate like linux terminal (basic commands) for learning purposes.
...
8
votes
4
answers
980
views
2
votes
2
answers
124
views
6
votes
1
answer
289
views
A simple mmap(2) wrapper
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 ...
-1
votes
1
answer
39
views
5
votes
3
answers
798
views
Implementation of recursive `ls` utility
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 ...
2
votes
1
answer
45
views
Debian and Docker compose upgrade script, 2nd version
As a continuation of this question, I would like a second review from you.
Here is the updated sh script:
...
4
votes
1
answer
429
views
Single threaded epoll based coroutine library for C++, Linux
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 ...
5
votes
2
answers
406
views
Parsing gateway ip from `/proc/net/route` in a docker container
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 ...
0
votes
0
answers
105
views
Ansible role for installing and configuring SSH service
This is the Ansible role that installs and configures SSH service. What do you think about it? Is there something to improve? Thanks
defaults/main.yml
...
4
votes
2
answers
304
views
LKM: Extract cpu model name from /proc/cpuinfo
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 ...
2
votes
1
answer
400
views
Shell script to download multiple files from different URL's using for loop to download and verify files on each invocation
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 ...
1
vote
0
answers
30
views
For loop to download files once and verify them on each invocation [duplicate]
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 ...