The script checks usage of every partitions in the system. When any of the disk space used is above 80%, the script prints a WARNING message with percent used by each partition.
Otherwise, it prints a OK message with usage percentage.
This script checks the ram usage of your system and log the result to a ram_log file in your home directory. To make it run automatically on your system, setup a crontab. Here's how:
Run this in your terminal:
-
crontab -e
-
Add the below to the bottom of the page: */5 * * * * /root/path/to/your/ram-check.sh
This auto runs the script every five minutes
The script search for secrets or private keys in staging area before commit. When a keyword containing "Private key" or "AWS_SECRET_ACCESS_KEY" is found in a file about to be committed, the commit stops. And the file won't be committed.
The script can be made to auto run on every commit by saving the script in .git/hooks/pre-commit.
For instance, your initialized folder is "bash-scripts".
You cd to the folder. Then:
- nano .git/hooks/pre-commit
- Save the key-hunter.sh content in pre-commit file
The script auto runs first before a file is committed.
You can adjust the search keyword in the script to the variable name you use to save private keys.