Bitbull Tech Notes - home of free minds ...

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-port 8001/tcp --permanent

systemctl enable wokd nginx
systemctl restart wokd nginx firewalld

Now you can reach the KVM virt UI at:




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


Modify Debian Package

I found this useful when needed to fix a pre-install error in a debian package.

mkdir another-out-dir
dpkg-deb -x some-deb.deb another-out-dir
dpkg-deb -e some-deb.deb another-out-dir/DEBIAN
# modify another-out-dir/DEBIAN/preinst)
dpkg-deb -b another-out-dir some-deb2.deb
dpkg -i some-deb2.deb

yum check-update: Updateinfo file is not valid XML: ...7/epel/gen/updateinfo.xml', mode 'rt' at 0x4bbe150>

This errors are created hourly on CentOS7 systems by: /etc/cron.hourly/0yum-hourly.cron

I fixed like this:

[root@name1 named]# yum check-update  | tail -2  
Updateinfo file is not valid XML: <open file '/var/cache/yum/x86_64/7/epel/gen/updateinfo.xml', mode 'rt' at 0x4bbe150>
util-linux.x86_64                         2.23.2-33.el7_3.2              updates
webmin.noarch                             1.840-1                        Webmin 

[root@name1 named]# yum clean all

[root@name1 named]# rm -rf /var/cache/yum/*

[root@name1 named]# yum makecache

[root@name1 named]# yum check-update  | tail -2  
util-linux.x86_64                         2.23.2-33.el7_3.2              updates
webmin.noarch                             1.840-1                        Webmin 

**** ERROR IS GONE ****



SANNCE 20$ pan/tilt night vision camera hacked into domoticz

On Aliexpress I found this impressive 20$ cam: SANNCE WIFI IP CAM

The cam works quite well, assigning IP with mobile app is some kind of pain, but anyway
After integrating into WLAN with Andorid app (google: sannce wifi cam setup) you can reach the cam on port 81.

The cam has following functionality:

  • pan tilt camera motor
  • auto IR night vision leds
  • motion based alert trigger
    • wlan nic
    • ftp upload on alert
    • email on alert
    • record video on alert


I needed to integrate this cam into mi domoticz home automation system as much as possible.
So I proceeded this way:

  • hack into the cam console
    telnet is running, but no root pw is known
    cam seems to be affected by xss attacks:
    so i tried to configure ftp upload with user: $(telnetd -p25 -l/bin/sh)
    Then hit test, and enjoy telnet server on port 25 without password auth.
  • Modify the scripts to trigger domoticz event on motion
  • /system/init/
    export PATH=/system/system/bin:$PATH
    mkdir -p /tmp/Wireless/RT2870STA
    cp /system/RT2870STA.dat  /tmp/Wireless/RT2870STA/
    mkdir -p /tmp/Wireless/RT2870AP
    cp /system/RT2870AP.dat /tmp/Wireless/RT2870AP/
    ulimit -HSn 4096
    /system/system/bin/wifidaemon &
    /system/bin/ &
    /usr/sbin/telnetd -p24 -l /bin/sh
  • /system/bin/
    while true ; do 
    /usr/bin/tail -fn0 /system/param/log?.txt | /usr/bin/awk '/alarm is happen for motion/ {system("/system/bin/")}
    /alarm is clear/ {system("/system/bin/")}'
    sleep 1 ; done
  • /system/bin/
    echo alert
    wget -q -O -  "http://sensor:sensor@"
    exit 0
  • /system/bin/
    echo clear
    wget -q -O - "http://sensor:sensor@"
    exit 0

That's it, now you have a fully integrated webcam, that can be used as:

  • Virtual switch (motion sensor), triggered by http events above (,
  • domoticz webcam
    User: visitor #set up on cam
    PW: secret
    Image URL: snapshot.cgi?user=visitor&pwd=secret

Now you can trigger push notification and integrate it in your fully armed home automation system!



Newer posts → Home ← Older posts