2017-03-29

OpenVPN mit DS-Lite IPv6 Anschluss bei Vodafone/Kabel Deutschland


Manuel Bernhardt hat eine Anleitung veröffentlicht, wie man bei einem DualStack-Lite Anschluss ohne IPv4 Adresse OpenVPN einrichtet aber wenn man dahinter einen IPv4 Server mit z.B. wie Plex nutzen will:
https://blog.nerdingham.de/2013/02/27/verbinden-von-privaten-ipv4-netzen-uber-reine-ipv6-internet-anschlusse

Vielen Dank dafür!

Ich habe selbst lange nach so einer Lösung gesucht und hoffe, dass man seinen Artikel durch diesen Post leichter findet.


Einschränkung

Derzeit ist das Setup nicht für überall geeignet, da das Netz vom Client am OpenVPN-Server hinterlegt werden muss.
Ich will mich damit bei Gelegenheit noch beschäftigen, so dass man z.B. auch von unterwegs den VPN uneingeschränkt nutzen kann.

2016-11-15

Ford Focus ST Error Codes P2127 and P0299, Engine error, doesn't start - replace battery!

Deutsche Version
My Focus ST Mk 2 started to show these two error codes:

  • P2127 Throttle/Pedal Position Sensor/switch E Circuit Low Input
     
  • P0299 Turbo/Supercharger Underboost
     


After shifting it took 1-2 seconds until it was possible to accelerate, but it drove. The errors came and go sporadically. This morning, the car didn't start at all.
At first I thought this is going to be expensive since I could only find answers leading to turbo and sensor issues. But I couldn't find the combination of these two codes in Google, so I hope my post will help somebody!
I called the ADAC (the German AAA) and the guy quickly recognized that the battery was dead and needs to be replaced. He jump started the car and then I drove for an hour to recharge the battery. I will know tomorrow if that helped and then I can drive to buy a new battery :)

PS: No error after 2 weeks, so it was definitely the battery. 

Ford Focus ST Fehlercodes P2127 und P0299, Motorfehler, startet nicht - Batterie tauschen!

English version
Mein Focus ST Mk 2 zeigte vor Kurzem sporadisch zwei Fehlercodes:

  • P2127 Antriebsstrang - Throttle/Pedal Position Sensor/switch E Circuit Low Input (Gaspedalsensor)
     
  • P0299 Turbo/Supercharger Underboost (Saugrohrdruck zu niedrig)
     



Nach einem Gangwechsel hat er erst nach 1-2 Sekunden wieder Gas angenommen, fuhr aber erst noch. Die Fehler waren dann zwischendurch auch mal weg aber kam wieder. Heute morgen startete er gar nicht mehr.
Ich dachte erst, das wird sicher teuer, in Google findet man dazu nur Probleme mit Sensoren und dem Turbo. Die Kombination aus beiden Codes habe ich in Google gar nicht gefunden. Daher der Post, ich hoffe, er hilft anderen!
Der ADAC war da und hat gleich erkannt, dass zum Glück nur die Batterie leer war. Sie ist schon alt und muss getauscht werden, was ich morgen auch mache. Auf den Rat vom netten gelben Engel bin ich eine Stunde Auto gefahren um die Batterie wieder etwas aufzuladen, nachdem er überbrückt hat. Es wird sich morgen früh zeigen, ob das etwas gebracht hat.

PS: Nach 2 Wochen immer noch keine weiteren Fehler! War also definitiv die Batterie.

2016-05-24

"E:Failed to sysMapFile" Cyanogenmod 13 Nightly Update schlägt fehl [UPDATED]

English version

Ich benutze CM13 Nightly auf meinem Moto G (peregrine), was ziemlich rockt. Jetzt geht aber auf einmal der eingebaute Update-Mechanismus nicht mehr. Im Recovery kommt dieser Fehler:

E:Failed to sysMapFile /path/to/update.zip

Es hat sich herausgestellt, dass das passiert, wenn man seine SD-Karte als internen Speicher formatiert und noch eine alte 2.x Version von TWRP drauf hat.

Danke an "chriscjs" vom Cyanogenmod Forum, er hat mir den entscheidenden Tipp gegeben!

Was ist also der einfachste weg, das Recovery zu aktualisieren? Man braucht gar kein adb oder fastboot, man kann es einfach vom Play Store herunterladen, sehr schön!

Dazu muss man den root-Modus anschalten: Gehe in die Einstellungen -> Über das Gerät -> 7 Mal auf die Build-Nummer tippen -> zurück, Entwickler-Menü und hier root anschalten.

Zusätzlich braucht man busybox, was man auch im Play Store bekommt. Sobald das installiert ist, kannst du mit der TWRP app das Recovery auf den neusten Stand bringen.
Bei mir kam noch ein Fehler, dass Update wäre fehlgeschlagen. Funktioniert hat es aber trotzdem.

Jetzt kann ich die Nightlies wieder wie üblich installieren :)

PS: Ein Update hat geklappt aber das nächste hat mir wieder einen Fehler gebracht. Um es manuell zu installieren, wähle in TWRP "Install" und dann navigiere zu /sdcard/cmupdater.

PPS: Das nightly vom 2016-08-16 ist ohne das letzte Problem auf Anhieb durchgelaufen :)

"E:Failed to sysMapFile" Cyanogenmod 13 nightly update fails [UPDATED]

Deutsche Version

I'm running CM13 nightly on my Moto G peregrine, which rocks. Recently the installation process of a nightly update failed with this error while in recovery:

E:Failed to sysMapFile /path/to/update.zip

It turned out that this was because I formatted my SD card as internal storage and I ran an old 2.x version of TWRP which cannot handle that.
Thanks to user "chriscjs" from the Cyanogenmod forums to point me in the right direction!

So how is the easiest way to update the recovery? It turns out, you don't need adb or fastboot, you can just install it from the play store! Very nice!

The next step is to enable root: Go to settings -> About Device -> Tap 7 times on the Build Number -> go back to find the Developer menu where you can enable root.

As a requirement, busybox is needed, also available at the play store. Once installed, you can use the TWRP app to update the recovery.
I got an error that the recovery update failed, but it worked anyway.

Now I can install the nightly builds as usual :)

PS: One update worked but the now I get another error. To install new updates, in TWRP choose "Install", then navigate to /sdcard/cmupdater to install the update.

PPS: The nightly 2016-08-16 ran fine without the last issue :)

2016-02-22

VMware ESXi PSOD "GP Exception 13" could mean your CPUs don't match

Deutsche Version

Did you recently add another CPU to your VMware ESXi host? Now it doesn't boot but only shows this Pink Screen Of Death?



It turned out this happens when you install the same CPU model with a different stepping. It's not good for you!

You can check it with VMware's CPU checker: 
https://my.vmware.com/web/vmware/details?productId=136&downloadGroup=CPU%20IDENTIFICATION%20UTILITY

It should show "All CPUs are identical" obviously.

Alternativly, you can boot from a Linux Live-CD eg., GRML. Then read the stepping like this:


grep stepping /proc/cpuinfo


Of course the stepping should be identical.

VMware ESXi PSOD "GP Exception 13" bei unterschiedlichem CPU-Stepping

English version

Hast du eine zusätzliche CPU in deinen VMware ESXi Host eingebaut? Jetzt bootet er nicht mehr und zeigt diesen Pink Screen Of Death?



Das passiert, wenn es zwar das selbe CPU-Modell ist, aber nicht das gleiche Stepping. It's not good for you!

Mit dem VMware CPU checker kann man das prüfen: 
https://my.vmware.com/web/vmware/details?productId=136&downloadGroup=CPU%20IDENTIFICATION%20UTILITY
Es sollte natürlich "All CPUs are identical" anzeigen.

Alternativ kann man eine Linux Live-CD wie GRML booten. Das Stepping kann man so checken:

grep stepping /proc/cpuinfo

Dabei sollte natürlich überall das selbe Stepping angezeigt werden.

IPMI Konsole: "Unable to find certificate in Default Keystore for validation" Java Fehler

Die Lösung findest du hier: https://kryptogeld24.de/de/2016/02/22/ipmi-java-fehler/


IPMI Console: "Unable to find certificate in Default Keystore for validation" Java Error

The solution has moved here: https://kryptogeld24.de/blog/2016/02/22/ipmi-java-error/

2016-02-14

Now with systemd! Prevent Linux NAS from standby while using Kodi, Plex, DLNA, Samba, FireTV, Resilio-sync

Deutsche Version

See below for the old version for systems with pm-utils (and sysvinit).

To prevent the standby for my NAS when it's in use, systemd proves much more difficult. There are hooks which can be run when a suspend is activated, but they cannot stop the suspend from happening.
There is a inhibitor system built in to stop a suspend or hibernate (systemd-inhibit) but that's bugged and as far as I'm aware not fixed in Linux Mint 18.1 (based on Ubuntu 16.04). It's running systemd 229-4ubuntu16 and it might be fixed in a future version. But since I don't want to ruin my system by upgrading only systemd or switching to Ubuntu 16.10, at least for now, I got another solution:

I disabled the standby from the system and wrote a suspend script myself!
The script checks for:
- Samba activity
- Plex and DLNA activity
- SSH Sessions
- if a backup with resilio-sync is running
Only if there was no such activity, a suspend is triggered after 30 minutes.

Since it's headless, I don't need to know if the system is used with keyboard and mouse. If you do use it like this, check out another solution with xprintidlehttp://askubuntu.com/questions/820847/shutdown-after-idle-but-not-if-the-samba-server-is-in-use

See the installation description in the script to see how to use it.
Download it here to make sure you have the correct newlines: 

You can see what the script is doing in: /var/log/systemd-NAS-suspender.sh.log
And what systemd is doing with this command: journalctl -b -u systemd-suspend 


systemd-NAS-suspender.sh

#!/bin/bash

# 2017-02-24, ThingsHardToFind.blogspot.de



# This script suspends the system if there no certain services were used in the last 30 minutes.
# The counter is reset after every use.
#
# Installation:
# Make sure to disable any other suspend methods.
# Don't run it with CRON because the script runs in a loop and will never exit.
# 1. copy the file to eg. /usr/local/bin/
# 2. run it on startup eg. in /etc/rc.local like this: /usr/local/bin/systemd-NAS-suspender.sh &


SUSPEND_AFTER=30 # minutes
LOGFILE="/var/log/$(basename $0).log"
RESILIO_IP=192.168.1.12
SAMBA_PATH="/storage/mango"

log_and_reset () {
    echo "$(date "+%F %H:%M:%S") idle before: $IDLE minutes (suspend after $SUSPEND_AFTER minutes)" >> "${LOGFILE}"
    echo "$(date "+%F %H:%M:%S") $@" >> "${LOGFILE}"
    IDLE=0
}

IDLE=0
while true;do
    NETSTAT=$(netstat -aptun)
    # Plex sessions and DLNA sessions
    s=$(curl localhost:32400/status/sessions 2>/dev/null | sed -n "s/.*MediaContainer size=\"\(.*\)\".*/\1/p" )
    [ $((s)) -gt 0 ] && log_and_reset "Plex session active, cancel suspend"
    dlna=$(echo "${NETSTAT}"|egrep '32469.*EST')
    [ -n "$dlna" ] && log_and_reset "Plex session active, cancel suspend"

    # SSH
    sshactive=$(echo "${NETSTAT}"|egrep ':22.*EST')
    [ -n "$sshactive" ] && log_and_reset "SSH session active, cancel suspend"

    # Resilio-sync is active to my backup server
    rslsync=$(echo "${NETSTAT}"|egrep "${RESILIO_IP}.*EST.*rslsync")
    [ -n "$rslsync" ] && log_and_reset "rslsync to ${RESILIO_IP} active, cancel suspend"

    # Samba. unfortunately smbstatus doesn't report all open files so we check lsof too.
    s=$(smbstatus -L|awk '{print $6}'|sort -u|egrep -v '^$|NONE|Oplock')
    s2=$(lsof -n -c smbd 2>/dev/null|egrep "REG.*${SAMBA_PATH}")
    [ "x${s}${s2}" == "x" ] || log_and_reset "Samba session active, cancel suspend"

    # suspend if IDLE time is reached
    if [ "${IDLE}" -ge "${SUSPEND_AFTER}" ] ;then
        log_and_reset "suspending"
        systemctl suspend # if the suspend doesn't work, you can try with -i
    fi

    sleep 60 # wait 1 minute until the next check
    IDLE=$((IDLE+1))
done
# vim:sta:sw=4:ts=4


Older section with pm-utils:


I set up a new home NAS and Plex Mediacenter on Linux Mint 17.2 (based on Ubuntu 14.04) and I wanted it to go into standby when it's not used. The problem is, that it also activates standby when Samba, Plex, Kodi (on FireTV) or DLNA is used.

Collin Delker posted a very good solution for Plex, thanks!
http://www.collindelker.com/wp/2015/07/plex-linux-prevent-sleep/

I took this and added functions to prevent sleeping when using Plex via DLNA (port 32469), this was important for the Playstation 3.
Note that the standby only works if X is running. I access X via VNC to set up the standby time since the box doesn't have a display attached. If somebody knows how to set up standby without X or how the standby can be set to 2 hours, let me know in the comments!

Just like Collin, I use Wake-on-LAN (WoL) to wake it up: https://www.depicus.com/wake-on-lan/

The best Android app: https://play.google.com/store/apps/details?id=co.uk.mrwebb.wakeonlan

Each script must be placed in /etc/pm/sleep.d/
The suspend actions are logged here: /var/log/pm-suspend.log


05_plexkeepawake

#!/bin/bash
 case "$1" in
     suspend|suspend_hybrid|hibernate)
        s=$(curl localhost:32400/status/sessions 2>/dev/null | sed -n "s/.*MediaContainer size=\"\(.*\)\".*/\1/p" )
        if [ $s -gt 0 ];then
                echo "Plex session active, cancel suspend"
                exit 1;
        fi
        dlna=$(netstat -aptun|egrep '32469.*EST')
        if [ -n "$dlna" ];then
                 echo "Plex session active, cancel suspend"
                 exit 1;
        fi
esac




06_sambakeepawake


#!/bin/bash
MOUNTPOINT=mango
case "$1" in
 suspend|suspend_hybrid|hibernate)
 s=$(smbstatus -L|awk '{print $6}'|sort -u|egrep -v '^$|NONE|Oplock')
 s2=$(lsof -n 2>/dev/null|egrep 'smb.*REG.*${MOUNTPOINT}')
 if [ "x${s}${s2}" == "x" ]; then
   true
 else
   echo "Samba session active, cancel suspend"
   exit 1;
 fi
esac

07_ssh_keepawake


#!/bin/bash
case "$1" in
     suspend|suspend_hybrid|hibernate)
        sshactive=$(netstat -aptun|egrep '22.*EST')
        if [ -n "$sshactive" ];then
                 echo "SSH session active, cancel suspend"
                 exit 1;
        fi

esac

08_btsync (change the TARGET_IP)

#!/bin/bash
TARGET_IP=192.168.1.12
case "$1" in
     suspend|suspend_hybrid|hibernate)
        btsync=$(netstat -aptun|egrep '${TARGET_IP}.*EST.*btsync')
        if [ -n "$btsync" ];then
                 echo "btsync active, cancel suspend"
                 exit 1;
        fi
esac


Next step: re-animate my OpenVPN server on my Raspi to access Plex from outside and include a WoL command when connecting.