C# Net 5 Process terminated. Couldn’t find a valid ICU package installed on the system

Program compiled with net 5 as single file for linux.
You get this error:

Process terminated. Couldn't find a valid ICU package installed on the system. Set the configuration flag System.Globalization.Invariant to true if you want to run with no globalization support.
   at System.Environment.FailFast(System.String)
   at System.Globalization.GlobalizationMode.GetGlobalizationInvariantMode()
   at System.Globalization.GlobalizationMode..cctor()
   at System.Globalization.CultureData.CreateCultureWithInvariantData()
   at System.Globalization.CultureData.get_Invariant()
   at System.Globalization.TextInfo..cctor()
   at System.Text.EncodingHelper.GetCharset()
   at System.Text.EncodingHelper.GetEncodingFromCharset()
   at System.ConsolePal.GetConsoleEncoding()
   at System.ConsolePal.get_OutputEncoding()
   at System.Console.get_OutputEncoding()
   at System.Console.CreateOutputWriter(System.IO.Stream)
   at System.Console.<get_Out>g__EnsureInitialized|25_0()
   at System.Console.get_Out()
   at System.Console.WriteLine(System.String)
 [...]
Abgebrochen (Speicherabzug geschrieben)

This fixed it for me:

export DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=1

portforwarting over ssh

To use SSH tunneling in Linux, you need to provide your client with the source and destination port numbers, as well as the location of the destination server. The location can either be an IP address or a hostname.

The basic syntax for a local port forward command is straightforward:

ssh -L <local_port>:<target_server>:<targetport> <user>:<ssh_server> -p<sshport>

source: [link]

Must see movies

Filme die man meines Erachtens mindestens 1x gesehen haben sollte. Die Aufzählung folgt keiner bestimmten Reihenfolge.

repair grub2 on software-raid system

Assumptions:
– fs / is on /dev/md2
– fs boot is on /dev/md1
– you are using 2 harddisks (sda, sdb)
– you are using grub2
– grub2 is nor working (fe: error: symbol ‘grub_calloc’ not found.)


First boot your system with a rescue-disk/livecd. Then:

# mount /dev/md2 /mnt
# mount /dev/md1 /mnt/boot
mount --bind /proc /mnt/proc/ ; mount --bind /dev /mnt/dev/ ; mount --bind /sys /mnt/sys/
# chroot /mnt
# grub2-install /dev/sda   # or /dev/nvme1n1 - depends on your disks :)
# grub2-install /dev/sdb

you should see “Installing for i386-pc platform. Installation finished. No error reported.”

reboot.

Recover your MySQL password

What if you’ve forgotten your MySQL root user password? This could be quite the predicament … had the developers not thought of that eventuality. In order to recover the password, you simply have to follow these steps:

  1. Stop the current MySQL server process
  2. Start the MySQL server with the command sudo mysqld_safe –skip-grant-tables –skip-networking &
  3. Connect to the MySQL server as the root user with the command mysql -u root

At this point, you need to issue the following MySQL commands to reset the root password:

mysql> use mysql;
​mysql> update user set authentication_string=password('NEWPASSWORD') where user='root';
​mysql> flush privileges;
​mysql> quit

After this you can shutdown the mysql-server and start it the normal way.

(!) on very old mysql databases the “authentication_string” field is called “Password”. so the command looks like follows:

​mysql> update user set Password=password('NEWPASSWORD') where user='root';


source: [link]

ASRock B550 Extreme4 USB issue

I use an ASRock B550 Extreme 4 motherboard in combination with an active USB-Switch with 2 PC-connections (ABLEWE USB Switch 3.0, 4 Ports USB). I have connected the USB-Hub to the top USB-Ports of my Motherboard because my microphone (Rode NT-USB mini) won’t work on the other ports properly (robotic voice after a few seconds). Power to the USB Ports while the PC is offline is switched off in the Bios (v1.8).

The Problem was that even the PC is switched off the USB hub rapidly flashes the input-device light for this port. The laptop that is on the other port won’t get through its BIOS while the PC is connected to the switch.

My suspicion: The switch uses mosfets to detect if the PC on any output is turned on and the B550 board puts a voltage on the port that’s just enough to turn the mosfet on. Then the current will be dumped though the hub and the mosfet turns off again. The board then charges up the capacitor on the USB output until the turn-on voltage of the mosfet in the hub is reached and the cycle continues.
The hub meanwhile tries to connect to input 1, can’t and switches back to input 2. And this multiple times a second. No wonder the BIOS from the second PC (Lenovo Laptop) hangs.

How to check: I build a breakout-cable that I put between the motherboard and the hub and measured it. There were 1.641V on the USB-line even it should be (near) 0!
(The voltage was there even when I had the hub removed)

After this I calculated which minimum resistor I need, to drop the voltage below the activation-voltage from the USB hub.

Consideration:
– The cable must work when the PC is turned on (5V).
– the value should be as high as possible because 1. so it stays cold, 2. the voltage drop while the PC is on is as low as possible and 3. the power consumption is as low as possible.

resistor-rating = 0.25W
0.25W / 5V = 0.05A (MAX continuous amp through resistor – we want to keep it way under this)
5V / 0.05A = 100 Ohm (absolute minimum resistor-value for continuous usage)

I tested 220 Ohm, 1k, 2k and 10k.
The 10k ohm wasn’t enough ‘current dumping capacity’ to work. But I saw a significant slowdown between ‘activations’ on the hub. The 2k ohm resistor works most of the time but every few tens of seconds I saw a short blinking of the USB hub trying to make a connection.

So I settled for a 1k ohm resistor to be safe. It works well within specs (1/10 of it) and should do the job just nice.
cont. A through resistor while PC is on: 5V / 1000 ohm = 5mA => 25mW
cont. A through resistor while PC is off: 1.641V / 1000 ohm = 1.6mA => 8.2mW

PC on: 1.82€ / year
PC off: 0.63€ / year
(The cost is in the middle of these 2 values – depending on the running time of the PC)

The cable worked like a charm. It would be nice if the ASRock board hadn’t this flaw in the first place.

Repairing Dymo LetraTag

A friend of mine send me her broken Dymo labelprinter. The descriped fault was “not turning on”.
While I opend up the unit screws and springs fell out – nice start. somebody was here before.

On picture 1 you can see the screws I had removed (top) and the things that fell out on its own (bottom).

After a first inspection I found a stripped cable that wasn’t attached to anything (picture 2) and the negative-site of the battery-array that has no connection (picture 3). The cable was manually stripped and too short for the way. It was in fact the powerline for the mainboard (see 4).
After soldering a new wire to the board and the terminal (picture 5 & 6) the printer shows its first signs of life (7).

The long spring (in picture 1 bottom) is for the cutting mechanism in picture 8. But there seems to be missing a support-part. So the automatic backflip of the blade is broken. :/

After some cleaning of the rubber roller, thats forwards the tape, with some isopropyl the system worked again as it should (except the autoreturn of the blade).