2020-05-16

customize color palette in LibreOffice


You can create a your own palette file,

  •  with .soc extension
  •  and with a content like the following:
<?xml version="1.0" encoding="UTF-8"?>
<ooo:color-table xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ooo="http://openoffice.org/2004/office">
<draw:color draw:name="panna" draw:color="#faf7d2"/>
<draw:color draw:name="mattone" draw:color="#bc5a1f"/>
<draw:color draw:name="OldLace" draw:color="#FDF5E6"/>
<draw:color draw:name="Cornsilk" draw:color="#FFF8DC"/>
</ooo:color-table>
  •  then you have to put it (also as symlink) in /libreoffice/share/palette.

You will be able to choose that palette (with the same name of the file .soc), and you will be able to use your preferred colors highlighting words in LibreWriter, for example.

2020-05-14

choose the browser to open a given link with


In Thunderbird you can use the “Open With Options” add-on, which let you choose with what browser you want open a given link in a given e-mail.

You can add new browsers as well, in a very easy way.

2020-05-13

How avoid https problems in localhost

Since a solution to force browsers toward a secured connection (with https and not http) is using an .htaccess file in the root folder, you can avoid many problems with https in localhost with this code, which you can put into the .htaccess, before the last row:

RewriteCond %{HTTP_HOST} ^[^.]+\.[^.]{3}$

So your .htacces file should contain these rows

RewriteEngine On
RewriteCond %{HTTPS} !on
RewriteCond %{HTTP_HOST} ^[^.]+.[^.]{3}$
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

This way you will have, with the same file, in local an http connection, and in remore an https connection.

2020-05-08

convert an InnoDB database to MyIsam

The problem of Innodb is that you can’t copy the database tables from a PC to another or from localhost to an online website, because of the file “ibdata1”, which is out of the tables folder.

So I think that the best solution, if you need to sync your database between different locations, is to convert Innodb tables into MyIsam tables, which can be copied without problems.

Unfortunately I didn’t find a way to convert a whole database with a single mysql command, but I had to convert each table, with this code:

ALTER TABLE table_name ENGINE=MyISAM.

But at the end the result was any way good.

2020-04-27

css how to expand an element to the whole web page

It could be not enough to set the height to 100%, or 100vw, you could try with
position: relative; height: auto; min-height: 100% !important;
It worked for me(cfr here)

w3c validation UTF-8 encoding error

With w3c validator you could get this error:
«Sorry, I am unable to validate this document because on line 3400 it contained one or more bytes that I cannot interpret as utf-8 (in other words, the bytes found are not valid values in the specified Character Encoding). Please check both the content of the file and the character encoding indication.» 
That could be because you have some files included in the php file checked by w3c validator, like an .inc one, not encodeed as UTF-8.
To fix this oproblem you have to encode all the components of a php file as UTF-8.

2020-04-21

search and replace in a mysql table

This is the code:

UPDATE `table_name`
SET `field_name` = replace(field_name, 'old_text', 'new_text')

Blog Archive