As of May 31, 2023, we have updated our Code of Conduct.

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
1 vote
1 answer
33 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
24 views

For loop to download files once and verify them on each invocation

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

Linux Script Set Permission Function

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
  • 193
2 votes
0 answers
102 views

Processing large blocklists with GNU Parallel

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,045
2 votes
1 answer
27 views

Improving Shell Installation Script

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? ...
Nicholas Winberg's user avatar
2 votes
1 answer
71 views

Bash script that installs Arch Linux

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 ...
lester's user avatar
  • 171
2 votes
0 answers
49 views

a C/Python X server interface extension package

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
3 votes
1 answer
60 views

Creating ZFS-based rootfs for installing Linux in Bash

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 ...
lester's user avatar
  • 171
5 votes
2 answers
594 views

RAII POSIX process created by fork

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

Archive, compress, remove old archive file then remove source file if below set size

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

A shell script to get the current battery status

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 ...
Diwas10's user avatar
  • 111
2 votes
1 answer
89 views

Multiply two huge base-10 numbers in assembly

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
  • 309
3 votes
1 answer
42 views

DmenuWacom: a front hand for wacom tablets

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

declarative package manager for Arch Linux

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
  • 449
4 votes
1 answer
125 views

Add two huge base-10 numbers

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
  • 309
11 votes
3 answers
1k views

Remove leading zeroes from the beginning of a string

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
  • 309
3 votes
1 answer
238 views

Find proceses listening on the network outside of default package manager v2

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

Find proceses listening on the network outside of default package manager

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

Bash script simple countdown timer with dotted output

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
  • 83
2 votes
1 answer
68 views

Iterate over a process' maps file

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
4 votes
1 answer
199 views

Linux netlink kernel socket arp cache getter (similar to ip ne)

...
legale's user avatar
  • 141
2 votes
1 answer
95 views

Priority Job/Task Queue for Linux (sockets and multithreading)

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
4 votes
1 answer
48 views

Mount point API for Linux systems

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

Simple networking framework in C++

Question: What do you think about this design and the implementation? This is a simple networking framework for IPv4, IPv6 TCP client and TCP server for Linux and MS-Windows in C++14. It uses a single-...
Andre Adrian's user avatar
3 votes
1 answer
99 views

Simple networking framework in C

Question: What do you think about this design and the implementation? This is a simple networking framework for IPv4, IPv6 TCP client and TCP server for Linux and MS-Windows in C. It uses a single-...
Andre Adrian's user avatar
2 votes
2 answers
2k views

touch command in C

I wrote a program in C that simulates the touch command from linux. I would like to ask you to criticize my implementation, to find bugs in particular ...
Mark's user avatar
  • 449
3 votes
1 answer
88 views

System V signal API using the standard POSIX API

I wrote a program that implements a POSIX signal API. It implements the functions sigset(), sighold(), ...
Lorand's user avatar
  • 31
2 votes
2 answers
125 views

nice utility in C

I implemented the nice linux command. How can I improve the program? In terms of optimization, error handling, bugs and possible undefined behaviors ...
Mark's user avatar
  • 449
4 votes
1 answer
68 views

improved "tee" utility

We have modified the tee program with your suggestions from the previous pull request. Did I implement well? I would like to optimize the program even more, what ...
Mike's user avatar
  • 299
1 vote
1 answer
71 views

daemon in a producer-consumer

The daemon program is associated with a message queue with a predefined key, to be blocked later when waiting for messages. The two programs implement a producer-...
Mike's user avatar
  • 299
2 votes
1 answer
62 views

Changing the attributes of a file

I wrote a program that changes the attributes of a file. How can I make the program more efficient? Please find program problems. How can I improve the program? ...
Dave's user avatar
  • 51
3 votes
2 answers
517 views

Implementation of the "tee" utility program

How can I optimize the program? To make it more optimal? The program should be more optimal in terms of source code, compiled executable size, memory usage, speed, bugs etc. Please criticize the ...
Mike's user avatar
  • 299
2 votes
2 answers
125 views

another attempt to implement the tee command

I implemented the tee command from linux. The program implements the -a option Reads standard input until end-of-file, write a ...
Mike's user avatar
  • 299
3 votes
1 answer
55 views

display processes children

The following program uses a parent program to determine the PIDs of multiple child processes. A function is called to return them to a dynamic vector (with the children's pids, but also the elements ...
Mike's user avatar
  • 299
3 votes
3 answers
116 views

tee: copy standard input to both stdout and a file

I implemented the tee command from linux. The program also handles the -a option for adding text to the end of a file if it ...
Mike's user avatar
  • 299
3 votes
2 answers
96 views

change file attributes on a Linux file system with chattr

I am reading the book The Linux Programming Interface and I have reached the exercise in which the implementation of the chattr command in C is required. I would ...
Dave's user avatar
  • 51
2 votes
1 answer
167 views

implementation of the `mkdir` command with `-p` parameter in C

I wrote a program that implements the mkdir command with the -p parameter to create the parent directly if it does not exist. My ...
Mark's user avatar
  • 449
1 vote
1 answer
20 views

seq with range:

Is there a simpler way to get this result? Also what is the syntax in fish for adding numbers to an array index before executing the lookup? ...
jaksco's user avatar
  • 113
0 votes
0 answers
119 views

Modifying a Linux touch driver to poll I2C data instead of using interrupts

I managed to modify the st1232.c touch driver to poll I2C data from the touch controller, instead of using interrupts. This way I don't need an extra interrupt wire. On the other side I am now using ...
arminb's user avatar
  • 101
2 votes
1 answer
195 views

Base64 encoder in Assembly x86-64 Linux language

We were asked to create a Base64 encoder for Assembly x86-64 on Linux. Was wondering how my code below could be improved, be it notation or anything else. We only had Assembly for 3 months so I'm not ...
Ryukyu's user avatar
  • 123
3 votes
0 answers
124 views

Single-threaded coroutine in C (Linux x86-64)

Background Story I crafted a simple single-threaded coroutine in C, running on Linux x86-64. Short Technical Explanation 1) Task There are two types of tasks in this implementation. Main task. This ...
Ammar Faizi's user avatar
1 vote
2 answers
62 views

Retrieve Logs from Multiple Containers on Remote Server

Recently I had the requirement to allow multiple containers of the same application to be run on a single development server. This requirement drastically changed how we retrieve logs over SSH from ...
Brendan Lesniak's user avatar
2 votes
2 answers
73 views

A Python script to install a number of useful programs and packages on a fresh Linux-based device

I work with Linux-based devices, and, both at work and in my personal life, it's necessary to wipe these devices every so often - sometimes as frequently as multiple times per week. In this context, ...
Tom Hosker's user avatar
0 votes
1 answer
192 views

How do I make my program that creates RSA keys and encrypts and decrypts a file more secure

...
The Masked Rebel's user avatar
1 vote
1 answer
82 views

simple code that tries to establish tcp handshake. Creating tun device | what ever ip packets message comes try sending valid response.checksum&TCP

So I am getting packets from TUN interface and after that processing the packet, and then try to send correct TCP handshake response message. It does handle sequence and ack sequence handling but That ...
user786's user avatar
  • 145
4 votes
1 answer
73 views

Recursively Copy Dotfiles from Git Repo to New System's Home Directory

I manage my dotfiles in a github repo. The idea would be that I could clone the repo if I ever have to develop on a new system and symlink them to the home ...
Jordan Mandel's user avatar
4 votes
1 answer
572 views

Implementing a pipe-like program without wait?

So I implemented a program that takes an input file, two command strings and an output file to mimick the behaviour of running : ...
cassepipe's user avatar
  • 143
1 vote
2 answers
80 views

Simple server to host simple website page with css

I have created a simple server that host html that has css. Please make sure if ur testing then change the paths relative to ur system in listhell.c in respond_main(..) function. The html file has to ...
user786's user avatar
  • 145
1 vote
2 answers
80 views

Editing system files in Linux (as root) with GUI and CLI text editors #3

One year and a half ago I posted the second iteration of this script for a review here: Editing system files in Linux (as root) with GUI and CLI text editors #2 Since then, it has been "...
Vlastimil Burián's user avatar
1 vote
1 answer
232 views

Server hosting single page site using TCP sockets in C

I have written a simple server to host my page and CSS (CSS file is 22KB). Using sockets and TCP. Can any one please review it and give feedback on how can I make my server reliable using TCP and ...
user786's user avatar
  • 145

1
2 3 4 5
12