Author: ashishpsk

GRANT read only access to a PostgreSQL database for a user

In your terminal, login as the postgres user (for security reasons, the postgres user has no password. That’s why we are logging in using -i option) Connect to the PostgreSQL interactive terminal. Notice that you should mention the name of the concerned database, otherwise you will be doing operations on the postgres default database instead. Allow the user to connect to

Read more

Command to know TLS Version:

For TLS 1.3: For TLS 1.2: For TLS 1.1: For TLS 1: If you get the certificate chain and the handshake then the TLS version is supported. If you don’t see the certificate chain, and something similar to “handshake error” then its not.

Read more

Find Cause of Spam Source

Mass suspend or unsuspend mailboxes of a domain Using the API, can help you quickly automate that process and suspend the users in question: If you wish to suspend the entire domain, you can use: To Unsuspend: If you prefer to suspend a specific email account login, you can use the suspend_login API call. To suspend

Read more

How can i disable MySQL strict mode ?

To Disable Strict Mode via SQL  Then, you can verify that the mode is set by running the following : Disable Strict Mode via my.cnf: Disable it by setting your own SQL_MODE in the my.cnf file, then restart MySQL. The my.cnf file can be found in one of a few locations (depending on which distribution

Read more

How to give a user permission to restart apache?

Using visudo, add the following to your sudoers file, replacing username with the proper username: If you want to not have to type in a password before you do this, use the following: After this, the ‘username’ user can execute sudo /etc/init.d/apache2 start (or stop, restart,etc) You’ll likely want to setup a separate user for

Read more

MySQL SHOW USERS: List All Users in a MySQL Database Server

MySQL SHOW USERS: List All Users in a MySQL Database Server: To get more information on the user table, you can preview its columns using the following command: To show users and other information such as host, account locking, and password expiration status, you use the following query: SELECT user, host, account_locked, password_expired FROM user; To get

Read more

cPanel PHP-FPM php error log rotation

How to set up PHP error log rotation in cPanel When cPanel server uses PHP-FPM it does only control the log rotation for system-like log files, which are sitting at /opt/cpanel/ea-phpXY However it does not rotate PHP error log generated and stored at /home/<user>/logs/domain.com.php.error.log Modern CMSes may produce huge amount of Warning and Deprecated log entries in

Read more

MySQL Error “Too many connections” and how to resolve it

The maximum number of connections threads allowed for the server is contained in the system variable max_connections. The default value is 151. To see the value to which this variable is set, run the following SQL command: To change the value of the system variable max_connections, the –max_connections option can be used. To change this variable temporarily while

Read more

modsec.sqlite file size

How can I clean or empty the contents of this file and not cause any problems in the operation of cPanel? It would clear the database having the hit list and setup_modsec_db would create a clean empty one.

Read more