# Questions tagged [linux]

Linux is a free (libre), open source, Unix-like operating system.

535 questions
Filter by
Sorted by
Tagged with
1 vote
59 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-...
67 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-...
239 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 ...
• 449
49 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(), ...
• 21
103 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 ...
• 449
61 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 ...
• 199
1 vote
53 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-...
• 199
20 views

### pending signals using the sigpending() function

I used the sigpending () function in the next program to check the signals waiting at 1s intervals and display their numbers, then it ends with ...
• 21
42 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? ...
• 51
452 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 ...
• 199
112 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 ...
• 199
51 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 ...
• 199
96 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 ...
• 199
59 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 ...
• 51
110 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 ...
• 449
1 vote
17 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? ...
• 113
38 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 ...
• 101
60 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 ...
• 123
73 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 ...
• 143
1 vote
19 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 ...
63 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, ...
• 373
49 views

...
1 vote
44 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 ...
• 145
48 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 ...
371 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 : ...
1 vote
71 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 ...
• 145
1 vote
70 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 "...
• 1,690
1 vote
61 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 ...
• 145
91 views

As I was writing, I realized I have multiple classes polling for file descriptors in its own thread - lots of duplicate code like, synchronization, creating array of pollfds etc. I've decided to ...
• 214
332 views

### Python script to automate the creation of Linux LXC containers

Like the title suggests, I wrote a script in Python that uses the python3-lxc library to automate the creation of Linux LXC containers. I realised that containers ...
• 79
18 views

### Where and how can I speed up this config-driven ezstream script?

I've put together this script to check through various location and pick the next media file to play on an internet radio station: ...
• 101
57 views

### Uncompress files, with autodetection of algorithm

Hi Everyone, this is my first bash script ever. I would really appreciate it if you could provide me with some comments and insights regarding correct function use, logic implementation, and a lead to ...
• 1
56 views

### remote file follow using python

I've created an on-demand class that can be initiated to collected any new data written to file from start_recording call until ...
• 153
170 views

### Converting IDN domains to Punycode in Perl

Description This script takes any domain input from STDIN and converts unicode domains into punycode. Features Any domains that throw an error get ignored. When fed any ASCII domains, they just pass ...
• 2,897
58 views

### Usart Network driver

I wrote a network driver and I would like a review of my code. The code generally works, albeit with some performance issues. The purpose of my code is to have a Network driver that uses the USART and ...
• 43
53 views

### shimming the c open function on linux and logging its usage

I'm currently trying to implement a c shim which sits between the open function from the c standard library and a program. the shim should transparently write all file paths being opened to a log ...
• 103
56 views

### Extracting domains and IPs from Exodus trackers JSON report

The following command series is used to gather every bit of valuable information from Exodus trackers. The ultimate goal would be to get this all into one jq ...
• 2,897
372 views

### Bash partitioning script

What can I improve in this script? Do I read user's yes/no answers by right way? Should I write bash scripts so that to be compatible with POSIX? ...
138 views

### Generating a domain and IP blacklist with Bash

This is a project to pull domain & IP blacklists from various sources and compile them into one list. There are some whitelists included that are applied when a blacklist is built. It draws ...
• 2,897
111 views

### A file system watcher class for on-fly file reloading when it has been modified

I wrote a file sytem watcher class that is used to monitor file modification and then execute user-defined handler. Other file system events like moving or deleting don't need to be monitored. The ...
• 385
106 views

### Possible improvements to window swallowing program?

I have written a small program that swallows windows. It works in X.org using the xcb library. This is my first rust program but I have lots of other programming experience. Any general improvements ...
1 vote
63 views

### Installing packages if they don't exist in Bash

This script simply installs the chosen packages if they're not present on a Linux system using the apt package manager. Notes on improvements of any aspect are ...
• 2,897
699 views

### Updating text in a HTML document with Bash

This is a small script to update my project's README file. Notes on improvements from any aspect are welcome! Here is the document it updates. readme.sh (Executed like so: ./readme.sh) ...
• 2,897
206 views

### Linux backup script written in bash for tar

This is my first attempt at scripting with bash. I am running Ubuntu server, so I don't get to use all the gui back ups out there. Besides, tar works fine for personal use. Please let me know of any ...
• 195
119 views

### Writing a tail command clone

I'm reading Bruce Molay's book on Unix programming, and as an exercise I've implemented a copy of the tail command. My approach goes over the entire file once, to ...
• 133
60 views

### The Blacklist v2

This script gathers domains listed from sources in this JSON file and compiles them into one text file. Text files that have a similar key under the whitelists ...
• 2,897
1 vote
141 views

### Bash script (to be used as a login MOTD message) that displays status of docker-compose projects, and individual docker containers

This is for a cheap VPS I use for personal projects. I like having a message of the day displaying system info on login; I wanted to add the status of my docker containers to it, to see if all are ...
• 371
67 views

### Parse log file and send the result to an API

The task is to get the most recent login time of the day for each user. Then send such a result to an API. The log file (file.log) looks like the following (only ...
• 5,487
29 views

### The Blacklist -- Follow-Up 2: Electric Boogaloo

One of my main goals regarding this script has been to figure out a way to use the "adblock.sources" file available on its main repository and not my fork. That version has some syntax ...
• 2,897