Questions tagged [linux]

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

Filter by
Sorted by
Tagged with
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
0answers
85 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
74 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
58 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. ...
2
votes
2answers
83 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
44 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
36 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
109 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
66 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 : ...
12
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 ...
7
votes
1answer
79 views

Prompt user to choose from menu

The following code simply prompts the user to choose from a menu, and then it displays the choice made by that user. It only accepts input consisting of a single digit between 1 and 6, inclusive. ...
0
votes
1answer
56 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 ...
2
votes
1answer
50 views

*nix, *bsd, etc basic `tput` color setup

My goal with the below piece of POSIX shell code was to address the more platforms the better with shell tput colors. With this code, I now start all of my scripts, ...
5
votes
0answers
38 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 ...
2
votes
1answer
37 views

List files based on changes

I am new to programming and need input on how I could've written something better. Not coding on daily basis. The task was to write a script in python, bash or anything. So I mixed python with bash ...
2
votes
0answers
51 views

Ansible to automate dev environment setup

This is a follow-up to Bash script to automate dev environment setup. In that question I'd thrown together a (sloppy) shell script to automatically setup my development environment. One of the answers ...
2
votes
1answer
38 views

Compile a string into a callable object in C++: a simple JIT based on system, dlopen and dlsym

Today I discovered that it is possible to dynamically load code at runtime via dlopen and dlsym (and similar utilities on ...
8
votes
2answers
517 views

Bash script to automate dev environment setup

After blowing up my environment again messing around with installing random programs and packages I decided to write a bash script I can clone from github and use to reinstall everything like I had ...
2
votes
2answers
79 views

Exponentiation by squaring in x64 Linux Assembly

I am learning some assembly for a compiler project I am working on and I have come across the Exponentiation by Squaring algorithm when it came to calculating x ^ n. To get a grasp on how the ...
3
votes
1answer
32 views

Linux: Raku script to open files from terminal and ask for deletion

Raku script to open files from terminal with xdg-open and, with del option, asks for deletion. Happy to receive Raku syntax improvements. Thanks! ...
3
votes
1answer
26 views

Bash script for automating HPC calculations

I'm a chemistry student working on a simple bash script to automate HPC density functional theory calculations using Quantum Espresso (pw.x). I am very much a novice at shell scripting and would ...
3
votes
1answer
233 views

Simple input and output in assembly x86_64

I am new assembly programming in Linux (x86_64) and I want to make sure that I am programing in a correct way. I wrote a program that just takes an input from the user and then writes his input to ...
5
votes
2answers
229 views

c++ shell for linux

...
2
votes
1answer
37 views

Bash script wallpaper randomizer

I thought it would be fun to write a simple and small bash script which randomly chooses a wallpaper from a given directory of a set of wallpaper images. The code is as follows. ...
1
vote
1answer
90 views

Getting 6000+ substrings from large a large string

I have a class that opens a text file and reads out its content. This class has a member function that will extract a substring between two given delimiters. My application needs to extract between ...
7
votes
1answer
110 views

Powershell script to verify Linux-generated md5sum file

I'm moving some files from a Linux machine to a Windows machine over a low-speed, possibly buggy experimental communications channel that I want to test. One of the tests is to transfer large numbers ...
2
votes
1answer
29 views

Database playground

This is my very first interaction with databases. The goal is to setup a safe playground on an Arch box to create tables and make queries. I want to learn the basics without risking ...
5
votes
1answer
59 views

Bash Code optimization For ssh login on the remote device

I have below code which works fine as its written in bash, i am just posting it here to see if this can be better optimised as per the BASH way. I am have an ...
5
votes
1answer
213 views

Fishy password management

Problem When it comes to security I like to don a tin foil hat. As such I use the, off-line password manager, Keepass. Keepass allows you to to use multi-factor authentication via; a password, a ...
3
votes
0answers
39 views

Bash script to mirror XWindow to remote SSH host

The source code within this question aims to provide a short-cut for mirroring a local XWindow (or session) to a remote host via SSH port forwarding, such as: ...
1
vote
0answers
40 views

Analog Clock in AEC

I've made a simple terminal-based analog clock for Linux in AEC. Here we go: ...
0
votes
1answer
25 views

Split large log file like a dictionary [closed]

I have a large log file in the following format. Do note that this is already sorted alphabetically. I wish to split it into smaller pieces, and with file names reflecting the content of the file (...
4
votes
2answers
460 views

Implementation of portscanner for a host

I have tried to check whether the ports of a host from port 0 to port 1023 is open or not. Could someone please review this code and provide feedback. ...
3
votes
1answer
67 views

Finding the class to which the IP address belongs

I have tried the code for finding the class of the IP address the user inputs, and printing the network and the host bits in the IP address. Could someone please review this approach and provide ...
1
vote
1answer
27 views

Further optimization of file transfer over FIFO on linux?

For learning purposes I'm writing a very simple mqueue based file transfer server. Below is a thread function that takes care of an incoming request: ...
8
votes
4answers
112 views

Implementation of system() function in Linux using fork() , exec() and waitpid() system calls

I have written the code for implementation of system() function using fork(), exec() and waitpid(). Could someone please review this code and provide feedback. Thanks a lot. ...
4
votes
2answers
47 views

Implementation of cp program that prints the number of bytes copied

I have written the code for implementation of the cp program that prints the number of bytes copied when the user presses Ctrl-C. Could someone please review this code and provide feedback. Thanks a ...
2
votes
1answer
36 views

Reproduce the system() function of linux

My mentor says to reproduce the system() function of Linux exactly as given in the man pages. I have written the below code. Could someone review this code and provide me any suggestions for ...
1
vote
0answers
31 views

Simple header-only thread and mutex for both windows and linux in C

I wanted to get some thread support on windows with very simple headers for a library that I'm working on but it had to work on both Windows and Linux. Since C11 threads are not widely supported, this ...
0
votes
2answers
43 views

Bugs - Program that Creates a Directory in C

I have the following code that creates a directory in C. I tested it multiple times, reviewed it a few times and it looks fine at the moment. What I really wanna know is what bugs does it have and ...
2
votes
1answer
47 views

Reproduce Linux move command in C

I have the following code, made in C language, which reproduces the functionality of the mv (move) command from linux. The problem is that the code is very inefficient. How I can optimize or make the ...
3
votes
0answers
110 views

Linux System Monitor

I made a system monitor on Linux which gives you all this information: The full project can be found in my repo: https://github.com/sandro4912/System-Monitor In short it works as following: I read ...
2
votes
1answer
30 views

The code reads from a specified offset to the specified number of bytes in a file

The code reads the specified number of bytes from a specified offset in a file, I have handled the partial reads and bytes > buf_size conditions. Could anyone review the code? and say whether the ...
-2
votes
1answer
28 views

The code reads the file from the specified offset to the specified number of bytes. How to handle errors of partial reads in reading a file [closed]

I could like to read a file from a specified offset to a certain number of bytes in a file. I would pass the filename, the offset, the number of bytes as an argument. The constraint is should use only ...
8
votes
3answers
2k views

File Automation Using Python On Linux

A project to automate file organization in Linux using Python. I've always wanted to do this project way before I know how to code. Now that I did, I want to improve it even more. Used Language: ...
5
votes
1answer
98 views

An echo program, mostly in C and completely from scratch

This is an echo program with no runtime or standard library. It's meant to be compiled with -nostdlib on an amd64 Linux system. ...
3
votes
0answers
34 views

Merging multiple awk commands while retaining functionality

Turned in a project a few days ago, and I needed a way to filter and format values off a file. I decided to go for a bash script since it seemed like a good option, and I came up with the following: <...
2
votes
1answer
129 views

Parallel download of rpm packages

I use zypper to download and install for openSUSE Tumbleweed (much like everyone else of course). Unfortunately it downloads packages serially, and having about a thousand packages to update a week, ...
2
votes
2answers
571 views

Get pixel color from screen in C++ on Linux

For a long period of time I worked on this code, mostly trying to understand it. That is the main reason for needed review. Second reason is simply that I would like to optimize it in any way you can ...
0
votes
1answer
67 views

bad GNU libc argp code [closed]

In helpcovid git commit e27dd3b123c18300665 we have a stupid bug related to Linux GNU glibc argp program argument parsing. <...

1
2 3 4 5
10