Questions tagged [linux]

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

Filter by
Sorted by
Tagged with
1 vote
1 answer
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-...
user avatar
3 votes
1 answer
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-...
user avatar
2 votes
2 answers
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 ...
user avatar
  • 449
2 votes
1 answer
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(), ...
user avatar
  • 21
2 votes
2 answers
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 ...
user avatar
  • 449
4 votes
1 answer
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 ...
user avatar
  • 199
1 vote
1 answer
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-...
user avatar
  • 199
0 votes
0 answers
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 ...
user avatar
  • 21
2 votes
1 answer
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? ...
user avatar
  • 51
3 votes
2 answers
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 ...
user avatar
  • 199
2 votes
2 answers
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 ...
user avatar
  • 199
3 votes
1 answer
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 ...
user avatar
  • 199
3 votes
3 answers
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 ...
user avatar
  • 199
3 votes
2 answers
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 ...
user avatar
  • 51
2 votes
1 answer
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 ...
user avatar
  • 449
1 vote
1 answer
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? ...
user avatar
  • 113
0 votes
0 answers
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 ...
user avatar
  • 101
2 votes
1 answer
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 ...
user avatar
  • 123
3 votes
0 answers
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 ...
user avatar
1 vote
2 answers
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 ...
user avatar
2 votes
2 answers
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, ...
user avatar
0 votes
1 answer
49 views

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

...
user avatar
1 vote
1 answer
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 ...
user avatar
  • 145
4 votes
1 answer
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 ...
user avatar
4 votes
1 answer
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 : ...
user avatar
1 vote
2 answers
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 ...
user avatar
  • 145
1 vote
2 answers
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 "...
user avatar
1 vote
1 answer
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 ...
user avatar
  • 145
2 votes
1 answer
91 views

Polling FDs in a helper thread, dynamically adding/removing the descriptors

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 ...
user avatar
  • 214
2 votes
1 answer
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 ...
user avatar
  • 79
0 votes
0 answers
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: ...
user avatar
  • 101
0 votes
1 answer
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 ...
user avatar
  • 1
3 votes
1 answer
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 ...
user avatar
  • 153
5 votes
1 answer
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 ...
user avatar
  • 2,897
4 votes
1 answer
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 ...
user avatar
  • 43
0 votes
1 answer
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 ...
user avatar
4 votes
1 answer
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 ...
user avatar
  • 2,897
5 votes
2 answers
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? ...
user avatar
4 votes
1 answer
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 ...
user avatar
  • 2,897
2 votes
3 answers
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 ...
user avatar
  • 385
3 votes
2 answers
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 ...
user avatar
1 vote
2 answers
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 ...
user avatar
  • 2,897
6 votes
3 answers
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) ...
user avatar
  • 2,897
4 votes
2 answers
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 ...
user avatar
  • 195
3 votes
1 answer
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 ...
user avatar
  • 133
2 votes
0 answers
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 ...
user avatar
  • 2,897
1 vote
2 answers
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 ...
user avatar
  • 371
3 votes
1 answer
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 ...
user avatar
  • 5,487
2 votes
0 answers
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 ...
user avatar
  • 2,897
0 votes
1 answer
34 views

The Blacklist - follow-up

Follow-up from this question using @Toby Speight's answer: The primary concern is jq improvement/optimization, but please detail any others. ...
user avatar
  • 2,897

1
2 3 4 5
11