how to bash noscript output to vim
So I created a custom bash noscript echos some question to read input from user for configuration purpose and later echo $(pwd)/filename.sh. When the noscript outputs the path + filename, I would like to open vim with the output. I tried pipe the output to vim input, but somehow the bash noscript doesn't appear to echoing anything to read input. Anyone wanna give me some idea how and why? For now, my assumption is that when noscript is executed where both echo and read is operated, echo is redirected to vim (which why any echo from noscript doesn't show output on terminal) and read waits for my input. If I can redirect the echo back to the terminal, then the expression works as expected. But I do not know how. Maybe I need to use either `>` or `>>` to redirect `echo` output to shell?
`$ noscript-gen.sh | xargs vim # failed`
https://redd.it/1czta63
@r_bash
So I created a custom bash noscript echos some question to read input from user for configuration purpose and later echo $(pwd)/filename.sh. When the noscript outputs the path + filename, I would like to open vim with the output. I tried pipe the output to vim input, but somehow the bash noscript doesn't appear to echoing anything to read input. Anyone wanna give me some idea how and why? For now, my assumption is that when noscript is executed where both echo and read is operated, echo is redirected to vim (which why any echo from noscript doesn't show output on terminal) and read waits for my input. If I can redirect the echo back to the terminal, then the expression works as expected. But I do not know how. Maybe I need to use either `>` or `>>` to redirect `echo` output to shell?
`$ noscript-gen.sh | xargs vim # failed`
https://redd.it/1czta63
@r_bash
Image Conversion Bash Script
# Image Conversion Script
## Overview
This noscript provides a comprehensive solution for converting image files between various formats using ImageMagick and FFmpeg. It supports a wide range of input and output formats, including PNG, JPG, WEBP, JFIF, ICO, TIFF, BMP, and GIF. The noscript is designed to be efficient, easy to use, and versatile, catering to the needs of users who require reliable image format conversion.
## Target Audience
This noscript is intended for:
- Developers and IT professionals who need to batch convert image files as part of their workflow.
- Graphic designers and content creators who frequently work with different image formats.
- System administrators looking for a robust solution to automate image conversion tasks.
- Any user who requires a straightforward, command-line based method to convert image files.
## Features
- Multiple Input and Output Formats: Supports PNG, JPG, WEBP, JFIF, ICO, TIFF, BMP, and GIF formats for both input and output.
- Batch Processing: Converts multiple files in a directory, saving time and effort.
- Output Directory: Stores all converted files in an
- Dependency Check: Verifies the presence of necessary dependencies (ImageMagick and FFmpeg) before execution.
- Interactive Deletion: Offers an option to delete the original files after conversion.
## Usage
To use the noscript, follow these steps:
1. Ensure Dependencies: Make sure ImageMagick and FFmpeg are installed on your system.
2. Run the Script: Execute the noscript in the directory containing your image files.
3. Select Output Formats: When prompted, enter the desired output formats (comma-separated, e.g., jpg,png,ico).
4. Conversion: The noscript will convert the files and store the output in the
5. Optional Deletion: Choose whether to delete the original files after conversion.
## Why This Script?
This noscript stands out due to its:
- Versatility: Unlike many other noscripts that support limited formats, this noscript accommodates a broad range of image file types, making it a one-stop solution for various conversion needs.
- User-Friendly Design: With clear prompts and organized output, the noscript ensures a smooth user experience.
- Batch Processing Capability: It efficiently handles multiple files, streamlining the conversion process and enhancing productivity.
- Professional and Robust Approach: The noscript includes thorough checks and error handling, ensuring reliability and robustness in diverse environments.
## Conclusion
This image conversion noscript is a powerful tool designed for users who need a reliable and versatile solution for converting image files between various formats. Its wide range of supported formats, ease of use, and efficient batch processing make it an essential utility for developers, designers, and system administrators alike.
## Download the noscript
You can download the noscript here on my GitHub page.
https://redd.it/1d08ada
@r_bash
# Image Conversion Script
## Overview
This noscript provides a comprehensive solution for converting image files between various formats using ImageMagick and FFmpeg. It supports a wide range of input and output formats, including PNG, JPG, WEBP, JFIF, ICO, TIFF, BMP, and GIF. The noscript is designed to be efficient, easy to use, and versatile, catering to the needs of users who require reliable image format conversion.
## Target Audience
This noscript is intended for:
- Developers and IT professionals who need to batch convert image files as part of their workflow.
- Graphic designers and content creators who frequently work with different image formats.
- System administrators looking for a robust solution to automate image conversion tasks.
- Any user who requires a straightforward, command-line based method to convert image files.
## Features
- Multiple Input and Output Formats: Supports PNG, JPG, WEBP, JFIF, ICO, TIFF, BMP, and GIF formats for both input and output.
- Batch Processing: Converts multiple files in a directory, saving time and effort.
- Output Directory: Stores all converted files in an
output directory within the noscript's directory, ensuring a clean and organized workspace.- Dependency Check: Verifies the presence of necessary dependencies (ImageMagick and FFmpeg) before execution.
- Interactive Deletion: Offers an option to delete the original files after conversion.
## Usage
To use the noscript, follow these steps:
1. Ensure Dependencies: Make sure ImageMagick and FFmpeg are installed on your system.
2. Run the Script: Execute the noscript in the directory containing your image files.
3. Select Output Formats: When prompted, enter the desired output formats (comma-separated, e.g., jpg,png,ico).
4. Conversion: The noscript will convert the files and store the output in the
output directory.5. Optional Deletion: Choose whether to delete the original files after conversion.
## Why This Script?
This noscript stands out due to its:
- Versatility: Unlike many other noscripts that support limited formats, this noscript accommodates a broad range of image file types, making it a one-stop solution for various conversion needs.
- User-Friendly Design: With clear prompts and organized output, the noscript ensures a smooth user experience.
- Batch Processing Capability: It efficiently handles multiple files, streamlining the conversion process and enhancing productivity.
- Professional and Robust Approach: The noscript includes thorough checks and error handling, ensuring reliability and robustness in diverse environments.
## Conclusion
This image conversion noscript is a powerful tool designed for users who need a reliable and versatile solution for converting image files between various formats. Its wide range of supported formats, ease of use, and efficient batch processing make it an essential utility for developers, designers, and system administrators alike.
## Download the noscript
You can download the noscript here on my GitHub page.
https://redd.it/1d08ada
@r_bash
GitHub
noscript-repo/Bash/Installer Scripts/ImageMagick/noscripts/master-converter.sh at main · slyfox1186/noscript-repo
My personal noscript repository with multiple languages supported. AHK v1+v2 | BASH | BATCH | JSON | POWERSHELL | POWERSHELL | PYTHON | WINDOWS REGISTRY | XML - slyfox1186/noscript-repo
GOTCHA: The arithmetic form that can kill your noscript
Q: Why use
On the surface, they both do the same thing (decrement
However, there's an additional wrinkle to the arithmetic command form that can interact unexpectedly with
>
>The
Which is why this noscript:
#!/usr/bin/env bash
errexit() {
printf "ERROR: %s:%s\n" "${BASHSOURCE1}" "${BASHLINENO[0]}"
exit 1
}
trap errexit ERR
set -e
a=1
a=$((a-1))
echo "a=$a"
a=1
((--a))
echo "a=$a"
outputs this:
a=0
ERROR: test-arith.sh:14
and why your
If you insist on using
...
set +e
((...)) # avoid abend on 0
set -e
...
The assignment form is more typing in general, but fewer WTFs (unless you typo'd the assigned name).
https://redd.it/1d09n3b
@r_bash
Q: Why use
a=$((a-1)) when you can say ((--a))?On the surface, they both do the same thing (decrement
a), but the latter saves quite a few characters with long variable names, and saves you from a frustrating debugging session if you typo the name on the LHS of the assignment.However, there's an additional wrinkle to the arithmetic command form that can interact unexpectedly with
set -e, that the assignment form never triggers. It crops up when a=1, and is documented in *The Fine (bash) Manual*:>
((expression))>The
expression is evaluated according to the rules described below under ARITHMETIC EVALUATION. If the value of the expression is non-zero, the return status is 0; otherwise the return status is 1.Which is why this noscript:
#!/usr/bin/env bash
errexit() {
printf "ERROR: %s:%s\n" "${BASHSOURCE1}" "${BASHLINENO[0]}"
exit 1
}
trap errexit ERR
set -e
a=1
a=$((a-1))
echo "a=$a"
a=1
((--a))
echo "a=$a"
outputs this:
a=0
ERROR: test-arith.sh:14
and why your
set -e noscript may be failing almost at random, when evaluating seemingly-innocent math.If you insist on using
set -e across all your noscripts, you really want to NOT use the ((...)) form except where the return status is ignored (see the set -e documentation for details on that), or if you're absolutely sure that the expression in the form never evaluates to 0, or if you're willing to do something like this:...
set +e
((...)) # avoid abend on 0
set -e
...
The assignment form is more typing in general, but fewer WTFs (unless you typo'd the assigned name).
https://redd.it/1d09n3b
@r_bash
Reddit
From the bash community on Reddit
Explore this post and more from the bash community
bracketed-paste doesnt work sometimes. Anyone has this problem?
I have
> bind -v | grep paste
set enable-bracketed-paste on
but it does not always work! Sometimes when I paste a command with a trailing newline into my terminal, it runs right away. But if I paste it once more right away, it does not run, just like it should with bracketed-paste enabled.
Any idea would could be wrong? It is bash 5.1.16 in ubuntu 22.04. The terminal is konsole.
---
I recall using the feature since ubuntu 18.04 (enabled with
https://redd.it/1d0da66
@r_bash
I have
bracketed-paste enabled:> bind -v | grep paste
set enable-bracketed-paste on
but it does not always work! Sometimes when I paste a command with a trailing newline into my terminal, it runs right away. But if I paste it once more right away, it does not run, just like it should with bracketed-paste enabled.
Any idea would could be wrong? It is bash 5.1.16 in ubuntu 22.04. The terminal is konsole.
---
I recall using the feature since ubuntu 18.04 (enabled with
.inputrc). It never failed for me in ubuntu 18.04 (bash 4.4) and 20.04 (bash 5.0).https://redd.it/1d0da66
@r_bash
Reddit
From the bash community on Reddit
Explore this post and more from the bash community
Clean up FF bookmarks file.
I don't know if any you have ever seen the disgraceful steaming pile of shit garbage html that firefox shits out when you ask it to export your bookmarks, but it is truly a right and goodly fucked up mess.
Have any of ya'll ever heard of or seen a noscript or something to clean that garbage file up into something resembling sensible?
Example...
> <DT><A HREF="https://moviesjoy.to/" ADD_DATE="1681307349" LAST_MODIFIED="1681307349" ICON_URI="fake-favicon-uri:https://moviesjoy.to/"
I don't know if any you have ever seen the disgraceful steaming pile of shit garbage html that firefox shits out when you ask it to export your bookmarks, but it is truly a right and goodly fucked up mess.
Have any of ya'll ever heard of or seen a noscript or something to clean that garbage file up into something resembling sensible?
Example...
> <DT><A HREF="https://moviesjoy.to/" ADD_DATE="1681307349" LAST_MODIFIED="1681307349" ICON_URI="fake-favicon-uri:https://moviesjoy.to/"
ICON=
"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA25pVFh0WE1MOmNvbS5hZG9iZS54b
XAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlI
FhNUCBDb3JlIDUuNi1jMTM4IDc5LjE1OTgyNCwgMjAxNi8wOS8xNC0wMTowOTowMSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZ
i1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG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ZEZDCRBZKTGFUkQTSTjSm0l94V9t3cN5sybiL0HvuTe16mTqpRGec6xyCx8yhvwzNldDsOhZZJnIKFe49NJgqRXHSNJ0I7l2GxRjYoLpw1tFl3KW7V6Lv7+/lSUnM1V3Zt3UrVSRXkWlX2C1BDOQNv+OYePqL+AmOgBCA6KUVVxweTZ9l+JWcVlYndBG53xskYnoSx7fu2X7+DCT8VOXV91TQUOHFpv251CVbmwMBsrV/+VZIS2zeI09qHb5GrZ3eL0M5Np2oF8fDrj8UcWI6prsmoXt9Evu6GRVwK3L3HDUQq3HZosjytl8d37PsHXWxd1xHIAXWCcqqwLKJ1dZEngBkVDBz0H652jEBbSXS0JRqAwx+Bsgdet/YO/pkC/RyivOIXsI+tQULinI5inCwNJ8q/uewG61XMlbu9Gv3j7zGhhhH5js/Q2Zv4DlnmjlaFZhNbfhsxTnmbqYh3OhdRCPkloy23E/CaZpxZXAKCNfk2RdZuoA+VhnMwTXAWAtmto+8CIIld5CzJO5zxJ5uGaYbjvwkDUMCbLvrPlFmC8RZ5rsisezeIGmjRwoPvT30Xbl9s3WyuT52aV5+qS1Aoefj5PvzWg2+3p5/M0QgqkweMNZpSKc72czBTJ6fwOtPPz+f8LMAAA+DuW/W2pegAAAABJRU5ErkJggg==">MoviesJoy - Free movies streaming, watch movies online</A>
What in the actual fuck.
https://redd.it/1d0oc21
@r_bash
What in the actual fuck.
https://redd.it/1d0oc21
@r_bash
Reddit
From the bash community on Reddit
Explore this post and more from the bash community
Need help to understand this tbh
hello, let me tell you:
I was doing a noscript in bash and the situation has arisen where a function prints both informational messages and values that I will later want to store inside variables when I call the function in other functions or anywhere else in the noscript, something like this would be to represent the idea:
#!/usr/bin/env bash
foo(){
local a=${1} b=${2}
local sum=$(( a + b ))
printf "\n+ Checking something...\n"
printf "%s\n" $sum
}
bar(){
local value="$(foo 2 3)"
printf "%s\n" $value
}
bar
More or less this would be the idea but applied to the function I am performing, then I do not know where I read, that what used to be done was to redirect the informative messages to fd 2 and the values that will be used later to fd 1, so that then when calling the function to capture the values, on the one hand the informative messages are printed on the screen and also the value or values are stored in the declared variable (and only the value, not the informative messages).
Basically what I want is to store in a variable the value returned by the function and at the same time print the informative messages on the screen, without storing this ones inside the previous variable.
The thing is that I asked the AI what I could do and it told me this:
exec 3>&1
value=$( foo "${2}" "${3}" 2>&1 >&3 3>&1 )
exec 3>&-
And the truth is that after asking him several questions about this code, tbh I have not understood anything and it is very difficult for me to understand what is the purpose of all this sequence of commands.
I understand that
And then in the next line I get even more lost, because I know that
Thank you in advance to the one(s) who will help me to solve my doubt 😊
https://redd.it/1d18wo7
@r_bash
hello, let me tell you:
I was doing a noscript in bash and the situation has arisen where a function prints both informational messages and values that I will later want to store inside variables when I call the function in other functions or anywhere else in the noscript, something like this would be to represent the idea:
#!/usr/bin/env bash
foo(){
local a=${1} b=${2}
local sum=$(( a + b ))
printf "\n+ Checking something...\n"
printf "%s\n" $sum
}
bar(){
local value="$(foo 2 3)"
printf "%s\n" $value
}
bar
More or less this would be the idea but applied to the function I am performing, then I do not know where I read, that what used to be done was to redirect the informative messages to fd 2 and the values that will be used later to fd 1, so that then when calling the function to capture the values, on the one hand the informative messages are printed on the screen and also the value or values are stored in the declared variable (and only the value, not the informative messages).
Basically what I want is to store in a variable the value returned by the function and at the same time print the informative messages on the screen, without storing this ones inside the previous variable.
The thing is that I asked the AI what I could do and it told me this:
exec 3>&1
value=$( foo "${2}" "${3}" 2>&1 >&3 3>&1 )
exec 3>&-
And the truth is that after asking him several questions about this code, tbh I have not understood anything and it is very difficult for me to understand what is the purpose of all this sequence of commands.
I understand that
exec 3>&1 what it does is to make a duplicate of fd 1 in fd 3 to keep the original state of fd 1, but I don't understand why.And then in the next line I get even more lost, because I know that
2>&1 redirects stderr to stdout, but I do not understand why then redirects >&3 fd 1 (which contains fd 1 and fd 2) to fd 3 and then do 3>&1, the truth is that I do not understand anything and I would like to get to understand it.Thank you in advance to the one(s) who will help me to solve my doubt 😊
https://redd.it/1d18wo7
@r_bash
Reddit
From the bash community on Reddit
Explore this post and more from the bash community
Bash Script for Building Various GNU Programs from Source
Hey guys,
I have a GitHub repo that is mostly centered around productivity related tasks so I decided that I would create a build noscript to install what I consider to be the more mainstream GNU packages that are used more often than some of the others.
# Denoscription
This noscript will prompt you to choose which programs to install (you can choose
The noscript also will create soft links to the folder located in
# Optimizations
The noscript uses the following CFLAGS/CXXFLAGS settings:
-O3: Is a compiler optimization level flag that tells the compiler to perform aggressive optimizations when compiling the code.
-pipe: Is used to tell the compiler to use pipes rather than temporary files for communication between the different stages of compilation. When you compile a program, there are several stages involved, such as preprocessing, compiling, assembling, and linking. Normally, intermediate files are created and stored on disk during each stage, but using pipes instead of files can potentially improve the compilation speed, especially on systems with slow disk I/O.
-flto: Stands for "Link Time Optimization." It instructs the compiler to perform optimizations across different source files during the linking phase of compilation.
-march=native: Tells the compiler to generate code optimized for the CPU architecture on which the compilation is being performed.
# Removal
Each package that you choose to install will be located at the path
cd /usr/local/
sudo rm -fr PROGRAM-NAME-VERSION
# Important info for people new to this type of thing or Linux in general
When you install the latest version of ANY package there is a potential for incompatibility which another way to say this is that you can get errors when doing daily tasks. These can be as severe as what you would call "system breaking" so make sure that you understand this before using the noscript. I personally have installed all packages on both Debian 12 and Ubuntu 22.04 and SO FAR have not seen any issues but that is the extent of my knowledge. So please do your own homework and for anyone that does try this I wish that this is something you find useful.
You can download the noscript here on GitHub.
Here's to hoping this makes someone's life better in some way.
Cheers - J
https://redd.it/1d1dxog
@r_bash
Hey guys,
I have a GitHub repo that is mostly centered around productivity related tasks so I decided that I would create a build noscript to install what I consider to be the more mainstream GNU packages that are used more often than some of the others.
# Denoscription
This noscript will prompt you to choose which programs to install (you can choose
all) and then it will download, build, and compile each program from the latest source code (except for autoconf, which is set to version 2.71 due to errors I have gotten from the latest version 2.72) .The noscript also will create soft links to the folder located in
/usr/local for any files found in the programs install directory in the folders bin, include, and lib/pkgconfig# Optimizations
The noscript uses the following CFLAGS/CXXFLAGS settings:
-O3 -pipe -flto -march=native-O3: Is a compiler optimization level flag that tells the compiler to perform aggressive optimizations when compiling the code.
-pipe: Is used to tell the compiler to use pipes rather than temporary files for communication between the different stages of compilation. When you compile a program, there are several stages involved, such as preprocessing, compiling, assembling, and linking. Normally, intermediate files are created and stored on disk during each stage, but using pipes instead of files can potentially improve the compilation speed, especially on systems with slow disk I/O.
-flto: Stands for "Link Time Optimization." It instructs the compiler to perform optimizations across different source files during the linking phase of compilation.
-march=native: Tells the compiler to generate code optimized for the CPU architecture on which the compilation is being performed.
# Removal
Each package that you choose to install will be located at the path
/usr/local/PROGRAM-NAME-VERSION so if you ever want to quickly remove a package you can run the below commands and it should fix any issues immediately IF you do experience errors or other issues.cd /usr/local/
sudo rm -fr PROGRAM-NAME-VERSION
# Important info for people new to this type of thing or Linux in general
When you install the latest version of ANY package there is a potential for incompatibility which another way to say this is that you can get errors when doing daily tasks. These can be as severe as what you would call "system breaking" so make sure that you understand this before using the noscript. I personally have installed all packages on both Debian 12 and Ubuntu 22.04 and SO FAR have not seen any issues but that is the extent of my knowledge. So please do your own homework and for anyone that does try this I wish that this is something you find useful.
You can download the noscript here on GitHub.
Here's to hoping this makes someone's life better in some way.
Cheers - J
https://redd.it/1d1dxog
@r_bash
GitHub
noscript-repo/Bash/Installer Scripts/GNU Software/build-all-gnu.sh at main · slyfox1186/noscript-repo
My personal noscript repository with multiple languages supported. AHK v1+v2 | BASH | BATCH | JSON | POWERSHELL | POWERSHELL | PYTHON | WINDOWS REGISTRY | XML - slyfox1186/noscript-repo
bash noscript stops at evaluating modulo
A bash noscript with "set -e" stops unexpectedly. To debug, I use
bash -x foobar
the last thing displayed is:
​
\++ wc -l
\+ NDISKNODES=1
\+ export NDISKNODES
\++ expr 69677 % 1
\+ NODEINDEX=0
​
The corresponding part of the noscript is:
NDISKNODES=`cat $DISKNODELIST | wc -l`
export NDISKNODES
NODEINDEX=`expr $PID % $NDISKNODES`
​
So it doesn't seem to like the expr calculating a modulo?
$PID is the process ID, which is 69677 in example.
Same thing happens in Centos or Debian.
https://redd.it/1d1jjeu
@r_bash
A bash noscript with "set -e" stops unexpectedly. To debug, I use
bash -x foobar
the last thing displayed is:
​
\++ wc -l
\+ NDISKNODES=1
\+ export NDISKNODES
\++ expr 69677 % 1
\+ NODEINDEX=0
​
The corresponding part of the noscript is:
NDISKNODES=`cat $DISKNODELIST | wc -l`
export NDISKNODES
NODEINDEX=`expr $PID % $NDISKNODES`
​
So it doesn't seem to like the expr calculating a modulo?
$PID is the process ID, which is 69677 in example.
Same thing happens in Centos or Debian.
https://redd.it/1d1jjeu
@r_bash
Reddit
From the bash community on Reddit
Explore this post and more from the bash community
What is a clever way to run your cronjobs?
I've created a node.js noscript that scrapes websites. I want them to give me a notification every 7 days. Mail or anything. What's the clever way to run this cronjob?
I don't have a mail smtp server..I am unable to think of a clever approach of notifying myself about the result of the noscript.
https://redd.it/1d1tz8u
@r_bash
I've created a node.js noscript that scrapes websites. I want them to give me a notification every 7 days. Mail or anything. What's the clever way to run this cronjob?
I don't have a mail smtp server..I am unable to think of a clever approach of notifying myself about the result of the noscript.
https://redd.it/1d1tz8u
@r_bash
Reddit
From the bash community on Reddit
Explore this post and more from the bash community
Help with bash noscript
Can someone help to figure out where is mistake, I want to run noscript only if swap is over 60% but from log I see what swap is cleared every night
>!/bin/bash
>Get total Swap usage
>TOTAL_SWAP=$(swapon -s | awk '{print $3}' | grep -v 'Size')
>Convert Total Swap usage from KB to MB
>TOTAL_MB=$((TOTAL_SWAP/1024))
>Get 60% of total swap usage
>THRESHOLD=$(bc<<<$TOTAL_MB*0.6)
>Get currently used swap
>USED_SWAP=$(free -m | awk '/Swap/{print $3}')
>Check if currently used swap is greater than 60% of used swap
>if [ $USED_SWAP -gt ${THRESHOLD%.*} \]
>then
>BEFORE_CLEAR=$(date)
>echo "Cleaning swap started on $BEFORE_CLEAR" >> /tmp/swap.log
>/sbin/swapoff -a && /sbin/swapon -a
>AFTER_CLEAR=$(date)
>echo "Swap cleared on $AFTER_CLEAR" >> /tmp/swap.log
>fi
crontab -l
0 5 * * * /bin/bash /root/swap_clean
https://redd.it/1d2kdpj
@r_bash
Can someone help to figure out where is mistake, I want to run noscript only if swap is over 60% but from log I see what swap is cleared every night
>!/bin/bash
>Get total Swap usage
>TOTAL_SWAP=$(swapon -s | awk '{print $3}' | grep -v 'Size')
>Convert Total Swap usage from KB to MB
>TOTAL_MB=$((TOTAL_SWAP/1024))
>Get 60% of total swap usage
>THRESHOLD=$(bc<<<$TOTAL_MB*0.6)
>Get currently used swap
>USED_SWAP=$(free -m | awk '/Swap/{print $3}')
>Check if currently used swap is greater than 60% of used swap
>if [ $USED_SWAP -gt ${THRESHOLD%.*} \]
>then
>BEFORE_CLEAR=$(date)
>echo "Cleaning swap started on $BEFORE_CLEAR" >> /tmp/swap.log
>/sbin/swapoff -a && /sbin/swapon -a
>AFTER_CLEAR=$(date)
>echo "Swap cleared on $AFTER_CLEAR" >> /tmp/swap.log
>fi
crontab -l
0 5 * * * /bin/bash /root/swap_clean
https://redd.it/1d2kdpj
@r_bash
Reddit
From the bash community on Reddit
Explore this post and more from the bash community
Script to monitor live file changes in a directory in color
This noscript uses the ifnotifywait command to monitor multiple types of file events including:
create
delete
modify
move
The output in the terminal is colorized to reflect the type of file event and each entry is timestamped with the
To use the noscript execute the below commands:
chmod +x monitor.sh
./monitor.sh --directory "/path/to/folder"
You can download the noscript here on GitHub.
Have a good day everyone.
https://redd.it/1d2q28b
@r_bash
This noscript uses the ifnotifywait command to monitor multiple types of file events including:
create
delete
modify
move
The output in the terminal is colorized to reflect the type of file event and each entry is timestamped with the
month-date-year hour:minute:second-AM/PM.To use the noscript execute the below commands:
chmod +x monitor.sh
./monitor.sh --directory "/path/to/folder"
You can download the noscript here on GitHub.
Have a good day everyone.
https://redd.it/1d2q28b
@r_bash
GitHub
noscript-repo/Bash/Misc/System/monitor.sh at main · slyfox1186/noscript-repo
My personal noscript repository with multiple languages supported. AHK v1+v2 | BASH | BATCH | JSON | POWERSHELL | POWERSHELL | PYTHON | WINDOWS REGISTRY | XML - slyfox1186/noscript-repo
If one number is larger than the other, then... Shellcheck gives me an error that isn't there
In my noscript, I have a directory that if sizes are bigger than 2 MB must show me a message.
My function (the one that works for me):
APPSIZE=$(du -s -- $APPSPATH/$arg | cut -f1 -d" ")
SCRIPTSIZELIMIT="2048"
if [ "$APPSIZE" < "$SCRIPTSIZELIMIT" ]; then
the error that Shellcheck reports:
< is for string comparisons. Use -lt instead.
but if I try using -lt, or -gt or (( )) instead of [[ \]\] or any other solution around the forums... I get error messages.
I don't understand. "Comparison" is what I need, and "-lt" does not work for me.
https://redd.it/1d2pkg6
@r_bash
In my noscript, I have a directory that if sizes are bigger than 2 MB must show me a message.
My function (the one that works for me):
APPSIZE=$(du -s -- $APPSPATH/$arg | cut -f1 -d" ")
SCRIPTSIZELIMIT="2048"
if [ "$APPSIZE" < "$SCRIPTSIZELIMIT" ]; then
the error that Shellcheck reports:
< is for string comparisons. Use -lt instead.
but if I try using -lt, or -gt or (( )) instead of [[ \]\] or any other solution around the forums... I get error messages.
I don't understand. "Comparison" is what I need, and "-lt" does not work for me.
https://redd.it/1d2pkg6
@r_bash
Reddit
From the bash community on Reddit
Explore this post and more from the bash community
Reading and writing a USB drive connected to a Linux server using Termux, termux-usb, usbredirect, and QEMU on a smartphone that is not rooted [Alpine Linux operating system, Android operating system]
https://gist.github.com/NoteAfterNote/7a197233de3d60ff1e23ca90ed2f595a
https://redd.it/1d2ywj2
@r_bash
https://gist.github.com/NoteAfterNote/7a197233de3d60ff1e23ca90ed2f595a
https://redd.it/1d2ywj2
@r_bash
Gist
Reading and writing a USB drive connected to a Linux server using Termux, termux-usb, usbredirect, and QEMU on a smartphone that…
Reading and writing a USB drive connected to a Linux server using Termux, termux-usb, usbredirect, and QEMU on a smartphone that is not rooted - note-after-note-2024-may-19-termux-usbredirect-qemu.md
Build the latest GCC versions 10-14 on Debian-based OS
You can build the latest versions of GCC 10,11,12,13,14. The noscript finds the correct download links automatically.
The noscript also installs an autoconf version 2.69 in the GCC build directory which is required to install GCC so it's even easier to use. This is done so it does not overwrite your APT package manager or any manual installs that you have.
I would have made this universal but I don't have fast access to REHL and Arch lacks for nothing so I targeted what I use which is Debian-based OS.
Just run the noscript and enter a few choices and you're off.
You can find this here on GitHub.
# Installation Info
This will install the specific GCC version in this folder
# Disclaimer
The SUDO command is INSIDE the noscript where it is required. Feel free to notice the commands that use them for anyone who is cautious (I understand). It is not a good practice to run all commands as root and it can even mess up the noscript sometimes depending on what is written in it. So I had to go this route.
# Execution
chmod +x build-gcc.sh
./build-gcc.sh
# Optional Settings
I prefer to run my noscript using verbose mode. You can turn this on by changing
Have a great day everyone.
https://redd.it/1d3zeaf
@r_bash
You can build the latest versions of GCC 10,11,12,13,14. The noscript finds the correct download links automatically.
The noscript also installs an autoconf version 2.69 in the GCC build directory which is required to install GCC so it's even easier to use. This is done so it does not overwrite your APT package manager or any manual installs that you have.
I would have made this universal but I don't have fast access to REHL and Arch lacks for nothing so I targeted what I use which is Debian-based OS.
Just run the noscript and enter a few choices and you're off.
You can find this here on GitHub.
# Installation Info
This will install the specific GCC version in this folder
/usr/local/gcc-VERSION so if you ever want to delete it delete the corresponding folder.# Disclaimer
The SUDO command is INSIDE the noscript where it is required. Feel free to notice the commands that use them for anyone who is cautious (I understand). It is not a good practice to run all commands as root and it can even mess up the noscript sometimes depending on what is written in it. So I had to go this route.
# Execution
chmod +x build-gcc.sh
./build-gcc.sh
# Optional Settings
I prefer to run my noscript using verbose mode. You can turn this on by changing
verbose=0 to verbose=1 otherwise there is virtually no output during the build.Have a great day everyone.
https://redd.it/1d3zeaf
@r_bash
GitHub
noscript-repo/Bash/Installer Scripts/GNU Software/build-gcc.sh at main · slyfox1186/noscript-repo
My personal noscript repository with multiple languages supported. AHK v1+v2 | BASH | BATCH | JSON | PERL | POWERSHELL | PYTHON | WINDOWS REGISTRY | XML - slyfox1186/noscript-repo
Help with converting Windows BAT file to bash noscript.
Hi all,
I'm running Linux Mint Mate 21.3 Virginia and I'm trying to convert a series of Windows BAT files that are for an old FPGA programmer I have. The IDE portion of the software runs in Linux but the uploader to the board is a series of BAT noscripts. I'm trying to convert them to .sh files, but I'm having really basic errors.
Firstly, the first line of my .sh file is:
#! /usr/bin/bash
However, when I execute the file I get the following error:
bash: ./program.sh: /usr/bin/bash^M: bad interpreter: No such file or directory
I'm guessing that I have something setup incorrectly in xed so that it's appending the \^M character to the carriage return, but I'm not sure how to fix it. The bash location is correct.
$ which bash
/usr/bin/bash
Any help appreciated.
https://redd.it/1d43lp8
@r_bash
Hi all,
I'm running Linux Mint Mate 21.3 Virginia and I'm trying to convert a series of Windows BAT files that are for an old FPGA programmer I have. The IDE portion of the software runs in Linux but the uploader to the board is a series of BAT noscripts. I'm trying to convert them to .sh files, but I'm having really basic errors.
Firstly, the first line of my .sh file is:
#! /usr/bin/bash
However, when I execute the file I get the following error:
bash: ./program.sh: /usr/bin/bash^M: bad interpreter: No such file or directory
I'm guessing that I have something setup incorrectly in xed so that it's appending the \^M character to the carriage return, but I'm not sure how to fix it. The bash location is correct.
$ which bash
/usr/bin/bash
Any help appreciated.
https://redd.it/1d43lp8
@r_bash
Reddit
From the bash community on Reddit
Explore this post and more from the bash community
What key is M in yhis shortcut? forward-word (M-f) ¶
Hi, I'd like to know what is the key M in M-f
Thank you!
https://redd.it/1d4gcye
@r_bash
Hi, I'd like to know what is the key M in M-f
Thank you!
https://redd.it/1d4gcye
@r_bash
Reddit
From the bash community on Reddit
Explore this post and more from the bash community
Oh-My-bash colours problem
Hello everyone 👋
Some time ago I decided to jump on bash terminal. Mostly I use it as is with default settings but now I find Oh-my-bash extension what sounds great because of customisation possibilities.
Now, I have installed Oh-My-Bash and there is few problems with it.
First one is with directory colours. When I set some theme in .bashrc file and restart it source .bashrc, theme have effect on „main” info in console like on date, time, or current location. But for example when I’m in home (or whatever) and do ls/ll the directories funded by this command have white colour, the same as .txt file, or even executable .sh files. How I can resolve this problem?
Second one is with theme colour itself. Most of my app have set specific colour palette and in this case also I would like to use the same colour palette.
I know that oh-my-bash have GitHub page and pretty well done documentation but they do not explain this topic very well. So there is my second question, how I can customise one of themes and change colours in this?
P.S
When I copy one of themes to .oh-my-bash/custom/themes and then set this as variable in .bashrc the theme has no effect. It’s looks like bash don’t even look in custom directory.
Thanks for every response 👍🏻
https://redd.it/1d4nemp
@r_bash
Hello everyone 👋
Some time ago I decided to jump on bash terminal. Mostly I use it as is with default settings but now I find Oh-my-bash extension what sounds great because of customisation possibilities.
Now, I have installed Oh-My-Bash and there is few problems with it.
First one is with directory colours. When I set some theme in .bashrc file and restart it source .bashrc, theme have effect on „main” info in console like on date, time, or current location. But for example when I’m in home (or whatever) and do ls/ll the directories funded by this command have white colour, the same as .txt file, or even executable .sh files. How I can resolve this problem?
Second one is with theme colour itself. Most of my app have set specific colour palette and in this case also I would like to use the same colour palette.
I know that oh-my-bash have GitHub page and pretty well done documentation but they do not explain this topic very well. So there is my second question, how I can customise one of themes and change colours in this?
P.S
When I copy one of themes to .oh-my-bash/custom/themes and then set this as variable in .bashrc the theme has no effect. It’s looks like bash don’t even look in custom directory.
Thanks for every response 👍🏻
https://redd.it/1d4nemp
@r_bash
Reddit
From the bash community on Reddit
Explore this post and more from the bash community
Impossible bash prompt?
I'm in the process of customizing my bash prompt. I added an approx. measure of elapsed time (see the picture). However, I'd love to hide this when there is no stdout (see the red arrow). However, the longer I try the more I feel this is impossible. Does someone has an idea how I could manage to get this working?
https://preview.redd.it/yuu2lep4sq3d1.png?width=540&format=png&auto=webp&s=489dd94971b62e5e07c9a1d122446006b95efcbc
https://redd.it/1d4sp77
@r_bash
I'm in the process of customizing my bash prompt. I added an approx. measure of elapsed time (see the picture). However, I'd love to hide this when there is no stdout (see the red arrow). However, the longer I try the more I feel this is impossible. Does someone has an idea how I could manage to get this working?
https://preview.redd.it/yuu2lep4sq3d1.png?width=540&format=png&auto=webp&s=489dd94971b62e5e07c9a1d122446006b95efcbc
https://redd.it/1d4sp77
@r_bash
Generate random ipv6 unique local address
I use the following website for generating ipv6 local addresses: https://unique-local-ipv6.com/
I would love to use a posix shell noscript instead though. Are there any pre-existing tools or methods to do this?
Thank you
https://redd.it/1d50zkh
@r_bash
I use the following website for generating ipv6 local addresses: https://unique-local-ipv6.com/
I would love to use a posix shell noscript instead though. Are there any pre-existing tools or methods to do this?
Thank you
https://redd.it/1d50zkh
@r_bash
Unique-Local-Ipv6
Unique Local IPv6 Generator
Generate unique local IPv6 address blocks (Unique Local Addresses, ULAs) instantly with JavaScript.