Montag, 30. Juli 2018

Consumer/Producer jobqueue with the gnu parallel

The hosts.txt file must have atleast one line:

tail /data/p.txt -f | parallel -k --slf hostnames.txt

the /data/p.txt and hostnames.txt one can change on the fly.

Dienstag, 26. Juni 2018

Replacing failed disk in the software raid1

The disk /dev/sda is failing:
cat /proc/mdstat
Remove it from the raid:
cat /proc/mdstat
mdadm --manage /dev/md127 --fail /dev/sda1
mdadm --manage /dev/md126 --fail /dev/sda3
mdadm --manage /dev/md125 --fail /dev/sda2


after replacing the bad disk we should add the new one in to the raid:

dmsetup remove_all
sfdisk -d /dev/sdb | sfdisk /dev/sda

cat /proc/mdstat
mdadm --manage /dev/md127 --add /dev/sda1
mdadm --manage /dev/md126 --add /dev/sda3
mdadm --manage /dev/md125 --add /dev/sda2


Monitor the sync process:
watch cat /proc/mdstat
Every 2.0s: cat /proc/mdstat                                                                                                                                                                             Tue Jun 26 10:33:19 2018

Personalities : [raid1]
md125 : active raid1 sda2[2] sdb2[0]
      2099136 blocks super 1.0 [2/1] [U_]
        resync=DELAYED
      bitmap: 1/1 pages [4KB], 65536KB chunk

md126 : active raid1 sda3[2] sdb3[0]
      477894656 blocks super 1.2 [2/1] [U_]
      [===>.................]  recovery = 19.9% (95154432/477894656) finish=129.8min speed=49130K/sec
      bitmap: 4/4 pages [16KB], 65536KB chunk

md127 : active raid1 sda1[2] sdb1[0]
      8256512 blocks super 1.2 [2/2] [UU]

unused devices:


Montag, 25. Juni 2018

Ovirt 4.2 clean up the image upload hanging process


After the upgrade, some of the hosts are not going to the maintenance mode.
In our case, it was a hanging process of image upload.
To clean the DB:
su – postgres

psql -d engine

select * from image_transfers;
if not empty
truncate image_transfers;

Now you can proceed w/o problems.

Ovirt upgrade from 4.1 to 4.2


yum clean all
yum install http://resources.ovirt.org/pub/yum-repo/ovirt-release42.rpm

yum-config-manager --save --setopt=ovirt-4.1-centos-gluster38.skip_if_unavailable=true
yum-config-manager --save --setopt=ovirt-centos-ovirt41.skip_if_unavailable=true



And finally:

yum update

Donnerstag, 29. März 2018

centos 7 firewall d routing IB to eth network with multihomed server


Add the following to /etc/sysctl.conf: net.ipv4.ip_forward = 1
Apply the sysctl settings: sysctl -p

Add direct rules to firewalld. Add the --permanent option to keep these rules across restarts.
firewall-cmd --zone=public --add-masquerade --permanent
firewall-cmd --direct --add-rule ipv4 nat POSTROUTING 0 -o ens1.801 -j MASQUERADE
firewall-cmd --direct --add-rule ipv4 filter FORWARD 0 -i ib0:3 -o ens1.801 -j ACCEPT
firewall-cmd --direct --add-rule ipv4 filter FORWARD 0 -i ens1.801 -o  ib0:3 -m state --state RELATED,ESTABLISHED -j ACCEPT




credits goes to:
https://www.centos.org/forums/viewtopic.php?t=53819

Mittwoch, 21. Februar 2018

Raspberry pi 3 camera quality vs Moto G5

raspistill --sharpness 100    -q 5 -t 1 -mm average  -ifx denoise -sa 20 -ISO 200 --vstab   -awb  fluorescent  -w 1920 -h 1080    -o /var/www/html/cam/cam.jpg