Mega sync with rclone

Be careful: you have to set something like:

rclone sync [your-local-path/to/the-folder-to-sync] [the-rclone-name-of-your-mega-account]:[the-Mega-remote-folder] -l -v
i.g. rclone sync /mnt/my-path/myfolder my-mega:my-mega-remote-folder -l -v

mysql order negative number

In a table (chronological) if you have dates stored as text you could have problem to order your data.

I.g. you coud have this (wrong) order:

-13.600.000.000, -13.700.000.000,-4.600.000.000

To get the right order you can try with

cast(data as int)

Where “data” is the column of data (as the above values). In this way you will get the correct order:

-13.700.000.000, -13.600.000.000,-4.600.000.000

Flatpack and the space of the hard disk

Flatpack has the big advantage that you can a) run apps that couldn’t run the “normal” way (integrated with the system), because of lack of dependencies or b) have automatic updates of apps otherwise upgradable only via ppa or manually.

But its big disadvantage is the space occupied on your hard disk: indeed any app in Flatpack is a “world” in itself, regardless not only of the system, but also other apps in Flatpack itself.

Therefore, be careful to add Flatpack apps, unless you need really them (and them via Flatpack).

Create a video with a static image from an audio file

In Linux this is possible in a terminal, with the following command:

ffmpeg -loop 1 -i image.jpg -i audio.mp3 -c:v libx264 -tune stillimage -c:a aac -b:a 192k -vf "scale='iw-mod(iw,2)':'ih-mod(ih,2)',format=yuv420p" -shortest -movflags +faststart out.mp4

Check a mysql connection error

If your server cannot establish a connection with a webpage, you can check where is the problem with a code like the following:

<?php
$link = mysqli_connect("localhost", "user", "psw", "dbname");

/* check connection */
if (mysqli_connect_errno()) {
    printf("Connect failed: %s\n", mysqli_connect_error());
    exit();
}

if (!mysqli_query($link, "SET a=1")) {
    printf("Error message: %s\n", mysqli_error($link));
}

/* close connection */
mysqli_close($link);
?>

unblock linux update (attempted overwriting)

If an update is blocked because of an attempted overwriting problem, you can try to solve this problem by this code:

sudo dpkg -i --force-overwrite /var/cache/apt/ar
chives/your-package.deb

where your package could be something like libpipewire-0.3-modules_1.0.7-3~ubuntu22.04_amd64.deb

Fast pre-boot

If your pre-boot (when you can choose among different SO) is too slow, you can reduce the time before the start of boot, modifying the file grub (in /etc/default), adding a line like this:

GRUB_RECORDFAIL_TIMEOUT=1

Indeed GRUB_TIMEOUT=0 could not work.

Connecting a wordpress category to a facebook page

IFTT is a good app, but with a free plan you can connect only one wordpress category to one facebook page.

There are many plugins and many web services, such as Zapier, or Activepieces, that can connect wordpress with a facebook page, but if you have a free wordpress plan (with an address like yourdomain.wordpress.com) you can install plugins only upgrading your plan.