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

Debian / Ubuntu Linux Install Advanced Intrusion Detection Environment (AIDE) Software

AIDE (Advanced Intrusion Detection Environment) is a popular and powerful tool for monitoring file system changes on a Linux system. It can be used to detect and alert on any unauthorized changes to files, directories, and other system objects. Here are the steps to install and configure AIDE on Debian and Ubuntu Linux systems: Install … Read more

Linux Tune Network Stack (Buffers Size) To Increase Networking Performance

The networking performance of a Linux system can be improved by tuning the network stack buffers sizes. The buffer sizes can be adjusted using the sysctl command. Here are the steps to tune the network stack buffers size: Open a terminal or shell prompt on your Linux system. Verify that the net.core.rmem_max, net.core.wmem_max, net.ipv4.tcp_rmem, and … Read more

Linux Limit CPU Usage Per Process

In Linux, you can limit the CPU usage of a process by using the cpulimit command. Here’s how to use it: Install cpulimit on your Linux system, if it is not already installed. You can do this using your distribution’s package manager. For example, on Ubuntu or Debian, you can run: sudo apt-get install cpulimit … Read more