Questions tagged [linux]

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

Filter by
Sorted by
Tagged with
0
votes
0answers
3 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 "...
-2
votes
0answers
15 views

Creating an order system for customers [closed]

I am having a little trouble with my order system. I believe that the approach that I am taking is all wrong. Basically I am trying to create an order system that allows customers to pick out a pizza ...
1
vote
1answer
36 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 ...
2
votes
1answer
61 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
50 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
14 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: ...
0
votes
1answer
48 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 ...
4
votes
1answer
84 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 ...
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
36 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
45 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 ...
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
1answer
96 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
87 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
97 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
2answers
41 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
675 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) ...
4
votes
2answers
175 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 ...
3
votes
1answer
47 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 ...
2
votes
0answers
45 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 ...
0
votes
1answer
45 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 ...
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 ...
3
votes
1answer
56 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 ...
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
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
51 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
54 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 ...
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
79 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 ...
2
votes
3answers
210 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
76 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 ...
0
votes
0answers
40 views

Multiple async wait

I need a review and best practice approach to do something like that: ...
3
votes
1answer
104 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
75 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
84 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
125 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
0answers
10 views

Windows Like Security Screen for Linux (mockup)

Ubuntu and other Linux variants do not have a Windows like CTRL + ALT + DEL screen, so I figured I'll make one myself. My plan is to make a HTML version, render ...
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 ...
3
votes
1answer
93 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 ...
3
votes
1answer
144 views

Secure socket programming with OpenSSL and C

Background Lately, I found OpenSSL to be difficult to learn as a beginner, while it can be implemented inside beginner-friendly projects like socket programming. ...
1
vote
2answers
134 views

Persist keyboard backlight color on Linux laptop

System76 sells laptops that come preloaded with their Ubuntu spinoff Pop_OS. The laptop keyboards have backlights that can change color and brightness, but so far I haven't found any way to keep the ...
3
votes
1answer
65 views

Bash script to install zsh on different distributions

Extreme script newbie here, so please go easy on me! I wrote a script to install zsh on a number of different Linux distributions. But since I'm so new at this, I'm piecing a lot of different things ...
1
vote
1answer
53 views

Python3 conditionally moving files and string formatting

I have written the below code while helping one of the colleague over the SO and this code working as desired, but I feel there may be some improvement specially on the string formatting syntax's ...
6
votes
1answer
172 views

Timer application using GTK

Purpose The code is for a timer with a starting time of 25 minutes. The goal is to have a very simple pomodoro application with Start, Pause and Reset. Also you can tick a box to make the UI stay in ...
4
votes
1answer
193 views

Get signal name from signal number

I am trying to get a signal name to print when getting a signal number. I actually have : ...
11
votes
2answers
1k views

Wi-fi scheduler written in C

I'm new to C and programming in general (some minimal prior exposure to JS and python). This is also my first time working with shell commands, scripts, and cron. This program works on my macOS and ...

1
2 3 4 5
11