To avoid a deal of errors with autokey (QT) in LibreOffice 7 (and KDE 5.20) it could be necessary install the KDE Frameworks 5 integration.
Here, at least, it worked.
split an epub per chapters
An epub book has multiple chapters. What method to split it into multiple files, each of them consist one chapter, effectively?
For example as the following:
1) Find: <h2
2) Replace: <hr class="sigil_split_marker" /><h2
3) Then select Edit > Split at markers.
mysql convert a column to utf-8
You can use this mysql query code:
ALTER TABLE yourtable MODIFY
yourcol VARCHAR(255)
CHARACTER SET utf8
COLLATE utf8_general_ci;
There are more problems with ENUM and SET type fields.
For ENUM you have to specify all the field values, no matter how many they are
ALTER TABLE yourtable MODIFY
yourcol ENUM('val1','val2',etc)
CHARACTER SET utf8
COLLATE utf8_general_ci;
For SET the problems rise from the name SET, so you have to do this command
ALTER TABLE yourtable MODIFY
yourcol CHAR(255)
CHARACTER SET utf8
COLLATE utf8_general_ci;
You will be able afterwards to modify CHAR to SET (with your previous values) without losing your data.
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.
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.
search and replace in a mysql table
This is the code:
UPDATE `table_name`
SET `field_name` = replace(field_name, 'old_text', 'new_text')
how to avoid #1265 error changing a value in a table structure
That is avoiding “data truncated” error. You must avoid to replace a value in use.
The right way, if a given value is already applied to some items, is
- to add the new value (supposed similar to the old) to the table structure
- search for all the items with old value
- replace in each item the old value with the new one
- delete the old value in the table structure
mysql wrong autoincrement number
It can happen that the ID autoincrement goes wrong; in this case my solution is very simple: I delete the ID column, and afterwards I re-create it (with the same parametres). It works.
ancient greek in LibreOffice
a simple maquillage, unfortunately
I mean ancient greek font so that you can, typing ‘a’ get immediatly ‘α’. So far the free most interesting true type font (the only recognised by LibreOffice) is SPIonic.
caveat
Absolutely to avoid the “AncientGreek” extension: cumbersome, useless and very aggressive (after removing leaves you with modified shortcuts, including some basic like ctrl + z, ctrl + b and F3).Vey bad!
a new solution
I noticed that the above solution works only within LibreOffice: if you copy a greek word in another program, you get a no-greek text (with latin encoding). That’s why I call it now a maquillage.
A possible, better solution is go to a website that easyly encode your text in ancient greek, such as this.
keeping updated your custom css (in Calibre viewer or in markdown-viewer browser extension)
You can link within the css (in Calibre it is within the file “viewer-webengine.json”, in markdown-viewer browser extension is the css file you yourself have chosen) your external css file, with something like
@import url(http://localhost/path-to-your-css-file/your-css-file.css)
Provided you have a apache/php server in localhost, of course.