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

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 ...
Bruno Ciccarino's user avatar
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 ...
ismbks's user avatar
  • 43
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. ...
depperm's user avatar
  • 937
8 votes
4 answers
980 views

Remove all text files with non-US-ASCII text encoding from current folder on Linux

...
FAQ's user avatar
  • 183
2 votes
2 answers
124 views

A print function which works with /NODEFAULTLIB

...
my_stack_exchange_account's user avatar
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 ...
haz's user avatar
  • 265
-1 votes
1 answer
39 views

how to boost my script in fault tolerance ,performance and readability [closed]

...
xwj's user avatar
  • 9
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 ...
andylvua's user avatar
  • 215
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: ...
Tobias Grothe's user avatar
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 ...
Pangi's user avatar
  • 154
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 ...
Dimitrios Desyllas's user avatar
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 ...
whiteman808's user avatar
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 ...
766F6964's user avatar
  • 901
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 ...
Chris Stone's user avatar
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 ...
Chris Stone's user avatar

15 30 50 per page
1
2 3 4 5
38