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
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
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
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
docker: Apline configure timezone
Container docker based on Alpine Linux uses standard timezone UTC, if in your case needed any other timezone you must to follow 2 steps
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=#
Lunux: start X application from ssh
To start any X application on the active display using ssh session fist you are need export environment variable with display number and the execute application binary.
Linux: get screen resolution from shell
To get current dispay resolution on Linux using shell (bash) you can use default application xrandr. Continue Reading
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
docker: remove unused images
Actively using docker you can face problems out of free disk space because docker images take up too much disk space. You can clean unused and previous versions of your’s rebuilded images.