Questions tagged [linux]

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

Filter by
Sorted by
Tagged with
4
votes
1answer
232 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
2answers
53 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 ...
1
vote
2answers
117 views

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

This is the second iteration of this question A note to start with: the first iteration of this question can be found here: Editing system files in Linux (as root) with GUI and CLI text editors As ...
1
vote
2answers
55 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
vote
1answer
48 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 ...
7
votes
1answer
3k views

Ansible playbook to install application from tarball

I'm doing this, but as I'm the expert here (because no-one else is doing it) I have no real idea how awesome my code actually is. So the code should do the following: Export the tarball from ...
2
votes
1answer
64 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 ...
2
votes
1answer
63 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 ...
0
votes
0answers
16 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: ...
3
votes
1answer
95 views

All core MediaWiki upgrade script (round 2)

The following script upgrades an existing, all core (no add ons) MediaWiki install. I run it with set -x for debugging (I avoid ...
0
votes
1answer
50 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 ...
3
votes
1answer
47 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 ...
3
votes
1answer
111 views

Print a list of disk blocks used by file(s) - Linux

This code takes a list of filenames as arguments or from stdin (or from a provided file) and dumps a list of disk blocks used by those files. An attempt is made to use the linux ...
4
votes
1answer
93 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 ...
0
votes
1answer
51 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 ...
4
votes
1answer
52 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 ...
0
votes
1answer
38 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 ...
4
votes
1answer
46 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 ...
7
votes
2answers
87 views

Utility to edit config files globally

I wrote a small utility in bash that allows me to edit config files anywhere. So, whenever I want to edit a config file, I don't have to type its full path or have to remember where it is. First, I ...
4
votes
1answer
98 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
votes
3answers
89 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 ...
3
votes
2answers
101 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 ...
5
votes
2answers
363 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? ...
4
votes
2answers
179 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 ...
1
vote
2answers
45 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 ...
6
votes
3answers
680 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
votes
0answers
46 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 ...
3
votes
1answer
49 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 ...
3
votes
1answer
57 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 ...
3
votes
1answer
136 views

cron daily and weekly scripts for a minimal Nginx server environment

I've created the following cron for daily and weekly scripts for a minimal Nginx server environment (as part of my larger script). The daily cronjob updates WordPress and brings back original ...
2
votes
0answers
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 ...
0
votes
0answers
6 views

VSFTPD server configuration file

I'm learning to set up systemd file-transfer & related services (samba, ftp, http..). So far it's all LAN or WLAN. The configuration file for most these services is under ...
0
votes
1answer
33 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. ...
3
votes
1answer
53 views

The Blacklist: Blocking Malicious domains using Bash

I've made this script to automate blocking some deviant hosts on my router, and was curious if there's anything much else that can be done to make it quicker and more efficient. Presently I'm ...
0
votes
1answer
56 views

Watch for file changes in Linux

I have installed Geekworm x735 on my Raspberry Pi, it uses the script below with an infinite loop to determine if the power button has been pressed. I know there are some Linux utils that watch for ...
2
votes
3answers
211 views

Efficiently read a file into a (C) string using POSIX APIs

Exactly what the title says, this is a C++ class that attempts to read a file into a null-terminated string as efficiently as possible, using POSIX APIs. Obviously this is not intended to be portable ...
1
vote
1answer
32 views

Rdoc - a command-line tool for launching documents (improved)

A few days ago I posted a previous version of my first bash script here to get few tips and reviews so I could improve it. So now it is improved a bit. I also shellchecked it and fixed the warnings. I ...
0
votes
1answer
81 views

Bash script that helps in opening documents when using terminal

I just finished creating my first bash script that helps me to launch documents from terminal using a pdf viewer. This is very helpful and fast (at least I think so) for people who don't use any files ...
1
vote
1answer
93 views

Bash script for mounting and backing up VeraCrypt volumes

My bash script mounts two VeraCrypt volumes, rsyncs their contents, and dismounts them. The script takes two parameters, the path for both the source and backup veracrypt volumes. I wrote this script ...
5
votes
1answer
774 views

Linux GPIO rotary encoder as volume control

I've written a kernel module (tested on Raspberry Pi) to use a rotary encoder as a volume control. The Linux source tree already contains a driver for rotary encoders so I've just piggybacked off of ...
3
votes
1answer
94 views

UNIX cp multithreaded implementation in C

I recently finished a high school project of mine for a class revolving around creating my own multithreaded implementation of the "cp" terminal command in UNIX systems. I am seeking for ...
0
votes
0answers
40 views

Multiple async wait

I need a review and best practice approach to do something like that: ...
3
votes
1answer
109 views

Bash Script for healthcheck linux

I have below bash script which i have written to check the health of different storage component and then creates an incident through service-now tool. This is script is working fine for me but i ...
0
votes
4answers
96 views

Linux bash script to ignore '$'

Many times I have copy and pasted from a guide that had the following instruction: $ echo "Execute xyz" and would get the error $: command not found So I created a bash script to ignore ...
2
votes
1answer
86 views

Rsync helper in C (Improved)

Last week I posted a previous version of this code. I improved the program and worked on it for a few days and I would love to get reviews, feedback and tips so I could learn more and more from you ...
4
votes
1answer
85 views

rsync helper in C program

Hi guys how you doing?? I just finished creating an rsync helper program that reads its configuration file using a program that I also created and it deletes some ...
1
vote
1answer
34 views

Utilizing idle socket server to do meaningful thing (timeout after sleep on epoll_wait)

I write an app server that uses TCP socket on Linux. When there is no traffic (no data is sent by client, no client connect() or ...
4
votes
2answers
940 views

Securing my password wallet

I am currently learning C++, so I made this basic password wallet for Ubuntu. Its source code is in the /opt directory and it has a symlink so i can launch it from ...
4
votes
2answers
137 views

C++ TcpServer class

I have a class Tcp_Server that implements a TCP server. This is the base class for the other types of servers available in my program. For example ...
0
votes
1answer
78 views

Compare script using awk and bash

I try to create compare script using awk and another command and running successful. But I think the script I create it's to long. Is there anyone can shorten my script below ? After plan A ...

1
2 3 4 5
11