Lighttpd: Set Cache-Control: public, max-age Headers For Caching Purpose

To set Cache-Control: public, max-age headers for caching purposes in Lighttpd, you need to modify the configuration file. The default configuration file is usually located at /etc/lighttpd/lighttpd.conf. To set the Cache-Control headers, add the following to your Lighttpd configuration file: $HTTP[“url”] =~ “\.(gif|jpg|jpeg|png|css|js)$” { # set cache-control headers for static files add_header “Cache-Control” “public, max-age=31536000, … Read more

Linux / Unix Rsync Copy Hidden Dot Files and Directories Only

To copy only hidden dot files and directories using rsync, use the –include option with a pattern to match hidden files, and the –exclude option with a pattern to exclude all other files: rsync -av –include=’.*/’ –exclude=’*’ source_directory/ destination Here’s what each option does: -a (or –archive) is equivalent to -rlptgoD and preserves almost everything … Read more

Python Execute Unix / Linux Command Examples

In Python, you can execute Unix/Linux commands using the subprocess module. The subprocess module allows you to spawn new processes, connect to their input/output/error pipes, and obtain their return codes. Here are some examples of how you can use the subprocess module to execute Unix/Linux commands in Python: Running a simple command: The following code … Read more

CentOS / RHEL: Install atop (Advanced System & Process Monitor) Utility

The atop utility is an advanced system and process monitor for Linux that provides detailed information about system resource utilization. To install atop on CentOS or Red Hat Enterprise Linux (RHEL), you can follow these steps: Add the EPEL repository: atop is not included in the default CentOS/RHEL repositories, so you’ll need to add the … Read more

How To Install Python idle IDE On Linux Operating System

To install the Python IDLE Integrated Development Environment (IDE) on a Linux operating system, you can use the package manager of your Linux distribution. Here are the commands for a few popular Linux distributions: On Fedora: sudo dnf install python3-tools On CentOS/RHEL: sudo yum install python3 On Ubuntu/Debian: sudo apt-get install idle3 Once the installation … Read more