Today, I’ll share with you how to determine the size of the HTTP response header. The problem I encountered Last week one of my systems encountered the following error. When a user send a resquest POST, a 502 error occurs. I checked the log on the server, I received the following log. 2019/04/02 09:23:33 [error]
This article will show you how to compare floating point number in bash. Here are my shared experiences while working with the Linux system. Compare 2 common numbers Usually, we compare two integer numbers. For example, we have 2 numbers as follows: $ NUM1=2 $ NUM2=1 And to compare these two numbers in Linux, we
This article will show you how to make a bash script run as a service in Debian 9. Debian is one of the most popular OSs in the world today. Write your bash script The first thing, of course, is that you need your bash script file. In fact, the script written in bash or
How to insert lines before or after pattern? In this article, I will show you how to use sed command to insert lines before or after the pattern. Use sed command to insert In the work of writing scripts to install services for the system. Inserting lines into configuration files (eg IPtables, Nginx ..) is
In this article, I will show you how to control iptables in the bash script. Iptables is a firewall that is built into almost all Linux operating systems. Using it makes your system a more secure layer. Controlling the iptables service and its rules manually, most people have done. But sometimes, iptables needs to work
How to use the sed command to delete lines between two patterns. In real situations, you will encounter many times to delete lines between two patterns. This article will guide you to use the sed command to do that job. Situation required I have the file mpm_prefork.conf, this is a configuration file of Apache2. Now,
This article will guide you how to make a bash script run as a service on Debian 8. This article is quite simple, because I’ve previously written similar tutorials for CentOS 6, CentOS 7, Ubuntu 16. Debian 8 also uses systemd as Ubuntu 16, so the usage in these two operating systems is the same.
How to check if running root in a script bash? In most cases, bash script files are run by the root user in the system. Because these are system administrators, these scripts will need permission to install, change the system. But how can we check that the user is running as root when we execute