Bitbull Tech Notes - home of free minds ...

Why SSH is breaking bash loops and how to get around

[root@kvm2 bin]# seq 3 | while read i; do echo $i; done
[root@kvm2 bin]# seq 3 | while read i; do echo $i ; ssh kvm1 date ; done
Wed Sep 13 15:55:46 CEST 2017
[root@kvm2 bin]# for i in $(seq 3) ; do echo $i ; ssh kvm1 date ; done
Wed Sep 13 15:55:54 CEST 2017
Wed Sep 13 15:55:54 CEST 2017
Wed Sep 13 15:55:54 CEST 2017
[root@kvm2 bin]# for i in $(seq 3) ; do echo $i ; ssh -n kvm1 date ; done
Wed Sep 13 15:56:03 CEST 2017
Wed Sep 13 15:56:04 CEST 2017
Wed Sep 13 15:56:04 CEST 2017

Create Windows 7 USB boot media

Not that easy as with linux, but also not that hard

fdisk /dev/sdh    # create partition as shown below

fdisk -l /dev/sdh
   Device Boot      Start         End      Blocks   Id  System
    /dev/sdh1            2048     7864319     3931136    7  HPFS/NTFS/exFAT

mkfs.ntfs -f /dev/sdh1

if=/usr/lib/syslinux/bios/mbr.bin of=/dev/sdh   # use mbr.bin from syslinux package

mkdir /tmp/iso /tmp/usb

mount SW_DVD5_Win_Pro_7_64BIT.ISO /tmp/iso/
mount /dev/sdh1 /tmp/usb/

cp -rv /tmp/iso/* /tmp/usb/

umount /tmp/iso
umount /tmp/usb

Install Kimchi and Ginger on CentOS7 KVM host

This is a nice web-ui for single kvm virt-hosts

I tried a lot of UIs, but this is so far the best opensource kvm web-ui, which is using libvirt for management.
Why is libvirt important?
It keeps your host open to integrate/migrate from/to other virt solutions, it is the one and only standard so far.
If you do not use libvirt, you have the alternative to use pure-qemu to run your VMs, which isn't really an alternative.
Proxmox is using pure qemu comands with own management solution and this is the reason that no-one ever has ever built a Proxmox management integration.
Good for Proxmox business, bad for comunity, so better go the libvirt way.

I am missing the integration of multiple KVM hosts, but hopefully this is not the latest realease of kimchi !

Thanks Kimchi Team to build this web-ui !!!



yum -y install epel-release deltarpm chronyd wget 
yum makecache
yum -y update
yum install libvirt-python libvirt libvirt-daemon-config-network qemu-kvm python-ethtool sos \
          python-ipaddr nfs-utils iscsi-initiator-utils pyparted python-libguestfs libguestfs-tools novnc \
          spice-html5 python-configobj python-magic python-paramiko python-pillow virt-top

systemctl enable chronyd
systemctl restart chronyd
# firefox

yum -y install \

firewall-cmd --add-service kimchid --permanent

systemctl enable wockd nginx
systemctl restart wockd nginx firewalld

Now you can reach the KVM virt UI at:




Install collectd on CentOS 7

Below you find my notes to install collectd on CentOS 7

 yum install epel-release
 yum install -y collectd collectd-rrdtool rrdtool collectd-web httpd
 yum search collectd
 yum -y install collectd-disk collectd-virt # you may skip that step
 systemctl enable httpd collectd
 cat /etc/httpd/conf.d/collectd.conf 
 sed -i 's/# Require all granted/Require all granted/g;s/Require local/# Require local/g' /etc/httpd/conf.d/collectd.conf 
 systemctl restart httpd collectd

Now, you can access collectd by pointing to: http://servername/collectd/bin/index.cgi



domoticz ASPSms gateway via JSON API

With this setting, you can send SMS notifications by ASPSMS gateway.

Domoticz > Setup > Settings > TAB:Notifications > Section: "Custom HTTP/Action"

#FIELD1: aPi-Key-here
#FIELD2: pAssw0rd-here
#FIELD3: SenderName
#TO: 0761112233


Post Data:

{ "UserName": "#FIELD1", "Password": "#FIELD2", "Originator": "#FIELD3", "Recipients": [ "#TO" ], "MessageText": "#MESSAGE", "DeferredDeliveryTime": "", "FlashingSMS": "", "URLBufferedMessageNotification": "", "URLDeliveryNotification": "", "URLNonDeliveryNotification": "", "AffiliateID": "" }

POST Content-Type: application/json


That's all, now you can send out sms by http json api


Home ← Older posts