I wrote some Python script and implement “auto-update” this script, to apply changes in runtime I need to restart script from itself. These restart script from itself. Continue Reading
Category: Small tips
CentOS: ifconfig command not found
In the out-of-box CentOS installations ifconfig is absent. It is easy to fix, just install the net-tools package.
centos: disable ipv6 in yum/dnf
On my server present ipv4 and ipv6, but yum index updates take too long time, I realize some ipv6 problem is here but I want just to disable ipv6 for yum. Continue Reading
Ansible: split string
To split some string in the Ansible you can use split filter. For example, used default Ansible variable ansible_nodename that contains current host hostname like example.com Continue Reading
MSSQL: change database owner
To change database owner in the MSSQL just run this Query Continue Reading
PostreSQL: show tables
To show database tables first connect to the local PostgreSQL and connect to the database (\c db_name), then you can view database tables list. Continue Reading
PostgreSQL: use database
Connect to the PostgeSQL via psql
[root@s ~]# su postgres bash-4.4$ psql psql (10.6) Type "help" for help. postgres=#
Connect to the database – \c
postgres=# \c quaded You are now connected to database "quaded" as user "postgres". quaded=#
PostgreSQL: show databases list
Connect to the PostgreSQL via psql
[root@s ~]# su postgres bash-4.4$ psql psql (10.6) Type "help" for help. postgres=#
List the databases – \l
postgres=# \l List of databases Name | Owner | Encoding | Collate | Ctype | Access privileges -----------+----------+----------+-------------+-------------+----------------------- quaded | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | postgres | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | template0 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/postgres + | | | | | postgres=CTc/postgres template1 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/postgres + | | | | | postgres=CTc/postgres (4 rows) postgres=#