Reminders...

Correct when upload images in Bludit

When I tried to upload a set of images, I sometimes got the error 504 Gateway Error. This happened because Nginx didn't wait long enough and rejected the request due to the default timeout. To correct this, I added the following lines to the site configuration: /etc/nginx/sites-avalaible which have been taken from this stackoverflow.

So basically, you have to add these lines:

proxy_connect_timeout       300;
proxy_send_timeout          300;
proxy_read_timeout          300;
send_timeout                300;

Add code support to bludit content editor

By default, the Bludit content editor (TinyMCE) doesn't include the codesample plugin activated by default. Although, it's very easy to add that useful tool into the editor of your blog.

  1. In the admin website go to the Plugins panel.
  2. Select the Settings of the TinyMCE plugin.
  3. Add codesample on the Plugins input.
  4. Add codesample on the Toolbar Top input.

With that, it will appear the codesample button on the toolbox, with that the code will be appear inside a code tag, but it won't highlight the code with colors. For that purpose it's possible to install another plugin called prism available here.

Adding WebP support to Bludit Image Gallery plugin

I think it is very important and convenient to use webp images in my Bludit website, so I edited the code of Image Gallery Pro plugin to add support to webp images.

1. Change the line 48 of the vendors/novaGallery.php:

$images = glob($dir.'/*{jpg,jpeg,JPG,JPEG,png,PNG}', GLOB_BRACE);

with:

$images = glob($dir.'/*{jpg,jpeg,JPG,JPEG,png,PNG,webp,WEBP}', GLOB_BRACE);

2. Edit the line 100 of vendors/SimpleImage.php:

if(!preg_match('/^image\/(gif|jpeg|png)$/', $this->mimeType)) {

with:

if(!preg_match('/^image\/(gif|jpeg|png|webp)$/', $this->mimeType)) {

3. Edit the line 67 and 70 of app/BluditImageGalleryHelper.php

Line 67:

acceptedFiles: ".jpg,.jpeg,.png",

with:

acceptedFiles: ".jpg,.jpeg,.png,.webp",

Line 70:

dictInvalidFileType: "'.$L->get('This is not a JPEG or PNG.').'",

with:

dictInvalidFileType: "'.$L->get('This is not a JPEG, PNG or WEBP.').'",

With that I can use webp files for my photos-webpage, which makes everything more efficent.

SSL Certificates

As I recall, setting up SSL certificates for a website was challenging and often came with associated costs. However, a few months ago, I discovered an incredibly user-friendly tool for this purpose called Certbot. It offers the following features:

  • Obtains SSL certificates (typically from Let's Encrypt)
  • Automates the installation of certificates (for Apache/Nginx)
  • Renews certificates: Let's Encrypt certificates are valid for 90 days, and this tool automatically renews them

Additionally, it’s worth highlighting the significance of Let's Encrypt. Having access to free SSL certificates is remarkable. This organization was founded in 2014, meaning that before its inception, purchasing certificates was generally required.

To install certbot in Ubuntu, use:

sudo apt install certbot python3-certbot-nginx

Also here is an example of how to use the tool:

sudo certbot --nginx -d example.com -d www.example.com

Also, it could be even more simple just using the comand

sudo certbot

It will show the webpages configured in the server automatically, making it easier to configure.

In case it's needed to list the installed certificates, just use:

sudo certbot certificates

And in case it's needed to remove one certificate:

sudo certbot delete --cert-name example.com 

Pages:

https://www.digitalocean.com/community/tutorials/how-to-secure-nginx-with-let-s-encrypt-on-ubuntu-20-04

Mount a MTP in KDE

Sumary

Manjaro with KDE has a problem: it doesn't mount the MTP on the linux filesystem. Because of that it is not possible to manage the MTP files from the terminal. Because of that it is necesary to install a tool which allows to mount the MTP.

Procedure

  1. Install jmtpfs using: pacman -s jmtpfs
  2. Connect the MTP device.
  3. It is possible to see the service using ps -aux | grep kiod6
  4. Stop the KDE MTP service using killall kiod6
  5. Mount the MTP device using jmtpfs /mountpoint/path