Enforce HTTPS with HSTS in Nginx
Configure Nginx to implement HTTP Strict Transport Security (HSTS) to force clients to use HTTPS, protecting against downgrade attacks and cookie hijacking.
Curated list of production-ready BASH scripts and coding solutions.
Configure Nginx to implement HTTP Strict Transport Security (HSTS) to force clients to use HTTPS, protecting against downgrade attacks and cookie hijacking.
Learn how to automate log file rotation and compression in Bash, saving disk space and managing server logs efficiently for web applications.
Discover how to effectively parse command-line arguments using Bash's built-in `getopts` for creating flexible and user-friendly shell scripts with options.
Monitor your web services by checking website availability and HTTP status codes using a simple Bash script with `curl` to ensure uptime and health.
Perform a powerful recursive find and replace operation across multiple files in a directory using Bash with `find` and `sed` for quick code refactoring.
Learn to create reliable timestamped backups of your important files and directories using Bash with `tar` and `gzip` for easy recovery.
Streamline web project setup. This bash script automates cloning a Git repository and installing Node.js dependencies with npm or yarn, simplifying initial project setup for developers.
Create secure, random alphanumeric strings with a specified length using '/dev/urandom' and 'tr'. Ideal for temporary passwords, API keys, or unique identifiers in scripts.
Ensure critical web services remain active. This bash script checks if a specified systemd service is running and restarts it if it's found to be inactive or in a failed state.
Perform simple rotation for application log files. This script archives old log files by compressing and renaming them with a timestamp, then truncates the original log file for fresh logging.
Reclaim valuable disk space by automatically locating and removing files older than a specified number of days in a target directory. Useful for cleaning up temporary files or old backups.
Enhance Bash script reliability using 'set -e' for immediate exits on error and 'trap' for guaranteed resource cleanup, critical for stable deployment or build processes.