How to install PHP 7.1/7.2/7.3/7.4 in CentOS 7

Uncomment the required php version.

October 20, 2019 · 1 min · 5 words · Akhil Jalagam

How to auto login in PostgreSQL from a shell?

When you run MySQL commands MySQL, mysqlcheck, mysqdump and psql, psqldump etc; they will pick username & password from this file if you do not provide them as argument (-u and -p). It can save you time. Of course, if you specify username and password explicitly as part of the command’s arguments, they will be used. .pgpass ( for psql client )

October 18, 2019 · 1 min · 64 words · Akhil Jalagam

fail2ban filters – custom rules using regexp

fail2Ban is a very handy tool to prevent a lot of unwanted traffic from consuming bandwidth on your servers. It’s a minimal and relatively simple IDS Type Tool that comes with some predefined filters to automatically lockout potentially dangerous or bandwidth-consuming type attacks. 1. creating a custom filter /etc/fail2ban/filter.d/custom.conf [Definition] badagents = 360Spider|ZmEu|Auto Spider 1.0|zgrab/[0-9]*\.[0-9a-zA-Z]*|Wget\(.*\)|MauiBot.* failregex = ^.+?:\d+ <HOST> -.*"(GET|POST|HEAD).*HTTP.*(?:%(badagents)s)"$ ignoreregex = 2. test the custom filter against a log file using the following command fail2ban-regex /path-to-samples/sample....

October 16, 2019 · 1 min · 169 words · Akhil Jalagam

Exploring the Logrotate Configuration

Logrotate is a system utility that manages the automatic rotation and compression of log files. If log files were not rotated, compressed, and periodically pruned, they could eventually consume all available disk space on a system. Logrotate’s configuration information can generally be found in two places: /etc/logrotate.conf: this file contains some default settings and sets up the rotation for a few logs that are not owned by any system packages. It also uses an include statement to pull in configuration from any file in the /etc/logrotate....

October 16, 2019 · 2 min · 359 words · Akhil Jalagam

How to install, configure, create user and database with permissions – MySQL

Table of Contents: Installing MySQL Configuring MySQL Creating Users and Granting Permissions Creating Databases Managing User Privileges Conclusion Section 1: Installing MySQL To install MySQL on a Linux distribution, you can use the package manager specific to your distribution. Here are the commands for popular Linux distributions: Ubuntu and Debian: CentOS and Fedora: Arch Linux: Section 2: Configuring MySQL Once MySQL is installed, you need to configure it. The configuration file may vary depending on the distribution....

October 15, 2019 · 2 min · 289 words · Akhil Jalagam