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 · 62 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 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 3....

October 16, 2019 · 1 min · 132 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 · 340 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

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

PostgreSQL: The World’s Most Advanced Open Source Relational Database PostgreSQL is arguably the most advance and powerful opensource enterprise class relational database system. It is the object relational database system and provides the most standard compliant system for the Database designers. It provides the complete support for reliable transactions that is (ACID complaint) where ACID stands for Atomicity, Consistency, Isolation and Durability. Its advance underlying technology makes it extremely powerful and programmable....

October 15, 2019 · 1 min · 184 words · Akhil Jalagam