Sunday, May 11, 2025

Set fixed IP on LibreElec on RaspBerry

Well, go to settings ... duuuh.

Yeah, alright, but what if I have to run headless, i.e. not have a monitor or TV attached.

So as long as you can ssh into it (i.e. you know the current IP address) you can do

connmanctl config "$(connmanctl services | awk '/^\*/ {print $3}')" --ipv4 manual 10.0.0.22 255.0.0.0 10.0.0.1

The "inner" connmanctl finds the service name for the active IP connection, the "outer" one changes it to the new IP

Sunday, June 09, 2024

Select URLs in PuTTY

It annoyed me for ages that you cannot just double-click on an URL in Putty to open that URL in your browser. Even selecting an URL for copy/paste is cumbersome.

Yesterday I found the next best thing: Select URLs in PuTTY

In essence you tell putty which characters form "words" and which are stop-characters. More here.

So on the "Window > Selection > Copy" tab, if you add :?= and some other URL characters to class 2, can at least can double click on an URL to select the full URL.


Don't forget to save those settings to your configuration(s).


Friday, December 29, 2023

Jackson vs. Android package optimization

 For some weird reason (including a 20MB text file to be precise) I wanted to turn on 

shrinkResources true
minifyEnabled true

in my Android app.
I did the compression alright, but the app stopped working.
I got weird Exceptions like 
Cannot construct instance of `g1.k` (no Creators, like default ...)

Well that pointed me to obfuscation, because I definitely don't have classes and members like that.

Jackson relies on reflection to find your class properties and getter/setter functions, so you should not obfuscate them. Duuuh.

They way to turn that off is in the proguard-rules.pro file.

-keepattributes *Annotation*,EnclosingMethod,Signature
-keepnames class com.fasterxml.jackson.** { *; }
-dontwarn com.fasterxml.jackson.databind.**
-keep public class at.roman.traininfo.data.** {
*;
}

The last part keeps the whole package where all my entity classes are.


Sunday, April 16, 2023

NULL values again

Today I learned that you essentially cannot concatenate (concat, ||) nullable columns properly in DB2/SQL.

To be honest, I should have know this of course.

I have a table that records money spent, with a date, text, account and a physical location, e.g. a town, district, ... indicating where the money was spent.

It is nullable because not all transactions need to have a place recorded.

For some statistical analysis I wanted to create one column with text and account and the location simply concatenated into one, like account||' '||text||' '||location.

Turns out, then the location is NULL the whole string will turn NULL

Which reminded me - painfully, after about 30min - that NULL is not a value. You cannot do anything with NULL.

So you have to cast it away to a default value, e.g. with coalesce(location,'dummylocation').


Sigh.

Wednesday, December 28, 2022

OxygenOS 13 missing per-app language

A couple of weeks ago I got the Android 13 / OxygenOS 13 update for my OnePlus 9, looking forward to the per-app language feature from Android 13.

Reason for that is, that I just like to run my devixes in English, but some local (i.e. Austrian or German) apps just have terrible translations, or I am just not in an "English context", i.e. when Banking or doing my taxes.

Some apps of course can set the language within the app, but some just take the system settings.

Android 13 allows to override this (with a tiny little help of the app, it only has to declare in the manifest which languages it actually has translations for).

But it appears OxygenOS13 failed to implement exactly that feature.


Bummer.

Sunday, August 28, 2022

First UFO sightings

So, Max finally did it. He found the HW to read our old floppy disks and got our 1985/86 software back and onto proper modern media ;) 

And then we both separately tried to get a good old DOS to run. My attempt was in a virtualbox on my PC... Tricky to get the program/files into that DOS box because you can't mount a folder from the host then (DOS doesnt have vbox extensions), nor do you have networking on it... so I had to dreate a disk image file, put the files on that, and mount it as disk 0 ("A:") to the DOS vm. And this worked.

Ladies and Gentlemen ... I give you... 

UFOS


Please don't ask me what UFOS stood for... the U was most surely "Unterricht" (=education), but I can't remember wha tthe F would be for. I guess I need to try and find that in the sources.

Speaking of which, we did some wonderful stuff - and remember that was two 17y/o kids in high school working on 4.77MHz PCs with just 2 floppy disk drives, natively in x86 Assembler (Macro Assembler if that makes a difference to you, it doesn't to me, because I always considered the "marco" part a primitive pre-processor, not a different language) .

Core architecture was the base module (a .com file), that would load the various modules from disk when needed, and supply a bunch of common functions (a core library, if you will) as a  service interrupt. So when a module wanted to do some windowing/output stuff it would  - as was common practice under DOS - load a function code into the AH register (the AH part of the accu, ok) and call INT F0h, like you would do for a DOS or BIOS function.

The rest seems to be pretty awful, not only because of the lack of documentation.

The above-mentioned interrupt handler, utilized a jump table, i.e. use the function code in AH as an index into an array of function addresses to call those functions (pretty cool for 17y/o, right?) but I didn't check any boundaries... I probably thought I wouldn't need to, because only us two boys would ever call this interrupt... pretty stupid.  (And when I say I, I'm pretty sure that I wrote this piece of code at that time, and looking at the source, it look remarkably like my code)

Monday, August 15, 2022

Fun ahead

Not a lot happening here tech-wise these days.

Except: an upcoming "archaeological" adventure.

Max, my longest and dearest friend found a bunch of disks (yes, those: 5.25" and 3.5") from way back when. We were in high school together when the first PCs came out and started to get used in school administration. Obviously, there was a lack of software for exactly this back then. We had good ties to our school administrator (who happened to be our geometry teacher as well), and since the two of us made up about 50% of the school geeks (there were two others and of course all four of us where friends) he sometimes allowed us to use his "official" computer, an Olivetti (_that_ long ago), and also the only one sporting a 10MB (!!) hard disk.

So at one point, Max and I set out to write a piece of software that would help him in some administration tasks, namely creating and assigning the whole schools class schedule, making sure that all the boundary conditions were taken care of. Conditions like the (weighted) hours per teacher, or honouring their days off. Stuff like that. Not some fancy logic that would automatically take care of it, but supporting it. 

The fun part: this was all written under MS-DOS in 8086 Assembler (yes) and we even created a nice (character) windowing and menu framework for this.  At least I'm pretty sure we did.

So, Max happened to find the disks with the sources for it.

Now we need to get access to disk drives (3.5 and 5.25),  and connect them to a modern PC.I checked: I really don't have any. And then hopefully get some DOS running in a VM and see what will happen. 

Fingers crossed that any of this is still readable.

PS: I just might post some stories of that time here in the upcoming weeks, and of course the progress of our digital excavations.