#03 Set Sidekiq and rails log level using single environment variable

Sidekiq by default logs at info level and do not respect the rails log level. This can be problematic in environments where you are running rails at warn or error. Log stream will be flooded by log entries from sidekiq. To control sidekiq and rails logging level using a single environment variable, add this to your config/initializers/sidekiq.rb file. Sidekiq.configure_server do |config| config.logger.level = Logger.const_get(ENV.fetch('LOG_LEVEL', 'info').upcase.to_s) end LOG_LEVEL variable is used to set the rails log level in config/environments/production....

May 17, 2022

#02 ztz devops project

The idea is start from scratch and build an entire software stack as cloud native. Frontend, Backend and Infrastructure combined. Internet(frontend) <–> web server <–> api server(backend) <–> database Infra side IaC Logging Monitoring CI/CD tbc

July 27, 2020

#1 Read bash environment variables in psql

To use bash environment variables in postgres/psql, make use of \set meta command. $ db_user="vn" $ pg_pass=$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 15 ; echo '') $ psql postgres=# \set user `echo $db_user` postgres=# \set pass `echo $pg_pass` postgres=# CREATE USER :'user' CREATEDB; postgres=# ALTER USER :'user' PASSWORD :'pass';

May 5, 2020

#0 Hello world

hell0 w0rld !

April 14, 2020