Check android disk usage (and free space)

An useful open source android app to check how (by what apps or data) your device space is used, is Disky.

This “fast storage analyzer creates a pie chart of storage usage and lists folders by size”, very “intuitive and ad-free”.

I.g. yesterday, using this app I noticed that surprisingly an app (LinkToSport) was using 23 Gb.  Definitely too much 🙂.

difference between free and available

You could have an ext4 partition with almost 70 gb free (i.g. on KDE partition manager) but only a few more than 10 gb available in Dolphin.

Indeed free and available are not the same: free means the total space (available for root), available (in Dolphin) is the space for a single user.

If that partition is not a root one (=is not /) you could do something like:

sudo tune2fs -m 1 /dev/sdxx 
  • in the code above replace sdxx with the real name of your partition (you can know it, i.g. doing df -h), that is something like sdb8 or sdc6.
  • Be careful! Make sure that you have enough linux knowledge to do safely this kind of command. At your risk.

After your command, you should see that in that partition your user-available space is only 1gb less of the total space (that is 70 – 1). If your command would have been

sudo tune2fs -m 3 /dev/sdxx

Your user available space would be =70-3.

Kodi in openatv 7.6

Kodi working

Very painful to make it working. But something is being to become possible.

If Kodi, in you new OpenAtv installation (after restoring settings from another release) starts only from an external device (the device you used to restore settings and flash the new image) you can try to modify the kodi script in /usr/bin.

In this way:

you can reach your decoder from your PC via terminal, with something like

:~$ ssh root@sf8008.local 

if you have more than a partition on your decoder, you have to change your keys every time (each partition has its own keys), so you have to begin with:

:~$ ssh-keygen -R sf8008.local
# Host sf8008.local found: line 1
/home/[your-username]/.ssh/known_hosts updated.
Original contents retained as /home/[your-username]/.ssh/known_hosts.old
:~$ ssh root@sf8008.local
kf.notifications: Failed to play sound with canberra: File or data not found
Warning: Permanently added 'sf8008.local' (ED25519) to the list of known hosts.
root@sf8008:~# 

and then you can do
nano /usr/bin/kodi

find something like

[ -d /media/mmc ] && export HOME="/media/mmc"
[ -d /media/hdd ] && export HOME="/media/hdd"

and replace it with

ountpoint -q /media/hdd && export HOME="/media/hdd"
mountpoint -q /media/mmc && export HOME="/media/mmc"  


in my case, it did the trick.

Wrong zoom

To avoid a wrong zoom and a wrong position of the resized screen (with a black space on left and part of Kodi screen invisible, impossible to set/fix), avoid to start Kodi standalone (in Openatv – >plungis browser -> Kodi).

Fine tuning

However there were still big problems:

  • no way to reach a chapter and see that video normally (you can see a very slow video, almost still),
  • no way to resume a video from the last position,
  • no way to go forward or rewind (using the left right key).

Today I managed to resolve the first two ones:

  • settings – > player -> adjust display rate -> always
  • settings – > player -> sync playback -> on
  • settings – > player -> allow hardware acceleration – STB -> off

    as you can see in the screenshot below

Problems in OpenATV 7.6 can see found in their forum.

Kernel panic

You could have a kernel panic problem, booting your SO (.i.g Linux).

A possible cause could be Virtualbox (an old release of it).
In this case you can try the followings steps

sudo apt remove --purge virtualbox virtualbox-dkms
sudo dkms remove virtualbox/7.0.16 --all || true

and

sudo apt --fix-broken install
sudo dpkg --configure -a

and (you can change the number of kernels, of course, to adapt them to your situation)

sudo apt install --reinstall \
 linux-image-generic-hwe-24.04 \
 linux-headers-generic-hwe-24.04 

Set a flexible php variable

If you want php set a default variable value, but only if you yourself (in a particular case) set (before) another value of that variable, you can use a code like this:

$your_variable = $your_variable ?? $a_default_value;

That means: if you doesn’t define another value (with a code like $your_variable = "some_particular_value" ), the value of $your_variable will be $a_default_value.

Otherwise it will be "some_particular_value" .

Undesired empty rows in html source

Using php to generate automatically a webpage can produce undesired empty rows (typically at the begging of your source code, before <!DOCTYPE html>).
To avoid them you could have i.g. to remove empty rows between ?> and <?php, that is something like the follow code:

?>

<?php

The (new) working code should be

?>
<?php

On the contrary, empty rows inside <?php ... ?> blocks are not relevant.

In general, every empty (useless) row after a ?> could generate undesired empty rows in your html output source code.

Innodb: pros and cons

If you have to sync different devices you could have many problems with Innodb engine.

But on the other hand, it has some advantages: is more modern than MyIsam, and support foreign keys.

A compromise can be have Innodb as engine, but all the tables in MyIsam.
You should in any way be careful with some files, as already explained, in particular ibdata1.

how get rid of Innodb

If you don’t need foreign kayes, you can get rid of Innodb in /etc/my.cnf, with these instructions (stop mariadb before, and restart after):

default-storage-engine=MyISAM


Linux fstab to mount different fs with the same label

If you have different partitions (such as USB ones) with the same label (so that you can syncro them with the same script) but with different filesystem (such as btrfs and ext4) you can modify your fstab line using auto instead of etx4 or btrfs.

I mean something like this:

LABEL="your-label"  /media/your-mount-path  auto  users,noauto,noatime,nodiratime  0  2

In this way you will be able to mount your usb devices (either etx4 or btrfs or another fs) without problems.

Calibre unexpected dark theme

It can be very annoying an undesired dark theme in Calibre (both viewer and editor): reading could become difficult, or almost impossible.
This happens (probably) if you have a flatpack release of Calibre: try to remove the flatpack one, and install a release of Calibre from their website.

Flatpack is convenient (automatic updates), but have some problems….