maltefiala

Functions

Colleague: “No, you cannot do functional programming in Python!”

Me: “Hold my pretzel.”

multiinsertL = (lambda list, new, old:
                [] if not list
                else [new, old, *multiinsertL(list[1:], new, old)] if list[0] == old
                else [list[0], *multiinsertL(list[1:], new, old)])

Digital Ocean Blocking IPv6 Mail Traffic && A Python Search and Replace One Liner

I got nearly insane yesterday, so let this be your warning: Digital Ocean is blocking IPv6 mail traffic…. on purpose.

To deactivate IPv6 in RHEL 7, go to /etc/sysconfig/network-scripts/ifcfg-eth0, change IPV6INIT=yes to IPV6INIT=no and reboot. I have to admit, it would have been far better to leave IPv6 enabled and route mail traffic over IPv4. Anyway, I got distracted by list comprehensions and generator expressions, which resulted in this one-liner to deactivate IPv6 “automatically” (valid only for RHEL derivates and Python > 3.3):

Continue reading

Changing lost Admin Passphrase on Windows 7 Bitlocker encrypted drives

I don’t know what happened, but a customer of mine forgot the Admin account passphrase. Maybe forgot was not the right way to put it, as the one it should have been did not work anymore. My best guess was my customer changed it himself and couldn’t remember. But saying that out loud would be treason so I just kept my mouth shut and was looking for a way to reset the passphrase. Something that turned out to be a nightmare as my customer did not make a recovery cd.

Continue reading