Showing posts with label MISC. Show all posts
Showing posts with label MISC. Show all posts

Jul 6, 2025

Small Solar Plant with Growatt Nexa 2000: Monitoring...

After my first steps with Growatt Nexa 2000 now the challenge is to integrate this device in my monitoring at home. If you are interested: This is the link to my setup and monitoring via Zigbee or getting data from my FritzBox. 

To get the status of the device there are the following options:

  • Mobile app
    Just install the "Shine phone" app and create an account there. With that app you can configure really everything and the data provided there is nicely processed.
  • Web frontend
    Via https://openapi.growatt.com/index it is possible to access all the data provided by Growatt:

With these dashboard you have to export the data manually.

But there is a nice software provided here : https://github.com/mtrossbach/noah-mqtt

This does not only work with NOAH - it is although working with NEXA, because it fetches the data from the web APIs from Growatt.

My approach:

And after that i was able to build my own dashboard in grafana again. With the advantage, that i have hourly graphs as well because the noah-mqtt is sampling every 30s. 

 

Jun 27, 2025

Small Solar Plant with Growatt Nexa 2000

Requirements 

There are many drivers for using solar power at home. Key requirements for me were

  • Storage with off grid functionality
  • Deliver max. 800W on grid (due to german regulation) 
  • Solar input up to 2000W
  • Battery with >1kWh

Decision 

My decision was to buy a Growatt Nexa 2000


Installation (non IT parts) 

Physical installation (wiring, etc.) was easy. Just connect :) 

Installation (IT part) 

Connecting the device to the network was very well explained in the manual and the app confirmed the connection. But:

  • Device is shown as offline in the app
  • In you Wifi you can not find anything like "Nexa" or "Growatt"

What can you do? I tried to delete the device in the app and repeated to onboarding. Best thing you can do is:

WAIT 

Because the device was shown in my network with its serial number 0XXXXXXXXXXXX072 and an IP used (and i could ping it).

After 30 minutes the app started to show the device as "online". But changing the configuration did not work. 

After another wait (may be another 10 minutes) adjusting the operation mode could be change (load first <-> battery first).

Now (after >2h) i was able to start the firmware update (the app signaled from the beginning, that an update has to be installed).

But that stalled by 83% - device went offline (i did a ping all the time). Came back, went offline again, came back, .... Then: close the app, enter app again and firmware version is from 9.05.05.04 to 10.09.07.07 and ping is working faster than before. With stalling at 83% i thought, i lost the device completely but it went well and works better than before...
 

I am not sure, if i just hit an maintenance on Growatts side or the device onbaordings are queued and until you can fully operate, some time has to pass.

Integration

The app is quite nice, but for all other things i have my grafana dashboard. So next is to see, how to extract data from the Nexa.  

I will tell about my attempts in the next weeks :) 

 

Feb 3, 2024

Flashing Tasmota onto a Wifi sensor controller (MHCOZY TH1CH-B1RF)

Today i got a MHCOZY TH1CH-B1RF and installed tasmota:

MHCOZY TH1CH-B1RF is a Wifi temperature and humidity controller:
Product details say:

Users can add the device to the APP eWeLink in order to remotely control connected home appliances or devices. In self-locking mode, customers can remotely turn on/off connected devices immediately. When in inching mode, customers can have two wiring ways to select: * Turn on 1s and then auto-off,* Turn off 1s and then auto-on.

Of course you can stay with the original software, but then you have to integrate EWELINK to you enviroment (which uses port 5353 with some strange multicast mechanism). I want to get the values via HTTP. So the questions is: Can this hardware run tasmota?

If you open this device, you see, that the chip is a PSF-Bxx:

(picture is a screenshot from here: https://templates.blakadder.com/PSF-B.html)

With knowing that, Tasmota can be flashed onto this device:
(all the connects are a little bit tricky, because there are no plugs and you have to constantly touch the contacts with the pins)

  1. Connect GPIO0 with ground (you can use the shielding of the USB connector on the board) 
  2. Insert power via the USB connector
  3. after 5 seconds remove the connection from GPIO0 to ground
  4. connect your serial programmer TX --> chip RX
  5. connect your serial programmer RX --> chip TX
    (i always start with TX --> TX and RX --> RX, which is wrong 🤐 ) 
  6. open tasmotizer.py
    (for installation look here - i chose option 2)
  7. if you choose "backup - save original firmware", then you have to start after the backup with step 1 again.
  8. choose "release" and "tasmota.bin"

  9. click "Tasmotize!"

After a reboot change to the new Wifi "tasmota....XXXX" and enter your Wifi credentials there on 192.168.4.1. And after a reboot you can open the web GUI like this here:

 

(the DHT11 sensor has to be selected for GPIO14)

Now i can get the values via

curl 'http://192.168.178.107/cm?cmnd=status%2010&user=admin&password=XXXX'

"StatusSNS":{"Time":"2024-02-03T19:19:29","DHT11":{"Temperature":24.3,"Humidity":50.0,"DewPoint":13.2},"TempUnit":"C"}}

Jul 30, 2023

Postman: Scratchpad is end of life - Only cloud based workspaces possible --> How to keep the passwords/secrets secure?

Postman is the swiss army knife tool for dealing with HTTP(S) requests. You want to test anything with an GET, PUT, POST, OPTION call? Postman is the way to go.


But some months ago postman announced the following:

Scratchpad was the option to work locally on your PC with postman and nothing was synced to the cloud. That was really cool, because most of the HTTPS requests have to be authenticated in some way (basic auth, secrets for oauth, api-keys, etc...)
From my perspective cloud is a very cool thing, but moving all the sensitive parameters into the postman cloud is not really an option.
So what to do? 
  1. Check alternatives....
    But there is nothing like postman. e.g. the possibility to render the request to a curl, powershell, NodeJS axios, ... call and use this anywhere else....
  2. Remove all sensitive data from your request
    A good step (and just to note: it is bad design, if you ever stored secrets inside the calls :) )
  3. Now the calls do not work anymore....
    :(
But this problem was addressed really a long time ago (more than 4 years ago):


So here the link to the solution:

It is just this easy:use variables and do not fill the initial value!

Here the tests: 
First the local postman:

Second the browser postman:



As you can see: the current values are empty inside the cloud for all entries, which have the inital value not filled...
(By the way: the current value is always a copy of the inital value. If you put there something like test11 and test22, only test1 and test2 will show up in the cloud version).

Jan 22, 2023

Openssl: How to automate (without hitting the carriage return many times)

I think nearly everyone, who administers some PCs or servers has used openssl. And almost everything there is straight forward.

To create your own key and certificate, just run:

openssl req -x509 -sha256 -nodes -days 365 -newkey rsa:2048 \
-keyout privateKey.key -out certificate.crt

 

............+..+.+.................+............+.+......+........+.+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*.+....................+......+.+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*.......+.+.....+...+..........+...............+....................+.+...+..+..........+........+......+.+...+.....+...+.......+..+.+...+...........+....+..+.......+.....+...............+................+......+......+...+......+...+...+..+......+......+.........+....+........+............+..........+.....+...+.......+..+...+.............+...+......+..............+....+...........+....+..+.+..+...+.............+............+...+..+.........+...+...............+...+..........+.........+...+...+...+...............+.........+..+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
..........+.....+.......+.........+..+.............+.....+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*.......+.............+.........+..+....+..+...+.+......+...+.....+.........+.+.....+.+.....+...+.+.....+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*..+......+............................+.....+....+..+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-----
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [AU]:
State or Province Name (full name) [Some-State]:
Locality Name (eg, city) []:
Organization Name (eg, company) [Internet Widgits Pty Ltd]:
Organizational Unit Name (eg, section) []:
Common Name (e.g. server FQDN or YOUR name) []:
Email Address []:
But the problem with that approach:

You have to add the carriage returns for every line after the 5 dashes and then your certificate looks quite ugly (see red colored text):

openssl x509 -text -in certificate.crt -noout

 

Certificate:
    Data:
        Version: 3 (0x2)
        Serial Number:
            0b:01:9a:aa:f1:59:69:33:84:7e:cf:89:69:0c:d5:80:61:82:b5:28
        Signature Algorithm: sha256WithRSAEncryption
        Issuer: C = AU, ST = Some-State, O = Internet Widgits Pty Ltd
        Validity
            Not Before: Jan 22 15:54:43 2023 GMT
            Not After : Jan 22 15:54:43 2024 GMT
        Subject: C = AU, ST = Some-State, O = Internet Widgits Pty Ltd
        Subject Public Key Info:
            Public Key Algorithm: rsaEncryption
                Public-Key: (2048 bit)
                Modulus:
                    00:c6:7d:5a:9f:97:3d:43:9b:e0:19:2f:46:31:5c:
                    82:f0:42:ac:da:a9:e8:d0:91:e0:01:98:05:52:cf:
                    1c:4e:77:53:1a:96:5c:6a:6f:ca:5c:61:a4:5f:14:
                    12:ed:69:ae:50:bb:99:28:48:df:bc:f6:76:c1:63:
                    2b:51:55:ad:bb:62:9f:3a:2b:1f:e7:c3:fd:bb:45:
                    04:c3:88:ee:b1:ba:c6:e2:f7:f1:80:5b:ef:eb:04:
                    fb:ec:82:89:39:c6:33:68:0d:3e:36:62:36:e0:a0:
                    ff:21:5f:74:ad:d2:4b:d4:5d:c4:67:6b:90:a0:8f:
                    1e:4c:80:31:30:2e:8e:5e:9d:62:8a:1d:45:84:5f:
                    d3:09:46:fe:4f:8d:68:c6:54:e4:51:da:e0:64:f8:
                    5d:af:01:2e:79:0c:fe:0b:0f:d6:2e:1b:e6:eb:09:
                    ca:cc:16:3d:92:53:ae:3b:ad:da:67:a5:ef:69:30:
                    7f:e7:53:7c:dd:23:59:c8:8c:6b:b0:a9:fa:fc:4c:
                    c1:44:cf:3f:2f:91:f4:8c:b6:7c:d9:ae:82:6d:96:
                    aa:bb:51:07:3c:2b:12:24:e4:a3:7d:9b:ee:4b:7e:
                    f4:02:0e:bc:b4:35:bd:73:dc:6b:b4:34:36:57:48:
                    72:f2:91:60:2d:79:d9:44:3c:77:76:eb:c7:8a:00:
                    5f:75
                Exponent: 65537 (0x10001)
        X509v3 extensions:
            X509v3 Subject Key Identifier:
                F1:77:6C:19:76:FB:E4:DD:50:2A:1E:01:BE:A1:5C:48:3D:5A:40:68
            X509v3 Authority Key Identifier:
                F1:77:6C:19:76:FB:E4:DD:50:2A:1E:01:BE:A1:5C:48:3D:5A:40:68
            X509v3 Basic Constraints: critical
                CA:TRUE
    Signature Algorithm: sha256WithRSAEncryption
    Signature Value:
        8a:28:28:12:6c:1e:e5:54:86:9b:6e:90:7a:ca:aa:a7:a1:b3:
        b1:43:02:44:e8:9a:59:b2:d6:6e:36:c6:51:3b:9b:f4:91:47:
        40:6f:cf:6d:de:86:8d:dd:2f:9e:44:4c:f8:d3:5a:d3:3a:ef:
        d5:0d:e1:10:b6:64:34:ee:03:4a:f2:de:ff:da:db:a3:93:20:
        13:85:2a:d6:9b:b2:0e:2c:2e:9c:f9:71:ff:32:3b:c3:6b:0a:
        e7:98:2d:30:c9:a6:47:b7:72:84:bb:52:23:11:d6:b7:90:cb:
        98:cd:59:16:b5:8f:70:46:c1:95:90:01:2f:7f:9c:22:ac:29:
        8d:14:97:76:dd:06:56:f8:22:9d:f4:00:9f:40:3c:fb:c2:95:
        63:48:50:ee:ad:17:1b:54:6b:60:0c:d5:3e:66:3b:00:0e:7a:
        33:99:cc:4a:f6:dc:d1:e3:40:ea:8c:66:df:7e:92:e1:a5:e5:
        72:0e:89:ba:87:43:0c:56:70:8c:f2:9b:77:dd:ca:03:8e:24:
        fd:6b:51:d2:3b:b2:df:e4:ff:c2:3c:cb:ab:2e:cd:82:f4:69:
        ad:a3:81:d7:95:d0:68:e1:3f:fc:50:4d:8b:14:b2:82:8c:19:
        2b:06:8a:0e:ef:21:4b:68:4f:e3:1d:53:64:62:97:c8:35:45:
        01:54:d9:10


To avoid that you have just to expand your command with the following parameters:

openssl req -x509 -sha256 -nodes -days 365 -newkey rsa:2048 \
-keyout privateKey.key -out certificate.crt \
-subj "/C=de/CN=schroff.special/OU=MyDepartment"

Typical attributes can be found here:

(Common Name, Organization, Organizational Unit, Country, Location)


Nov 9, 2022

FritzBox monitoring with telegraf, influx and grafana

On year ago i wrote about adding a FritzBox to my monitoring with grafana and influxdb: https://dietrichschroff.blogspot.com/2021/11/fritzbox-monitoring-with-grafana-influx.html

This was done with collectd.

As i wrote in https://dietrichschroff.blogspot.com/2022/09/ubuntu-raspberry-pi-upgrade-to-2204.html i upgraded my raspberry to 22.04 and along with many minor problems, collectd was gone. (and i think it will not be added anymore.)

All other monitorings use telegraf to get the data.

And there is a solution, which provides that:

https://github.com/Schmidsfeld/TelegrafFritzBox/

You can follow the steps on this page. If you get no data - here is the commandline which you should use to test the connection:

python3 ./TelegrafFritzBox/telegrafFritzBox.py -p xxxxxx -i 192.168.178.1 -u fritz8490

And this should be the command, which you use in 

/etc/telegraf/telegraf.d$ cat telegrafFritzBox.conf

The reward is really a very nice dashboard:

 


Nov 5, 2022

Installation and running RaceResult Presenter.exe on Ubuntu

For all who are active in sports and want to run a event with www.raceresult.com:

In our case we have some Linux laptops which we want to use (Windows OS licenses missing).

RaceResult consists some some components

  • SEServer2.exe
  • Presenter.exe
  • CameraServer.exe
  • Transponder.exe
  • Moderator.exe
  • RRWS.exe

We want to run the Presenter.exe on a Linux box. So first step:

Install raceresult software with wine.

Preinstallation step:

winetricks vb6run

Installation step:

wine raceresult_12.4.25.0_386_stable.exe

(the exe is provided by raceresult)

Important thing: to run the Presenter.exe you need the SEServer2.exe running as well. Because RaceResult decided to let this server listen on port 1023, the installation has to be done twice. One with sudo and one without.

For the sudo installation please select all components. For the user installation only the presenter is needed (but you can go with all as well):

Then: start the SEServer 

sudo bash
cd /root/.wine/drive_c/Program Files (x86)/race result/race result 11/SEServer2
wine SEServer2.exe

Startup the presenter as well

cd ~/.wine/drive_c/Program Files (x86)/race result/race result 11/Presenter
wine Presenter.exe

Now the next tricky thing: You got a ses file from raceresult (rot.ses). Copy this in both .wine directories to ./wine/drive_c and the open this ses file in the presenter:




Bam done. :)

Jul 10, 2022

Elster.de: To many request for german government portal...

In Germany, the property tax had to be reformed due to a ruling by the Federal Constitutional Court. So this year everybody got a mail with the request to register his property from july 1st up to the end of the year.

This should be done via ELSTER = electronic tax declaration (explanation of the acronym can be found here)  

I tried this yesterday and today, but the login page does not respond at all.

Today a message was posted on their website (orange box on the screenshot)

Restrictions when using the ElsterSmart app
It is currently not possible to use Mein ELSTER using the ElsterSmart app if the ElsterSmart app and Mein ELSTER are used on different devices (e.g. if you have installed ElsterSmart on your smartphone or tablet, but Mein ELSTER in the browser on your
use PC).

and

Availability Limitations
Due to the enormous interest in the forms for the property tax reform, there are currently restrictions on availability. We are already working intensively on being able to provide you with the usual quality as quickly as possible.

I think just at least 10 million citizens try to follow the request and the on datacenter the servers are on their limit:

Even the status page shows a 404: https://www.elster.de/elsterweb/svs

So let's see if it is possible to follow the request until end of the year or if this deadline gets extended for some years :).
 

 


Nov 8, 2020

Home automation with linux: How to use zigbee sensors on an ubuntu raspberry pi...

To the end of the year i wanted to start a new project: Home automation...

I decided to use a linux system (of course) on a raspberry pi (see the OS installation here) and the zigbee protocol.

The main problem: What packages are needed 

  • to get a communication with zigbee components?
  • to get a website or app to get the data / visualize the data?
  • to set up a daemon/server which controls the devices?

Let's start with the third point: I will try FHEM.

The installation is described here:

https://debian.fhem.de/

wget -qO - http://debian.fhem.de/archive.key | apt-key add -
echo "deb http://debian.fhem.de/nightly/ /" >> /etc/apt/sources.list
apt update
apt upgrade
apt install fhem

After you follow the steps you can check, if FHEM is running with

root@zigbee:/home/ubuntu# netstat -ltnup | grep 8083
tcp 0 0 0.0.0.0:8083 0.0.0.0:* LISTEN 19446/perl

 or just connect to your raspberry via browser: http://zigbee:8083

 
 
and here a screenshot of the goal i want to achieve (maybe with some graphs added):


Here a list of the supported hardware:

https://wiki.fhem.de/wiki/Kategorie:Hardware

and a list of all supported protocols:

https://wiki.fhem.de/wiki/System%C3%BCbersicht#Protokolle


 

 

 

 

Aug 7, 2020

openssl: strange error.... (at first glance) error:2008F002:BIO

Some days ago i wanted to do a check of a certificate of an ip address. No big deal - so i did:
schroff@zerberus:~$ openssl s_client -showcerts  -connect 82.165.229.87.87:443

140011908769088:error:2008F002:BIO routines:BIO_lookup_ex:system
lib:../crypto/bio/b_addr.c:726:Name or service not known
connect:errno=22
So i opened google to find a solution.
But on google i found nothing really helpful.

?

The answer was very easy:
If i read the command line carfully, i would have detected my error:

THE IP ADDRESS WAS INVALID

I wrote an ipv4 with 5 numbers and not with 4...

After using a correct ipv4 number the command worked like expected:
schroff@zerberus:~$ openssl s_client -showcerts -connect 82.165.229.87:443 #
CONNECTED(00000003)
Can't use SSL_get_servername
depth=2 C = US, O = DigiCert Inc, OU = www.digicert.com, CN = DigiCert Global Root CA
verify return:1
depth=1 C = US, O = DigiCert Inc, OU = www.digicert.com, CN = GeoTrust RSA CA 2018
verify return:1
depth=0 C = DE, ST = Rheinland-Pfalz, L = Montabaur, O = 1&1 Mail & Media GmbH, CN = gmx.net
verify return:1
---

Sep 24, 2019

500 blog posts (in 12 years)

Last week i did my 500th posting - not really "run like hell" but i think better than nothing.
Here some statistics:




I think, i will continue for another 500. The exciting point is, wether i will find enough topics, which i am interested in...

Sep 19, 2018

Missing directory in /var/run or /run - tmpfiles.d

Sometimes is happens, that an application/demon refuses to start because of missing files/directories in /var/run.
The first solution is:
  • Create the directory in /var/run
  • Change the permissions
and everything is fine.

Not really.

After the next reboot, the directory is missing again and you have to go for the "first" solution again.

The right solution works like this:
Inside /usr/lib/tmpfiles.d create a myexample.conf file with this content:
        d /var/run/myexample 0755 schroff schroff -
To check if everything is ok run the following command:
        systemd-tmpfiles --create myexample.conf
and you will see:
# ls -l /var/run/ |grep mxexample
drwxr-xr-x  2 schroff schroff   40 19. Sep 22:45 myexample
And this directory will be created with each reboot...

Mar 17, 2018

AVM: Powerline Repeater / Fritz Repeater

Last weekend my Powerline Adpater 546E broke. I tried some restarts but after 1-5 minutes the WLAN went down and the adapter got really hot.

Perhaps the missing mesh functionality was due to a hardware problem which caused this total failure.

Never mind. I ordered a Fritz Box Repeater 1160 and followed the instructions from AVM:
Note: If your repeater is already connected to your FritzBox and you perform the firmware update >6.90, then you have to do the integration via WPS once again (enable WPS on your FritzBox, then press WPS button on the repeater).

After that everything was like expected:

Sep 30, 2017

AVM Fritz: WLAN Mesh with Powerline Repeater does not work

Today i upgraded my FritzBox to FritzOS 6.90:

After the upgrade of the FritzBox i tried to upgrade my Powerline Adapter. But the 6.90 was not shown with inside the update mechanism via GUI.
(Be careful: you have to update your FritzBox first:
https://avm.de/nc/service/downloads/download/show/18332/:
ACHTUNG: Bitte nur installieren, wenn Sie eine FRITZ!Box mit FRITZ!OS >= 6.88 verwenden!
)

So i downloaded the firmare image via this link and installed the new version:

Inside the FritzBox the WLAN mesh can be checked in "Heimnetz -> Heimnetzübersicht":

But no device behind the powerline adapter showed up.
I googled a bit around, but all AVM support pages where deleted. Inside Google cache i found the following:

So the mesh icon is missing at the powerline adapter. A reboot of the fritzbox and the powerline adapter did not change anything.

On AVM website there is an image how it should look like:

But it think, they have a problem with their mesh functionality and removed the 6.90 auto update for the wlan repeaters/powerline adapters and they even removed all support pages for the wlan mesh.

Let's wait for some bug fixes ;-)
(Still remember: These upgrades are just for free)

EDIT: Read the next attempt here.

Ubuntu /etc/alternatives/java et.al.: Using java from external sources | update-alternatives | update-java-alternatives

After some problems with the jdk integrated in ubuntu 16.04 i installed the OpenJDK from http://jdk.java.net/9/.

The software is provided as tarball (tar.gz) and after
tar -xvf ~/Downloads/jdk-9+178_linux-x64_bin.tar.gz
the binaries can be used with
jdk-9/bin/java
...
But there are many links in /etc/alternatives still pointing to the ubuntu jdk:
lrwxrwxrwx 1 root root  41 Jul 11 21:02 /etc/alternatives/jar -> /usr/lib/jvm/java-9-openjdk-amd64/bin/jar
lrwxrwxrwx 1 root root  51 Jul 11 21:02 /etc/alternatives/jar.1.gz -> /usr/lib/jvm/java-9-openjdk-amd64/man/man1/jar.1.gz
lrwxrwxrwx 1 root root  47 Jul 11 21:02 /etc/alternatives/jarsigner -> /usr/lib/jvm/java-9-openjdk-amd64/bin/jarsigner
lrwxrwxrwx 1 root root  57 Jul 11 21:02 /etc/alternatives/jarsigner.1.gz -> /usr/lib/jvm/java-9-openjdk-amd64/man/man1/jarsigner.1.gz
lrwxrwxrwx 1 root root  42 Mai 31 21:09 /etc/alternatives/java -> /usr/lib/jvm/java-9-openjdk-amd64/bin/java
lrwxrwxrwx 1 root root  52 Mai 31 21:09 /etc/alternatives/java.1.gz -> /usr/lib/jvm/java-9-openjdk-amd64/man/man1/java.1.gz
lrwxrwxrwx 1 root root  43 Jul 11 21:02 /etc/alternatives/javac -> /usr/lib/jvm/java-9-openjdk-amd64/bin/javac
lrwxrwxrwx 1 root root  53 Jul 11 21:02 /etc/alternatives/javac.1.gz -> /usr/lib/jvm/java-9-openjdk-amd64/man/man1/javac.1.gz
lrwxrwxrwx 1 root root  45 Jul 11 21:02 /etc/alternatives/javadoc -> /usr/lib/jvm/java-9-openjdk-amd64/bin/javadoc
lrwxrwxrwx 1 root root  55 Jul 11 21:02 /etc/alternatives/javadoc.1.gz -> /usr/lib/jvm/java-9-openjdk-amd64/man/man1/javadoc.1.gz
lrwxrwxrwx 1 root root  43 Jul 11 21:02 /etc/alternatives/javah -> /usr/lib/jvm/java-9-openjdk-amd64/bin/javah
lrwxrwxrwx 1 root root  53 Jul 11 21:02 /etc/alternatives/javah.1.gz -> /usr/lib/jvm/java-9-openjdk-amd64/man/man1/javah.1.gz
lrwxrwxrwx 1 root root  43 Jul 11 21:02 /etc/alternatives/javap -> /usr/lib/jvm/java-9-openjdk-amd64/bin/javap
You can change them manually by deleting and creating new links but i think this is to much work.
Update-Alternatives works, but you have to issue the following command many times:
update-alternatives --quiet --install /usr/bin/jconsole jconsole /home/data/opt/jdk-9/bin/jconsole 1191
Update-java-alternatives
update-java-alternatives.new -s java-jdk-9
update-java-alternatives.new: directory does not exist: /usr/lib/jvm/java-jdk-9
 does not work. But this can be fixed by creating your own jinfo file:
ls -la /usr/lib/jvm/.*jinfo
-rw-r--r-- 1 root root 2600 Mai  6 05:55 /usr/lib/jvm/.java-1.8.0-openjdk-amd64.jinfo
-rw-r--r-- 1 root root 2646 Apr 14  2016 /usr/lib/jvm/.java-1.9.0-openjdk-amd64.jinfo
-rw-r--r-- 1 root root 2058 Jul 14 22:05 /usr/lib/jvm/.java-jdk-9.jinfo
Just copy one of the existing files and change the paths to your JDK installation directory.
Then copy update-java-alternatives to update-java-alternatives and change the following lines:

inside the do_set function
#update-alternatives $uaopts --set $name $location
prio=$(awk -F= '/priority=/ {print $2}' $top/*$jname.jinfo)
update-alternatives $uaopts --install /usr/bin/${location##*\/} $name $location $prio
And then
update-java-alternatives.new -s java-jdk-9
will change all links in /etc/alternatives, so that running java without path will use the your installed version...
$ java -version
java version "9"
Java(TM) SE Runtime Environment (build 9+178)
Java HotSpot(TM) 64-Bit Server VM (build 9+178, mixed mode)

Sep 16, 2017

(bash): The most useless commands (11)

After talking about
  1. rev
  2. yes
  3. sl
  4. cowsay
  5. cmatrix
  6. cal
  7. rig 
  8. pi
  9. figlet
here a packages called filters which comes with such commands:

$ echo hello my friend | jethro
hello mah friend
$ echo hello my friend | chef
hellu my freeund
$ echo hello my friend | kraut
hello mein friend
Manpage:
DESCRIPTION
       All  of  these  programs are filters to do all sorts of strange things to text.  No personal, racial,
       religious or societal slurs are intended. For amusement only.

       All the filters read input from stdin, change it, and write the filtered text to stdout. Some filters
       also support reading from files and writing to stdout.

       b1ff   The B1FF filter

       lolcat As seen in internet gifs everywhere.

       cockney
              Cockney English

       chef   convert English on stdin to Mock Swedish on stdout

       eleet  K3wl hacker slang

       fanboy Speak  like  a  fanboy.  Filters  out  extraneous  words and focuses on the words fans use. By default, it will speak like a fan of git/Linus/linux development.  To  change  this,  pass  as parameters  the  words that the fanboy typically uses. Alternatively, pass the name of a topic that typically has fanboys to use a predefined word list.

       fudd   Elmer Fudd

       jethro Hillbilly text filter

       jive   Jive English

       jibberish
              Runs text through a random selection of the rest of the filters, to make really weird output.

       ken    English into Cockney, featuring (dubious) rhyming slang for a lot of computer terminology.

       kraut  Generates text with a bad German accent.

       kenny  Generates text as spoken by Kenny on South Park.

       ky00te This program places a very cute (and familiar to FurryMuck fans) accent on any text file.

       nethackify
              Wiped out text like can be found in nethack.

       newspeak
              A-la-1984

       censor CDA-ize text

       nyc    Brooklyn English

       pirate Talk like a pirate.

       rasterman
              Makes text look like it came from the keyboard of Carsten Haitzler.
      scottish
              Fake scottish (dwarven) accent filter, inspired by the character "Durkon" from  Order  of  the
              Stick.

       spammer
              Turns honest text into something that is liable to be flagged as spam.

       scramble
              Scramble  the  "inner"  letters  of each word in the input into a random order.  The resulting
              text is still strangely readable.

       studly Studly caps.

       uniencode
              Use glorious unicode to the fullest possible extent. As seen previously in many man pages.

       upside-down
              Flips text upside down. Stand on your head and squint to read the output.

Sep 8, 2017

WLAN management with linux: networkmanager CLI "nmcli"

Configuring WLAN settings with the graphical user interface network manager is really easy.
Nevertheless sometimes it is necessary to configure the WLAN settings via a terminal. And therefore you should use nmcli:

To get a list of all available networks use "nmcli d wifi list"
$ nmcli d wifi list
*  SSID                 MODUS  CHAN  RATE       SIGNAL  BARS  SICHERHEIT
*  Gastzugang           Infra  12    54 Mbit/s  72      ▂▄▆_  WPA2      
   Napoleon Gastzugang  Infra  36    54 Mbit/s  27      ▂___  WPA1 WPA2 
   Napoleon Gastzugang  Infra  1     54 Mbit/s  25      ▂___  WPA1 WPA2 
   Napoleon             Infra  1     54 Mbit/s  25      ▂___  WPA2      
   Napoleon             Infra  36    54 Mbit/s  25      ▂___  WPA2      
   WLAN-901974          Infra  6     54 Mbit/s  24      ▂___  WPA2      
   Z                    Infra  11    54 Mbit/s  22      ▂___  WPA2      
   me5gast              Infra  3     54 Mbit/s  19      ▂___  WPA2      
You can get all saved connection via "nmcli c"
$ nmcli c
NAME                       UUID                                  TYP              GERÄT 
Gastzugang                 41d0717a-c4bc-47a4-acf7-bfa66dfa5462  802-11-wireless  wlp3s0
Kabelnetzwerkverbindung 1  316621ce-f61c-3163-a655-826306a79690  802-3-ethernet   --     
To connect to a wlan network "nmcli d wifi connect password
# nmcli d wifi connect Gastzugang password mypassword
Fehler: Aktivierung der Verbindung ist gescheitert: (7) Geheimdaten waren erforderlich, wurden aber nicht angegeben.
or with the right credentials:
Gerät »wlp3s0« wurde erfolgreich mit »754b6e6a-6284-4cf3-9737-13dd66f85b8e« aktiviert.


Aug 24, 2017

(bash): The most useless commands(10)


After talking about
  1. rev
  2. yes
  3. sl
  4. cowsay
  5. cmatrix
  6. cal
  7. rig 
  8. pi
here another pretty useless command:
~$ figlet apt-get update
             _                   _                     _       _      
  __ _ _ __ | |_       __ _  ___| |_   _   _ _ __   __| | __ _| |_ ___
 / _` | '_ \| __|____ / _` |/ _ \ __| | | | | '_ \ / _` |/ _` | __/ _ \
| (_| | |_) | ||_____| (_| |  __/ |_  | |_| | |_) | (_| | (_| | ||  __/
 \__,_| .__/ \__|     \__, |\___|\__|  \__,_| .__/ \__,_|\__,_|\__\___|
      |_|             |___/                 |_|                        
Manpage:
DESCRIPTION
       FIGlet  prints  its input using large characters (called ``FIGcharacters'')made up of ordinary screen
       characters (called ``sub-characters'').  FIGlet output is generally reminiscent of the sort of ``sig‐
       natures''  many  people like to put at the end of e-mail and UseNet messages.  It is also reminiscent
       of the output of some banner programs, although it is oriented normally, not sideways.

       FIGlet can print in a variety of fonts, both left-to-right and right-to-left, with adjacent  FIGchar‐
       acters  kerned  and ``smushed'' together in various ways.  FIGlet fonts are stored in separate files,
       which can be identified by the suffix ``.flf''.  In systems with UTF-8 support FIGlet may  also  sup‐
       port  TOIlet  ``.tlf''  fonts.  Most FIGlet font files will be stored in FIGlet's default font direc‐
       tory.

       FIGlet can also use ``control files'', which tell it to map certain input characters to certain other
       characters,  similar to the Unix tr command.  Control files can be identified by the suffix ``.flc''.
       Most FIGlet control files will be stored in FIGlet's default font directory.

       You can store FIGlet fonts and control files in compressed form.  See COMPRESSED FONTS.

Aug 13, 2017

First step to micorservices: CoreOS on virtualbox (1)

I read some articles about microservice architecture and about kubernetes / apache mesos.
My conclusion from these articles is, that lightweigt servers are a key point to this microservice architecture. Just to learn how tiny such a OS could be, i will try to install CoreOS inside virtualbox.

There is an easy way to get CoreOS running ("booting CoreOS container linux from ISO"), but there some limitations stated on the CoreOS website:

  1. There is no straightforward way to provide an Ignition config.
  2. A mininum of 1024M of RAM is required to boot Container Linux via ISO.
So just download the iso image coreos_production_iso_image.iso and create a virtualbox vm:





 Then mount the coreos_production_iso_image.iso as boot cd/dvd
 and here we go:
At this point we have something like a live cd running. Because nothing was installed on the hdd and it is not possible to umount the ISO image.

How to get from this point to a installed operating system on disk, i will show in a following posting.


Other posts around this topic: Core OS

  • Installing CoreOS on Virtualbox
  • Core OS - a minimal linux? A quick overview: diskspace, mounts, commands, kernel, ...
  • How to login via ssh (default password?!)
  • structure of the ISO image
  • Customizing a CoreOS image/iso: Ignition
  • Aug 10, 2017

    (bash): The most useless commands (9)

    After talking about
    1. rev
    2. yes
    3. sl
    4. cowsay
    5. cmatrix
    6. cal
    7. rig
    here another pretty useless command:



    $ pi 10
    3.141592653
    Manpage:
    DESCRIPTION
           The  pi  command  prints  100 decimal digits of Archimedes' constant pi or a number of
           digits specified by an integer parameter on the command line.