Archive for the ‘ Новини ’ Category

Ansible Error: template error while templating string: Encountered unknown tag ‘do’

Just add to ansible.cfg module


# some basic default values...

Lihgthouse on Debian

Install latest Chrome

apt-get install xvfb imagemagick
dpkg -i google-chrome-stable_current_amd64.deb

install NodeJS and NPM

apt install nodejs
apt install npm
nodejs -v

Install Lighthouse

npm install -g lighthouse

Run test

lighthouse --chrome-flags="--no-sandbox --headless --disable-gpu"

Scripts for streaming desktop

ffmpeg \
   -video_size 1920x1080 -framerate 60 \
  -f x11grab -i :0.0+100,200 \
  -f alsa -i default \
  -f webm -cluster_size_limit 2M -cluster_time_limit 5100 -content_type video/webm \
  -c:a libvorbis -b:a 96K \
  -c:v libvpx -b:v 1.5M -crf 30 -g 150 -deadline good -threads 4 \

# http://localhost:8754/stream.webm

Source –

After you can use –

Zookeeper RPM for Centos 7

You can download rpm for version 3.4.14 from url zookeeper-3.4.14-1.x86_64.rpm

It created from original binary from Apache Org


Centos 8 – update linux kernel

rpm --import

dnf install

So, install the new kernel.

:~# dnf --enablerepo=elrepo-kernel install kernel-ml

Setup new Kernel to default

grub2-set-default 0

grub2-mkconfig -o /boot/grub2/grub.cfg

Mikrotik as OpenVPN server in 3 steps

Connect to Mikrotik via SSH and start writing text below

Set global VARs

:global COMMONNAME "openVPN"
:global COUNTRY "UA"
:global STATE "KV"
:global LOCALITY "Kyiv"
:global ORG "My org"
:global UNIT ""
:global KEYSIZE "1024"
:global USERNAME "admins"
:global PASSWORD "8charsPassword"
:global NET "77"
:global PORT "7777"

Make server and client CRT

add name=ca-template country="$COUNTRY" state="$STATE" locality="$LOCALITY" organization="$ORGANIZATION" unit="$UNIT" common-name="$COMMONNAME" key-size="$KEYSIZE" days-valid=3650 key-usage=crl-sign,key-cert-sign
sign ca-template ca-crl-host= name="$COMMONNAME"
:delay [6]
add name=server-template country="$COUNTRY" state="$STATE" locality="$LOCALITY" organization="$ORGANIZATION" unit="$UNIT" common-name="server@$COMMONNAME" key-size="$KEYSIZE" days-valid=3650 key-usage=digital-signature,key-encipherment,tls-server
sign server-template ca="$COMMONNAME" name="server@$COMMONNAME"
:delay [6]
add name=$USERNAME country="$COUNTRY" state="$STATE" locality="$LOCALITY" organization="$ORGANIZATION" unit="$UNIT" common-name="$USERNAME" key-size="$KEYSIZE" days-valid=3650 key-usage=tls-client

Create pool, profile, interface, firewall

/ip pool
add name=VPN-POOL-devops ranges="10.$NET.1.2-10.$NET.1.254"

/ppp profile
add dns-server="10.$NET.1.1" local-address="10.$NET.1.1" name=VPN-PROFILE remote-address=VPN-POOL use-encryption=yes

/interface ovpn-server server
set auth=sha1 certificate="server@$COMMONNAME" cipher=aes128,aes192,aes256 default-profile=VPN-PROFILE enabled=yes require-client-certificate=yes port="$PORT" max-mtu=1460

/ip firewall filter
add chain=input dst-port=$PORT protocol=tcp comment="Allow OpenVPN" action=accept place-before=0

add chain=input action=accept protocol=tcp src-address=10.$NET.1.0/24 in-interface-list=dynamic log=no log-prefix="" place-before=2

/ppp secret
add name=$USERNAME password=$PASSWORD profile=VPN-PROFILE service=ovpn

add name="$USERNAME-to-issue" copy-from="$USERNAME" common-name="$USERNAME@$COMMONNAME"

export-certificate "$COMMONNAME" export-passphrase=""
export-certificate "$USERNAME@$COMMONNAME" export-passphrase="$PASSWORD"

Goto menu Files in Mikrotik admin panel and download ca.crt + client.crt + client.key

Then make file SomeName.ovpn with content:

# в этой строчке мы указываем адрес в интернете нашего микротика
remote <your.server.IP> <Port>
dev tun
proto tcp
tun-mtu 1460

keepalive 10 120
verb 3
cipher AES-256-CBC
auth SHA1

remote-cert-tls server
# эта строка задаёт файл с логином-паролем которые мы прописывали в PPP-Secrets на микротике
auth-user-pass auth.cfg

# в этой части мы задаём настройки сетей которые находятся за микротиком,
# а это адрес микротика который мы указывали в PPP профиле

#route-method exe 
#route-delay 2 

#for internet access
redirect-gateway autolocal 


.....Put your ca crt from downloaded files.....



.....Put your client crt from downloaded files.....


.....Put your client key from downloaded files.....



Put your key and crt and change host:port vars

and file auth.cfg


with this two files you can start client

Syncthing: How to add Relay Server URI

In the docs it says that it’s one of the listen addresses now
Thanks. It works to put URI in of config.xml.
URI like : relay://:22067/?id=EGIGXJZ-F7UOIQ2-KSYNJEB-XILHWP5-TKKIVLE-U……

Java8 in Debian

For starting we need install add-apt-repository

apt-get install software-properties-common python-software-properties

Then install java8

sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer

To automatically set up the Java 8 environment variables:

sudo apt-get install oracle-java8-set-default


echo "deb xenial main" | tee /etc/apt/sources.list.d/webupd8team-java.list
echo "deb-src xenial main" | tee -a /etc/apt/sources.list.d/webupd8team-java.list
apt-key adv --keyserver hkp:// --recv-keys EEA14886
apt-get update
apt-get install oracle-java8-installer


Syncthing replaces proprietary sync and cloud services with something open, trustworthy and decentralized. Your data is your data alone and you deserve to choose where it is stored, if it is shared with some third party and how it’s transmitted over the Internet.

Нада потестити…..

Запуск VNC сервера через SSH

На клиентской стороне:

ssh -L 5900:localhost:5900 "x11vnc -display :0 -noxdamage"

После чего в VNC клиенте подключаемся к localhost:5900

Mysql: duplicating a table

You need to do :

CREATE TABLE newtable LIKE oldtable; 
INSERT newtable SELECT * FROM oldtable;

This creates copy of existing Mysql table with indexes