Jan 22
2021
Create new bridge
sudo ip link add <bridge-name> type bridge
Add interface to bridge
sudo ip link set <ethX> up
sudo ip link set <ethX> master <bridge-name>
Add IP address to bridge and bring it up
sudo ip address add dev <bridge-name> 192.168.0.90/24
sudo ip link set dev <bridge-name> up
Create file bridged-network.xml
<network>
<name>bridged-network</name>
<forward mode="bridge" />
<bridge name="<bridge-name>" />
</network>
Add bridged-network to our KVM
sudo virsh net-define bridged-network.xml
Activate network and set autostart
sudo virsh net-start bridged-network
sudo virsh net-autostart bridged-network
Verify
virsh net-list --all
Jan 8
2021
STOP VM !
Add +5G do disk
qemu-img resize chr-7.2.img +5G
Change disk size to 20G
qemu-img resize chr-7.2.img 20G
This example will convert a raw image file named image.img to a qcow2 image file.
qemu-img convert -f raw -O qcow2 image.img image.qcow2
Rescan resized partition
partprobe /dev/vdb
or
growpart /dev/vdb 1
Resize partition
resize2fs /dev/vdb1
Useful commands
virsh destroy vm_name
virsh list
virsh edit vm_name
Set CPU resources
virsh vcpucount <vm_name>
virsh setvcpus <vm_name> <max-number-of-CPUs> --maximum --config
virsh setvcpus <vm_name> <number-of-CPUs> --config
virsh setvcpus <vm_name> <number-of-CPUs> --live
Aug 8
2020
Run linux from Linux Live (debian.ubuntu, slackware tec.)
Determine what is your main partition
Example output:
Disk /dev/md2: 9.77 GiB, 10495328256 bytes, 20498688 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/md3: 221.88 GiB, 238236860416 bytes, 465306368 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/md1: 9.77 GiB, 10495328256 bytes, 20498688 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/md0: 3.91 GiB, 4203020288 bytes, 8209024 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
create mount point and mount root partition
mkdir /mnt/md0
mount /dev/md0 /mnt/md0
Mount the necessary file system directories by running the following commands:
mount -t proc /proc /mnt/md0/proc
mount –rbind /sys /mnt/md0/sys
mount –rbind /dev /mnt/md0/dev
Mount /usr and /var partition if necessary
mount /dev/md1 /mnt/md0/usr
mount /dev/md2 /mnt/md0/var
Chroot to md0
chroot /mnt/md0
Dec 21
2018
timedatectl set-local-rtc 1
Nov 16
2018
If you installed a new kernel, it is possible to even reconfigure the kernel module with the new driver. To do this, run the following command in the terminal:
sudo dpkg-reconfigure nvidia-390
Sep 14
2018
add forceEnable
config into your config/bootstrap.php
if (Configure::read('debug')) {
Configure::write('DebugKit', ['forceEnable' => true]);
Plugin::load('DebugKit', ['bootstrap' => true]);
}
in config/app.php
in option "Datasources": create new sub option like this:
'debug_kit' => [
'className' => 'Cake\Database\Connection',
'driver' => 'Cake\Database\Driver\Mysql',
'persistent' => false,
'host' => DB_HOST,
'port' => DB_PORT,
//'port' => 'non_standard_port_number',
'username' => DB_ACC,
'password' => DB_PASS,
'database' => DB_NAME,
//'encoding' => 'utf8mb4',
'timezone' => 'UTC',
'flags' => [],
'cacheMetadata' => true,
'log' => false,'quoteIdentifiers' => false,
'url' => env('DATABASE_URL', null),
]
upgrading debugKit
composer require --dev cakephp/debug_kit "~3.16.6"
loading debugKit
bin/cake plugin load DebugKit
Jul 19
2018
For apache
sudo certbot
0 0,12 * * * /opt/certbot/bin/python -c ‘import random; import time; time.sleep(random.random() * 3600)’ && /usr/bin/certbot renew -q
just get a certificate with apache running
sudo certbot certonly --apache
just get a certificate (stop apache first)
sudo certbot certonly --standalone
just get a certificate on Slackware
sudo certbot certonly --apache --apache-server-root /etc/httpd --apache-vhost-root /etc/httpd/sites-enabled --apache-challenge-location /etc/httpd -d rotmanka.pl,www.rotmanka.pl
revoke a cetificate
sudo certbot revoke --cert-path /etc/letsencrypt/live/rotmanka.pl/fullchain.pem
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Would you like to delete the certificate(s) you just revoked, along with all
earlier and later versions of the certificate?
(Y)es (recommended)/(N)o:
Jul 22
2016
doveadm pw -s MD5-CRYPT -p password | sed 's/{MD5-CRYPT}//'
update admin set password=’CRYPTED PASSWORD’ where username=’USERNAME’;