Removing silence from an audio track

Audacity provide a tool to remove silences from an audio track (with tools – >Truncate silence), as explained here . You should customize the settings according to your needs.

But in my experience the “duration” of “detected silence” should be at least 1.5 sec, and the decibel “-30”. In this way you should avoid to truncate words said in a low volume, as it can happen.

Kate snippets code problem

Snippets in Kate are very useful, but a new snippet can cause a crash if you don’t pay attention to some symbols, such as “=”, or ” ” “. You have to “escape” this kind of symbols in the code of a snippet. To escape something, remind, you have to use “\“. I.g. to escape ", write \".

I.g. this code is not correct

${rangeCommand("<span lang='grc'>%%1</span>", "greco")}

While this one is correct
${rangeCommand("<span lang\='grc'>%%1</span>", "greco")}

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

php list folders within the current one

You can try this code

$d = dir(".");

echo "<ul>";

while (false !== ($entry = $d->read()))
{
    if (is_dir($entry) && ($entry != '.') && ($entry != '..'))
        echo "<li><a href='{$entry}'>{$entry}</a></li>";
}

echo "</ul>";

$d->close();

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.