Posts

Showing posts from January, 2024

Colorize your terminal bash prompt by modifying the .bashrc file.

Image
  Go to your  .bashrc  file and remove the comment from the  force_color_prompt  line. vim ~/.bashrc .. # search for force_color_prompt=yes ... # Than source ~/.bashrc

psql: error: connection to server at "localhost" (127.0.0.1), port 5433 failed: ERROR: failed to authenticate with backend using SCRAM DETAIL: valid password not found

Image
ERROR psql: error: connection to server at "localhost" (127.0.0.1), port 5433 failed: ERROR: failed to authenticate with backend using SCRAM DETAIL: valid password not found Since Pgpool-II is a PostgreSQL proxy that works between clients and PostgreSQL servers, the authentication comprises two steps: Authentication between client and Pgpool-II Authentication between Pgpool-II and PostgreSQL servers Starting with Pgpool-II 4.0, Pgpool-II supports scram-sha-256 authentication. scram-sha-256 authentication method is strongly recommended because it is the most secure password-based authentication method. Solution 1 If PostgreSQL servers require  MD5  or  SCRAM  authentication for some user’s authentication but the password for that user is not present in  pool_passwd , then enabling  allow_clear_text_frontend_auth  will allow the  Pgpool-II  to use clear-text-password authentication with user to get the password in plain text form from the user and use it for backend authenticat

ERROR: pid 29754: initializing pool password, failed to open file:"/etc/pgpool2/pool_passwd"

Image
  If you encountered the error: ERROR: pid 29506 : initializing pool password, failed to open file: "/etc/pgpool2/pool_passwd" Than you have to change the owner of the file  pool_passwd  to  postgres : sudo chown -R postgres:postgres /etc/pgpool2/pool_passwd Finally you can run: su - postgres pg_enc -m -k ~/.pgpoolkey -f /etc/pgpool2/pgpool.conf -u vstat -p Related article on: https://dev.smirnov.app/2022/06/psql-error-connection-to-server-failed-to-authenticate-with-backend-using-scram-detail.html

Settings ~/.vimrc

Image
  These settings are commonly used to customize the behavior and appearance of the Vim text editor. They ensure consistent coding style, comfortable text navigation, and useful features during editing. Make sure to adapt these settings according to your preferences and the specific requirements of your projects. set encoding=utf8 > Set encoding to UTF- 8 set paste > Enable paste mode set expandtab > Use spaces instead of tabs for indentation set textwidth= 0 > Disable automatic text wrapping set tabstop= 4 > Number of spaces that a <Tab> in the file counts for set softtabstop= 4 > Number of spaces to use for each step of (auto)indent set shiftwidth= 4 > Number of spaces to use for (auto)indent set smartindent > Enable smart auto-indenting set backspace=indent,eol,start > Allow backspacing over autoindent, line breaks, and start of insert set

SSL: CERTIFICATE_VERIFY_FAILED with Python2.7/3

Image
To enhance flexibility and address specific use cases, modifications will be made to the ssl module instead of consistently relying on  ssl.create_default_context . The updated approach involves checking the  PYTHONHTTPSVERIFY  environment variable upon the module’s initial import in a Python process. The  ssl._create_default_https_context  function will then be configured as follows: If the environment variable is present and set to ‘0’,  ssl._create_default_https_context  will be an alias for ssl._create_unverified_context. Otherwise,  ssl._create_default_https_context  will be an alias for  ssl.create_default_context , adhering to the usual behavior. Here is an example implementation: import os import sys import ssl _https_verify_envvar = 'PYTHONHTTPSVERIFY' def _get_https_context_factory () : if not sys.flags.ignore_environment: config_setting = os.environ.get(_https_verify_envvar) if config_setting == '0' : return ssl._cr