All Questions
38 questions
3
votes
1
answer
48
views
Debian and Docker compose upgrade script, 2nd version
As a continuation of this question, I would like a second review from you.
Here is the updated sh script:
...
2
votes
1
answer
407
views
Shell script to download multiple files from different URL's using for loop to download and verify files on each invocation
The expected behavior of the script is to download a file from a URL if the file is not present in the current directory and compare the md5 checksum of the file against the md5 checksum from the ...
1
vote
0
answers
33
views
For loop to download files once and verify them on each invocation [duplicate]
The complete script works as expected. I am able to download and verify the files. If the file is all ready present verification is retested and downloads if necessary.
I'm in the process of teaching ...
2
votes
2
answers
126
views
Linux Script Set Permission Function
I wrote a simple script to set permissions for a file or folder for some embedded Linux devices as part of a larger setup script.
This method would be called on less than 20 files and folders. It ...
1
vote
2
answers
103
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 "...
5
votes
1
answer
243
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 ...
6
votes
3
answers
778
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
1
answer
63
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
1
answer
52
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.
...
4
votes
1
answer
125
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 ...
4
votes
2
answers
139
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, ...
1
vote
2
answers
152
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
votes
0
answers
79
views
Code to backup the history file in Linux [closed]
How is the logic, efficiency and can it be improved?
This is a snippet from my .bashrc file; I just wrote it and I've tested it and it almost works. This was the ...
1
vote
1
answer
139
views
Bash Code to backup the history file in Linux [closed]
How is the logic, efficiency and can it be improved?
This is a snippet from my .bashrc file, I just wrote it.
The code is supposed to do this:
Backup my ...
2
votes
1
answer
132
views
Editing system files in Linux (as root) with GUI and CLI text editors
My intention is to POSIX-ly write one generalized function for running various text editors I use for different purposes through sudoedit, i.e. editing files as ...
4
votes
1
answer
61
views
Is device mounted? Both UUID and device names accepted
I am trying to write an is_device_mounted script, which in turn will serve a greater purpose in my home Linux system.
It does not even have an error reporting ...
2
votes
2
answers
53
views
POSIX-ly finding a specific Java process
In this code I find a list all of the running java processes and give the below function a name to look for, it will do its best. But since I find my approach a ...
2
votes
1
answer
76
views
Interactive Linux upgrade script - Follow-up #1
One year ago I asked for a yearly revision of my Interactive Linux upgrade script.
There is nothing new to the conditions, therefore please read the original question before you decide to comment and ...
1
vote
1
answer
51
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 ...
1
vote
1
answer
68
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 ...
3
votes
2
answers
520
views
Generic error handler function for POSIX shell scripts
Intention
I came with the idea of generic, portable, highly reliable, and further customizable function for Shell scripts, written in POSIX, for error handling.
Purpose
The function shall find out, ...
1
vote
2
answers
197
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 ...
8
votes
1
answer
114
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, ...
6
votes
3
answers
264
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
1
answer
166
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 ...
1
vote
1
answer
162
views
Shell POSIX OpenSSL file decryption script follow-up #1
This question is the first follow-up of: Shell POSIX OpenSSL file decryption script
Please read it before you continue reading this. Thank you.
I only have one new problem solved and I would like ...
6
votes
1
answer
913
views
Shell POSIX OpenSSL file decryption script
Tonight, I tried to write a Bash OpenSSL file decryption script. Encryption script will follow in highly similar manner, so I think it's not necessary now.
Let's suppose we have an encrypted large ...
3
votes
1
answer
80
views
Query database and check server details
I have written bash script to query database and check server details.
Please let me know if the script is as per best standards:
...
5
votes
1
answer
139
views
trash script to alias rm
This script implements a command line level trashcan system.
Designed to work around rm doing the bits needed to implement a trashcan system at command line level....
2
votes
2
answers
50
views
High CPU utilisation for Logs Manager shell script
I have written a shell script to manage the tcpdump pcap logs and syslog files in my Linux board, so as to maintain the disk usage to maximum of 70%.
The script checks for the disk usage every ...
5
votes
1
answer
58
views
Script to record an inventory of a backup
This is a script designed to make an inventory file which records the
contents of a directory allowing verification that a backup has the
same data. The same script can also
A full github repo is ...
1
vote
1
answer
278
views
Disable reboot on control-alt-delete for RedHat/CentOS 5/6/7
As root, run:
...
1
vote
1
answer
124
views
Sh script to reduce version number in opkg status file
I have written a script to reduce/lower the version number stored in opkg status file using small shell script, This will enable us to force the opkg to install same version of a Debian package again.
...
6
votes
2
answers
97
views
An installer for shell scripts, written in pure sh
I wrote a tiny shell script that basically installs a script into your system by copying it to someplace like /usr/local/bin, chmodding it, and adding it to your ...
2
votes
2
answers
116
views
Split redirecting to multiple files in bash
A function mycommand which runs command and:
Gives me three log-files which are:
*.stdout.log: everything from ...
4
votes
3
answers
961
views
Bash script that checks if font is installed and installs it if necessary
This checks if a font is installed by using fc-list and grep. If the particular font is not installed, it offers to install it ...
3
votes
1
answer
1k
views
Bash script that checks for package dependencies and installs them if necessary
I'm new to writing bash scripts and was wondering if I could get someone's advice on a part of the script I'm working on.
Intended purpose of code
Check if a package exists using ...
6
votes
3
answers
2k
views
Check disk space against a threshold
The below script is one I made to check the disk space on mounted partitions under Debian Wheezy. I tried adding a -d switch to force printing out the used data, ...