Ubuntu: bring back to /etc/network/interfaces

Starting from Ubuntu 18.04 network configuration goes via systemd using netplan application, main network config placed in the /etc/netplan/*.yml. Some peoples dislike netplan because some things are hard to proper configuration and want to bring back classic /etc/network/interfaces. Continue Reading

Gitlab-CI: build and deploy docker container to the server

I have flask application, code version control in the own instance Gitlab, application run in the docker container. I was set up full automated pipeline in the Gitlab-CI that on every push – build a new version of the application image, push it into GitLab image registry and connect to the remote docker server and update running container with new image version.
So – code, commit, push – everything goest in auto mode. 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=#

docker: remote access api setup

Docker able to enable remote connections, that you execute command in your local terminal but execution of it redirects to the remote docker machine.

In my case, I need that because I running Gitlab-CI pipeline that’s build image and I want automatically update it for the running container on the server.  Continue Reading