Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [linux]

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

0
votes
1answer
20 views

Shell POSIX OpenSSL file decryption script follow-up #3 (final)

From original very simplistic code: Shell POSIX OpenSSL file decryption script I learned a lot both from the first follow-up review, and the second one as well, many thanks! I just need one final ...
2
votes
0answers
14 views

Shutdown or reboot system from LAN

I've written a simple web service which allows a user to shutdown or reboot a system from the LAN. Although written to be used on an RPI which lacks a power or reset button, it can be used on any ...
2
votes
1answer
62 views

Password encrypting tool

I wrote a tool that takes a domain name and a password, concatenates them, hashes the result with sha512, and returns the result encoded in base64 truncated to 32 characters. The main idea behind this ...
0
votes
1answer
38 views

Shell POSIX OpenSSL file decryption script follow-up #2

This question is the second follow-up of: Shell POSIX OpenSSL file decryption script The first follow-up was: Shell POSIX OpenSSL file decryption script follow-up #1 Both of which have proven very ...
1
vote
2answers
59 views

Bash script to change network interface parameters/configuration and start virtual machines

On my Arch Linux system I have created a script that should do the following on system startup: detect all network interfaces check if physical interfaces are up check if bridge interfaces are up ...
2
votes
0answers
15 views

Ubuntu kernel update and removal automation script

This is my first bigger than a few lines bash script. It automates kernel updating and removing on Ubuntu through ukuu (Ubuntu kernel update utility). I'm not yet ...
1
vote
3answers
105 views

Convert integer to decimal string

I have a need to do some conversions in a loop to display the results using C++98 on Linux, which doesn't have any itoa() to complement ...
4
votes
0answers
34 views

Bash script to send notifications when low on ram

Backstory Recently, we've changed the PCs at my workplace to un Linux Mint. It works amazing, is blazing fast and the adjustment time was very short. However, I noticed my PC would freeze completely,...
1
vote
0answers
20 views

Reducing force unwraps in CLI utility

This is a CLI utility for managing the allocation of investment. It's an exercise, don't take it too seriously. So the utility asks the user a series of questions about it's finances and suggests a ...
8
votes
1answer
109 views

Systemd service configuration helper script

I've written a script that semi-automates the process of configuring/creating a new systemd service. The script is working perfectly well, however, I've had some trouble with the styling and ...
4
votes
1answer
82 views

Bash script to setup new Debian installs

This script is run directly after a fresh install of Debian, to do: sets up syntax highlighting in nano, sets up iptables, sets ...
10
votes
3answers
241 views

Implementation of Linux cp in modern C++

This is my simple implementation of the Unix cp command. It is a C++ program but makes use of some of the lower level C library I/O functions. Any suggestions for ...
3
votes
2answers
116 views

Find duplicate files in Linux

This code finds duplicate files in Linux. I assume that MD5 hash will return unique hash number. What can I improve in this code? ...
1
vote
2answers
41 views

Running shell script as root via external binary

I'm not an experienced Linux user and I wanted an easy way to run shell scripts as root from a PHP script, I came up with this: ...
2
votes
1answer
64 views

Sysinfo parser for a window manager status bar

The program is written mainly for the status bar in dwm (a window manager for Linux), but it can be used for any manager that takes input from the root window in X. It queries different resources in ...
6
votes
2answers
70 views

Interactive bash script to create new permanent swapfiles

I started self-learning Bash scripting yesterday, and I finished my first successful "advance" script. Goal To create an interactive step-by-step script to that allowed customizing various parts of ...
3
votes
1answer
84 views

Function for scanning /proc

I wrote a function, scan_ps(), for scanning /proc, to replace a combination of popen() and <...
2
votes
1answer
40 views

Making a disk usage breakdown

I'm looking for a better way of doing this code I made. I work for tech support and one of the biggest questions I am asked is: "Hey, how did my disk get so full in my VPS?" I am aiming for output ...
7
votes
1answer
192 views

Debian Firefox Quantum update script

I wrote a little script to automate upgrading Firefox to a new version under Debian, since I don't want to install it from unstable and the snap version has ...
1
vote
1answer
42 views

Haskell game server auth: cookie key generate&check

C++ code version (description copied from it) gameKeys id is authentication function of an MMO game server. When someone wants to play with friends, he sends ...
4
votes
2answers
73 views

Game server auth: cookie key generate&check

UPD: Haskell version, please check it too. gameKey(long id) is authentication function of an MMO game server. When someone wants to play with friends, he sends ...
5
votes
1answer
74 views

C application for capturing keyboard shortcuts

I'm writing an application for capturing keyboard shortcuts on Linux, but I don't have a lot of experience with C or the Linux API, so I'm wondering about problems with the code or maybe parts that ...
3
votes
1answer
40 views

Running xinput to change touchpad settings

I am looking for some feedback on the code below, mainly for efficiency or mechanism correctness (like eval vs. subprocess). I am also curious if ...
9
votes
2answers
139 views

Laptop battery level monitor for Linux

I come from a C background and am trying to learn Rust. I wrote my first Rust program, to check the battery level on my laptop and warn me if it's low/critical. It works fine, but I wrote it in a ...
1
vote
2answers
160 views

Long-term archiving + encrypting shell script

Yesterday, I very quickly, in an hour, wrote the very first version of my long-term archiving + encrypting shell script. I am aware it may have too many flaws, but none of them really prevent it from ...
4
votes
1answer
473 views

Python script for monitoring systemd services (cpu/memory usage)

This is a python (2.7.13 according to sys.version) script that reads systemd service names from a file and gets their CPU and Memory usage. It does that by first ...
1
vote
2answers
38 views

chmod all .htaccess files under all website dirs under public_html dir

This is my code to chmod all .htaccess files under all website dirs under public_html dir. The reason I use this code is to make sure WordPress plugins won't "...
1
vote
2answers
68 views

Portable (Linux, Cygwin,…) Makefile for my own Shell OpenSSL file en-/decryption scripts

Let it be clear that in this question I ask for further guidance with my current version of Makefile used for my own Shell OpenSSL file en-/decryption scripts, not ...
5
votes
1answer
445 views

File path unified in Windows/MacOS/Linux

We are all tremendously happy about back slashes in Windows file systems and do not think that their sole purpose is to make life complicated for smart people who are capable of using different OS. ...
3
votes
0answers
42 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 ...
-2
votes
1answer
48 views

7 pass file erasure [closed]

I am an aspiring C++ programmer and I have been programming for a few years off and on but I don't have much usable knowledge. Right now I am working on filesystem safety so I decided to write an ...
6
votes
2answers
99 views

Perl script to set IP settings

This is my first go at a Perl script to (semi-) automate setting the correct IP settings. I use it to configure a virtual machine after creation. It's also my first Perl script as a whole, so I'm ...
6
votes
1answer
305 views

Convert unsigned Integer to ASCII in x86 assembly

This is my best effort to code an x86 32 bits to get an unsigned int (4 bytes) and convert it into a string. My strategy was successively divide the number by ten and fulfill the remainder of the <...
7
votes
1answer
76 views

Squire for your recursive SSH adventures

One day I used to SSH to lots of machines to do some administrative tasks. I constantly used l to list directories just like I do on my own machines. Guess what, ...
7
votes
2answers
169 views

Copy files in parallel by reading what files to copy from few other files

I am working on a little complicated shell script for the first time and this is what it should do: During startup, it figures out what is my clientid by looking ...
5
votes
3answers
96 views

Arch linux installation script to be reviewed for any leakage of personal / security info

While I have been teaching myself a little about linux, it's boot processes and service configuration I have been using arch linux in virtualbox for my experimentation. Eventually after much wiling ...
5
votes
1answer
121 views

Lightshot Print Screen key linux handler - Follow-up #1

This question is a direct follow-up #1 of my previous question: Lightshot Print Screen key linux handler There were too many errors which I didn't see at the moment and I tried hard to fix them up ...
4
votes
0answers
97 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 ...
5
votes
0answers
50 views

Bash completion functions for pmount and pumount

I found a problem with Debian's Bash-completion for pmount and pumount, and intended to send a patch with the bug report - but I ...
8
votes
2answers
145 views

Identify users who have logged in as root

This is a program written in Python 3.x and Bash to check and find any users who have logged in as root via sudo su, sudo -i, ...
8
votes
1answer
106 views

Caesar cipher in i686 assembly + MMX

I have written the following implementation of the Caesar cipher for an old Linux computer with a Pentium MMX chip. The code has been written with the following design goals in mind: the code should ...
4
votes
1answer
229 views

C++ Poll Socket Wrapper Linux

So I created a C++ socket wrapper class using poll and events. The creation of the listening socket and binding is already handled in the initialize() method. I'd ...
4
votes
1answer
105 views

OpenVPN Login Bash Shell script for DD-WRT router

This script is made to run on DD-WRT as I am running an OpenVPN server on it just to securely connect to my home network when I'm on the go. Basically, the input ($1...
4
votes
1answer
157 views

A function that checks if a string subnet mask is valid

I've written a small helper function that receives a string and checks if it translates to a valid subnet mask value (255.255.255.0 for example). I would ...
4
votes
3answers
59 views

Write bootable image to USB device

Recently, I've been making and refining installer and rescue images to boot from USB media, in the form of CD-ROM or hard disk images. After a few occasions where I re-ran the command after removing ...
1
vote
1answer
39 views

Nginx-WordPress conf

This is how I create am Nginx virtual host for a WordPress webapp. I did best to keep it as minimal as I can while having a working webapp. Please review it: ...
7
votes
2answers
197 views

Bash script to temporarily run a shell without certain group memberships

I have here a script called rwog (run without groups) that allow a user to run a shell without particular group memberships. ...
3
votes
0answers
89 views

Implementing binary-heap in x86-64 assembly

I'm trying to implement some of the simplest classical data-structures in x86-64 assembly on linux. PRIMARY GOAL: Reduce memory consumption and increase performance (maybe using x86-64 architecture ...
1
vote
1answer
47 views

Git Autoupdater

At my office we have an internal monitoring tool we use on customer systems to monitor various vitals and notify us via Slack. Our Lead Dev and Chief Architect are very paranoid about Git, and ...
3
votes
1answer
67 views

Create a WordPress site data with Nginx app data automatically

The following script is aimed for Ubuntu >=16.04 LEMP environments with PHP-FPM >=7.0, MySQL, WP-CLI, Certbot, and ...