Jul 19, 2019

How to add a Shared Folder in VirtualBox

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.2 LTS
Release: 18.04
Codename: bionic

$ uname -a
Linux ubuntu-vm 4.18.0-25-generic #26~18.04.1-Ubuntu SMP Thu Jun 27 07:28:31 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

Devices > Shared Folders > Settings

Add the Path, Name and enable "Auto-mount" and "Make permanent" options.

Finally add your user to the group vboxsf:

$ sudo usermod -G vboxsf -a <my_user_name>

Logout and back again or reboot the machine.

---

If you plugged in the drive (shared folder) after loading OS you can restart vbox service:

$ sudo systemctl restart vboxadd-service.service

Jul 18, 2019

How to build MKVToolNix from SC

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.2 LTS
Release: 18.04
Codename: bionic

$ uname -a
Linux ubuntu-vm 4.18.0-25-generic #26~18.04.1-Ubuntu SMP Thu Jun 27 07:28:31 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

$ mkdir mkv
$ cd mkv/
$ git clone https://gitlab.com/mbunkus/mkvtoolnix.git
$ cd mkvtoolnix/
$ sudo apt install autoconf
$ sudo apt install rake
$ cd ..
$ git clone https://github.com/Matroska-Org/libebml.git
$ git clone https://github.com/Matroska-Org/libmatroska.git
$ cd libebml/
$ mkdir build
$ cd build/
$ sudo apt install cmake
$ sudo apt install gcc
$ sudo apt install g++
$ cmake ..
$ make
$ sudo make install
$ cd ..
$ cd libmatroska/
$ mkdir build
$ cd build/
$ cmake ..
$ make
$ sudo make install
$ cd ..
$ cd mkvtoolnix/
$ ./autogen.sh
$ sudo apt install libogg-dev
$ sudo apt install libvorbis-dev
$ rake
$ git submodule init
$ git submodule update
$ sudo apt install zlib1g-dev
$ sudo apt install libboost1.65-all-dev
$ sudo apt install docbook-xsl
$ sudo apt install libxslt-dev
$ sudo apt install libxml2-dev
$ sudo apt install libxslt1-dev
$ sudo apt install libxml2
$ sudo apt autoremove
$ sudo apt install xsltproc
$ ./configure
$ rake
$ sudo rake install
$ mkvmerge -h
$ mkvextract -h
$ mkvinfo -h
$ mkvpropedit -h

Jun 22, 2019

Raspberry Pi

First start with raspberry!

1. Download Raspberry Pi OS Lite image

Official site: https://www.raspberrypi.org/software/operating-systems/

2. Copy image to SD card
 

3. First connection

login: pi
password: raspberry

4. Enable SSH

$ sudo update-rc.d ssh defaults
$ sudo su
$ systemctl enable ssh.socket
$ exit
$ sudo reboot

5. Update repositories

$ sudo apt-get update

6. Change keyboard layout

$ sudo raspi-config

Localization Options
    Change Keyboard Layout
        Choose your keyboard or one of the generics
            English (US)

$ sudo reboot

7. Configure wireless network

Fine your AP

$ sudo iwlist wlan1 scan | grep ESSID

Add info about access point to config file

$ vim /etc/wpa_supplicant/wpa_supplicant.conf

network={
  ssid="bla-bla-bla"
  psk="secret password"
}

Set IP address

$ sudo vim /etc/network/interfaces

allow-hotplug wlan0
iface wlan0 inet static
address 192.168.88.8
netmask 255.255.255.0
gateway 192.168.88.1
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

Set country for Wi-Fi (to activate 5Ghz)

via terminal:
$ sudo iw reg get
$ sudo iw reg set US

via raspi-config
$ sudo raspi-config
Localisation Options
  Change Wi-fi Country
    US United States
      OK
        Finish.

8. Install KODI
sudo apt-get install kodi
9. Install torrent client

$ sudo apt-get install transmission-daemon

qbit is better

7. Install vim

$ sudo apt-get install vim

8. Настройка Locale

$ sudo dpkg-reconfigure locales
en_US.UTF-8 UTF-8
ru_RU.UTF-8 UTF-8

In iTerm disable the checkbox "Preferences>Profiles>Default>Advanced>International>Set locale variables automatically on startup"

9. Connect remote usb drive

Identify The Devices Unique ID:
$ cat /var/log/messages | tail
$ sudo fdisk -l /dev/sda
$ ls -l /dev/disk/by-uuid/ | grep sda1

Auto Mount Configure:
$ sudo vim /etc/fstab

UUID=63AB615E7F0C41A6 /media/2tb ntfs-3g auto,nofail,noatime,users,rw,uid=pi,gid=pi 0 0
UUID=66f72624-fda3-0bf6-41f1-1e0d4b1df6b0 /media/4tb ext4 rw,suid,dev,exec,auto,users,nofail 0 0

$ sudo mkdir /media/2tb
$ sudo chown -R pi:pi /media/usb

# for ext4 uid parameters are unavailable. Root permissions will be changed automatically to User permission after mounting.

$ sudo mkdir /media/4tb

$ reboot

10. Настройка transmission

$ sudo systemctl stop transmission-daemon

$ sudo vim /etc/transmission-daemon/settings.json
"upload-limit": 300,
    "upload-limit-enabled": 1,
    "download-dir": "/media/usb/Downloads",
    "download-limit": 1000,
    "download-limit-enabled": 1
"rpc-whitelist": "127.0.0.1,<your-ip>"

$ sudo systemctl start transmission-daemon

11. Подключение к transmission (transmission - transmission)

http://<raspberry-ip>:9091/transmission

########################################

Problem 1: Cannot open access to console, the root account is locked.

1. Mount SD card to windows machine
2. Edit cmdline.txt
    Add to the end of file: init=/bin/bash
3. Start Raspberry Pi
4. Remount root partition to RW:
    $ mount -o remount,rw /dev/mmcblk0p2 /

5. Fix fstab file
    $ vim /etc/fstab

6. Mount SD card to windows machine and remove latest changes in cmdline.txt
7. Start Raspberry Pi

- How to install new locale?

$ sudo vim /etc/locale.gen

uncomment ru_RU.UTF-8, en_US.UTF-8

$ sudo locale-gen ru_RU.UTF-8
$ sudo locale-gen en_US.UTF-8

$ sudo update-locale en_US.UTF-8

#####

Kubernetes

kubectl installation $ curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl...