This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Check the status of all Fail2Ban jails | |
for jail in $(sudo fail2ban-client status | grep 'Jail list:' | cut -d ':' -f 2 | tr -d ' ' | tr ',' ' '); do | |
sudo fail2ban-client status "$jail" | |
echo "" | |
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Define paths | |
CERT_PATH="/path/to/cert.pem" | |
KEY_PATH="/path/to/key.pem" | |
PFX_PATH="/path/to/output.pfx" | |
PFX_PASSWORD="your_password" # Set a password for the PFX file | |
# Create the PFX file | |
openssl pkcs12 -export -out "$PFX_PATH" -inkey "$KEY_PATH" -in "$CERT_PATH" -passout pass:"$PFX_PASSWORD" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Function to display usage | |
usage() { | |
echo "Usage: $0" | |
echo "This script creates a new email user and sets up the necessary directories and groups." | |
} | |
# Check if the script is run as root | |
if [ "$EUID" -ne 0 ]; then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Access the environment variables | |
api_token="CLOUDFLARE_API_TOKEN" | |
zone_name="FQDN" | |
# Function to get the current public IP address | |
get_public_ip() { | |
curl -s -X GET https://ifconfig.co | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Define backup and restore directories | |
BACKUP_DIR="/mnt/storage" # Change this to your desired backup location | |
TIMESTAMP=$(date +"%Y%m%d_%H%M%S") | |
MAX_SIZE=250M # Maximum size of each archive part (250 MB) | |
DIRECTORIES=( | |
"/etc" | |
"/var" | |
"/home" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
start_time=$(date +%s) | |
# Set the directory containing the zip files to the current working directory | |
zip_dir=$PWD | |
# Define a function to process files | |
process_files() { | |
# Process CUE, ISO, and BIN files | |
for file in *; do |