Tunneling X Connection Through Intermediate Linux / BSD Gateway

Tunneling an X connection through an intermediate Linux/BSD gateway involves forwarding X11 protocol packets over SSH connections, so that the display of the remote X application can be displayed on the local X server. Here are the steps to set up tunneling of X connections: Connect to the intermediate gateway using SSH: $ ssh gateway.example.com … Read more

FreeBSD Jail Allow Ping / tracerouter Commands

To allow ping and traceroute commands inside a FreeBSD jail, you will need to modify the jail’s configuration to allow ICMP traffic. Edit the jail’s configuration file: sudo vi /etc/jail.conf Add the following line to the configuration file, replacing jail_name with the name of your jail: exec.start += “sh /etc/rc.initial.jail_name” This line will execute the … Read more

Red Hat / CentOS Install mod_security Apache Intrusion Detection And Prevention Engine

To install and configure mod_security on Red Hat or CentOS, you can follow these steps: Install the mod_security package using yum: sudo yum install mod_security After installation, the mod_security module is enabled by default. You can edit the mod_security.conf file to customize its configuration, if needed: sudo vi /etc/httpd/conf.d/mod_security.conf This file contains various directives that … Read more

Gracefully Restart Lighttpd Web Server

To gracefully restart the Lighttpd web server, you can use the lighttpd command with the -s option and the graceful-restart argument. Here’s the command you can use: sudo lighttpd -s graceful-restart When you run this command, Lighttpd will reload its configuration and gracefully restart the server. This means that any active connections will be allowed … Read more

HowTo: Skip Bash For Loop

In Bash, you can skip a for loop iteration using the continue keyword. Here’s an example: #!/bin/bash for i in {1..10} do if [[ $i -eq 5 ]]; then continue fi echo “Iteration $i” done In this example, we have a for loop that iterates from 1 to 10. Inside the loop, we have an … Read more

How to use yum-cron to automatically update RHEL/CentOS Linux

Yum-cron is a package that can be used to automatically update packages on RHEL/CentOS Linux systems. Here are the steps to set up yum-cron: Install yum-cron: sudo yum install yum-cron Edit the configuration file for yum-cron: sudo vi /etc/yum/yum-cron.conf The configuration file has several options that can be used to customize the behavior of yum-cron. … Read more