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.

ancient greek in LibreOffice

Some days ago I wrote this: 

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.

You can see more details here

With this font you can tranform the word “Nomos” in “Nomov“, with few mouse clics (basically with the font menu, even though in this case you have to convert the final sigma as well). 

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.