Montag, 20. September 2021

Alexa Remote Control Shell Script

 It's about time for a new post since a lot of things have changed over the course of the past four years.

First things first though, the good news is there's finally an almost official way to properly use the script with your Amazon Alexa. Luckily all major home automation projects became inspired by the idea of the original script and some inner workings have been discovered by people smarter than me. Michael Geramb of openHAB and Ingo Fischer of ioBroker came up with the idea to proxy the login to Amazon very similar to how a mobile app would.

The result was for example the nodeJs package alexa-cookie2 (by Ingo Fischer). Looking more closely at the result of the login process it became clear that only a single item is required for our purposes. Hence I created a small nodeJS app that will output the token after successfully completing the login.

As not everybody would want to install nodeJS (or run it in Docker) I created packaged binaries using the nodeJS packager pkg.

While the old login flow may still work (for some time) I strongly encourage everybody to try the new cleaner method.

Mittwoch, 7. Juli 2021

Debian on WD My Cloud Home single-bay (MCH) - part 3 (controlling the LED)

 In part 1 Debian Buster was installed via debootstrap. Part 2 discussed how a suitable kernel can be compiled.

Getting the LED to work

Having looked at the wrong places, I finally got the LED control to work. The DTB configures all internal devices and exposes them at /proc/devices/platform.

Aparrently there ar four PWM devices, of which only #3 is enabled. By adjusting the duty cycle one can actually control the LED:

echo 0 > /sys/devices/platform/980070d0.pwm/dutyRate3   # LED off
echo 100 > /sys/devices/platform/980070d0.pwm/dutyRate3 # LED 100% brightness

Samstag, 24. April 2021

ActiveDirectory SSO mit Apache

Sollen Benutzer für Intranet Anwenungen per SSO authentifiziert werden, muss es nicht immer der IIS sein. Dank Kerberos und der flexiblen Authentifizierungsmodule im Apache, klappt auch hier die Anbindung. Häufig ist die Authentifizierung per Kerberos aber nur ein Teil der Anmeldung, Weitere Benutzerinformationen müssen im Fall der Anbindung ans Active Directory zusätzlich per LDAP(S) abgefragt werden. Für beide Zwecke muss im AD ein Proxy-Benutzer eingerichtet sein.

Anlegen eines Active Directory Proxy Benutzers

Samstag, 17. April 2021

Windows LDAPS mit Let's Encrypt Zertifikat

Seit Herbst 2020 erfordert Microsoft Secure Channel Binding für LDAP. Um Drittsysteme dennoch per Simple Bind mit dem Active Directory kommunizieren zu lassen, genügt es allerdings für eine verschlüsselte Kommunikation per LDAPS zu sorgen. Häufig verzichten Anbindungen auf einen Zertifikatscheck (TLS_REQCERT never).

Mit öffentlich gültigen Zertifikaten auf den Domain-Controllern ist das nicht notwendig. Dieser Beitrag zeigt, wie das unter bestimmten Voraussetzungen funktioniert.

Sonntag, 17. Januar 2021

Debian on WD My Cloud Home single-bay (MCH) - part 2 (updated to match latest GPL sources 7.15.0)

 In part 1 Debian Buster was installed on the Western Digital My Cloud Home. Unfortunately the default Kernel lacks quite a bit of features. Compiling our own kernel is desirable. Before we getting started to compile away, some base understanding of the device's boot process is required.