Applications


Quick notes on optimizing a mysql/mariadb database in a docker container

First, to avoid opening the network of the container to another network, you need to open a shell to the docker container itself. To do so, use the following command:

docker exec -it website_db /bin/bash;

After executing the exec command, you will get a shell to the docker container. Use the following command to optimize all databases and their tables:

mysqlcheck -p -o --all-databases;

The -p parameter instructs the command to ask for a password (which probably and hopefully have set).

To exit the console and close the connection just type exit; after you are done with the above command.

Note: Where we used the word website_db you need to use the name of your container. If you are not sure of the name of the container, you can list all of the containers with their names using the following command:

docker container ls;

Cannot remove the ‘sticky’ option from a post

Recently, we were trying to remove the sticky flag from a post on a self-hosted installation. We were removing the sticky option both from the posts menu and the post editor and after a page refresh, it would reappear as active.

After some troubleshooting, it appeared that the problem was with the WPML plugin. After we disabled that one, we could change the option for the sticky status. Unfortunately, when we activated the plugin again, the option returned to its previous state.

The “fix” that worked was the following:

  1. We visited the WPML plugin settings page: https://example.com/wp-admin/admin.php?page=sitepress-multilingual-cms%2Fmenu%2Ftranslation-options.php
  2. Then in the category Posts and pages synchronization, we removed the tick from the option Synchronize sticky flag and the clicked the Save button.
  1. Following that, we edited our post again and removed the sticky option.
  2. Afterwards, we checked the homepage that the post had been removed and then we went back to the settings page of WPML https://example.com/wp-admin/admin.php?page=sitepress-multilingual-cms%2Fmenu%2Ftranslation-options.php
  3. From there, we enabled again the Synchronize sticky flag option, pressed the Save button to revert the change to the settings hoping the problem will be fixed eventually.

Technical Info

  • WPML Multilingual CMS version 4.2.6
  • WordPress version 5.8.1

Audacity – Automatically split an audio file into multiple files using at the quiet/silenced parts

This video demonstrates how we were able to automatically split a large audio file into multiple smaller files at the quiet parts of the audio using Audacity.

The steps to follow after you open your audio file are:

  1. Select the part of the audio that you want to automatically split to multiple parts or press ctrl + A to select all the track.
  2. Go to menu Analyze and select the option Label Sounds....
  3. Set the settings that best suit you. For example the noise level or the minimum duration of silence that should indicate a new part, etc.
  4. Press OK and give it some time to process the file and add labels around the new parts.
  5. You will see a new row appearing that will demonstrate in ranges the new parts that were created. If the file was not split as you expected, press ctrl + Z to undo the operation, then go to step 2 again and try with different settings.
  6. Once you are happy with the results, go to the menu File then select the category Export and finally the option Export Multiple....
  7. Unless you need specific settings, select the folder where you want the new file parts to be created and hit the Export button.
  8. In the following pop-up windows, which will be one per audio track segment, if you do not need to make changes just hit the OK button enough times to get the export process going.

A note on using Audacity on large audio files (which we assume applies to many other serious audio processing applications): When you open the audio file, Audacity will pre-process it, and it will take several GBs of disk space to use for its metadata. It will delete them as soon as you close the project, but it is good to keep it in mind before trying to work and then failing to perform an export.