PiHole on Centos8

The PiHole installer fails due to unresolved dependencies. Centos8 does not provide the fastcgi for lighttpd. A workaround is provided here: <#link>

 <- COPY START
if [ ! -f "/usr/local/sbin/lighttpd" ]; then
dnf install -y autoconf make automake libtool pcre-devel zlib-devel bzip2-devel git

git clone https://git.lighttpd.net/lighttpd/lighttpd1.4.git
cd lighttpd1.4
./autogen.sh
./configure --disable-dependency-tracking
make
make install

cat << EOF > /etc/systemd/system/lighttpd.service
[Unit]
Description=Lightning Fast Webserver With Light System Requirements
After=syslog.target network-online.target

[Service]
PIDFile=/var/run/lighttpd.pid
EnvironmentFile=-/etc/sysconfig/lighttpd
ExecStart=/usr/local/sbin/lighttpd -D -f /etc/lighttpd/lighttpd.conf

[Install]
WantedBy=multi-user.target
EOF

systemctl daemon-reload
systemctl enable lighttpd

mkdir -p /srv/www
mkdir -p /etc/lighttpd/conf.d
mkdir /etc/lighttpd/vhosts.d
cp doc/config/*.conf /etc/lighttpd/
cp doc/config/conf.d/*.conf /etc/lighttpd/conf.d

groupadd lighttpd
useradd -r -M -g lighttpd lighttpd

mkdir /var/log/lighttpd
chown lighttpd: /var/log/lighttpd
fi

setenforce 0
sed -i "s/^SELINUX=enforcing/SELINUX=permissive/" /etc/selinux/config

dnf install -y epel-release php-json git

git clone --depth 1 https://github.com/pi-hole/pi-hole.git Pi-hole
cd "Pi-hole/automated install/"
sed -i "s/lighttpd\slighttpd-fastcgi//" basic-install.sh
chmod +x basic-install.sh
./basic-install.sh
# <- COPY END

Ubuntu 18.04 LTS upgrade finished.

with still some time left from support point of view, I decided to upgrade to next LTS release.

Upgrade went in smoothly with only a few changes required to the sshd conf. Reminder to myself, next time remove the TLS1.3 apache ppa before starting the upgrade.

Ubuntu 17.10 and VMWare Workstation 12.5

Und wieder funktioniert VMware nicht out of the box :/


sudo -s
cd /usr/lib/vmware/modules/source
tar xvf vmmon.tar
tar xvf vmnet.tar
wget -O ./vmmon-only/linux/hostif.c https://raw.githubusercontent.com/mkubecek/vmware-host-modules/b50848c985f1a6c0a341187346d77f0119d0a835/vmmon-only/linux/hostif.c
vim vmnet-only/bridge.c

——————————————————————–

639c639
< atomic_inc(&clone->users);
---
> atomic_inc((atomic_t*)&clone->users);

——————————————————————–

cd vmmon-only/
make
cd ../vmnet-only/
make
cd ..
mkdir /lib/modules/4.13.0-16-generic/misc
cp *.o /lib/modules/4.13.0-16-generic/misc
insmod /lib/modules/4.13.0-16-generic/misc/vmmon.o
insmod /lib/modules/4.13.0-16-generic/misc/vmnet.o
rm /usr/lib/vmware/lib/libz.so.1/libz.so.1
ln -s /lib/x86_64-linux-gnu/libz.so.1 /usr/lib/vmware/lib/libz.so.1/libz.so.1
vmware-networks --start
exit

# run vmware as normal user
/usr/lib/vmware/bin/vmware

prime!

485650789657397829309841894694286137707442087351357924019652073668698513401047237446968797439926117510973777701027447528049058831384037549709987909653955227011712157025974666993240226834596619606034851742497735846851885567457025712547499964821941846557100841190862597169479707991520048667099759235960613207259737979936188606316914473588300245336972781813914797955513399949394882899846917836100182597890103160196183503434489568705384520853804584241565482488933380474758711283395989685223254460840897111977127694120795862440547161321005006459820176961771809478113622002723448272249323259547234688002927776497906148129840428345720146348968547169082354737835661972186224969431622716663939055430241564732924855248991225739466548627140482117138124388217717602984125524464744505583462814488335631902725319590439283873764073916891257924055015620889787163375999107887084908159097548019285768451988596305323823490558092032999603234471140776019847163531161713078576084862236370283570104961259568184678596533310077017991614674472549272833486916000647585917462781212690073518309241530106302893295665843662000800476778967984382090797619859493646309380586336721469695975027968771205724996666980561453382074120315933770309949152746918356593762102220068126798273445760938020304479122774980917955938387121000588766689258448700470772552497060444652127130404321182610103591186476662963858495087448497373476861420880529443

openHAB + SMA WebBox

Hi,

hab neulich gesehen das man die SAM Webbox (Welche leider  mittlerweile abgekündigt ist. Heutzutage geht alles nur noch in die Cloud der Hersteller) ganz gut per RPC abfragen kann.

Also nix leichter als das:

2x neue Items in der openHAB config eingebracht:

Number GriEgyTot “Gesamtertrag” (Solar) {exec=”<[scripts/webbox.sh:300000:JSONPATH($.result.overview[?(@.meta==’GriEgyTot’)][0].value)]”}

Number GriEgyTdy “Tagesertrag” (Solar) {exec=”<[scripts/webbox.sh:300000:JSONPATH($.result.overview[?(@.meta==’GriEgyTdy’)][0].value)]”}

und damit per exec plugin ein cURL Script gestartet:

#!/bin/bash
/usr/bin/curl -X POST –silent -d ‘RPC={“version”:”1.0″,”id”:”1″,”proc”:”GetPlantOverview”,”format”:”JSON”}’ -H ‘content-type:text/plain;’ http://192.168.178.48/rpc

fertig:
Screenshot from 2016-08-19 10-28-58

Quick & Dirty KVM?

I’m using caldav/carddav since years to keep my contacts and calendar data always shared across my devices and more important: keep it private.
For the well known reasons, I keep it in a few virtual machines. To have it rather simply I’m using this shell commands (its more a shell script that is executed at server boot time) to configure networking and start the image:

modprobe tun
echo 1 > /proc/sys/net/ipv4/ip_forward
brctl addbr br0
ifconfig br0 10.0.0.6 netmask 255.255.255.248 up
tunctl -b -u root -t qtap0
brctl addif br0 qtap0
ifconfig qtap0 up 0.0.0.0 promisc
route add -host 10.0.0.1 dev br0
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
6tunnel -6 8443 10.0.0.1 8443
iptables -A PREROUTING -t nat -i eth0 -p tcp –dport 8443 -j DNAT –to 10.0.0.1:8443
qemu-system-x86_64 -enable-kvm -hda cardDAV.qcow2 -m 2048 -net nic,macaddr=52:54:00:12:34:57 -net tap,ifname=qtap0,script=no -vnc none -daemonize

Adding a network bridge, creating an internal private network and configure port forwarding to connect the VM to the outside world.