Configuring keyboard on Ubuntu / Debian

This tip is dumb, but is a good thing when it’s needed, because we never remember how to do it (at least I don’t).

If you need to configure your keyboard, because the keys are not inputing right chars, use the command below:

This way, you can select the correct layout.

In case of being a Brazilian layout, the recommended options would be:


MySQL encoding configuration

Today I was working on a CakePHP 2.1 project and when I was doing:

my result was coming with encoding errors.

As usual, I went to check de header layout, to be sure that I used UTF-8:

Then I checked the core.php to be sure it was defined with UTF-8:

Also checked the database connection at database.php to be sure it was using UTF-8:

Everything was ok on all files. What could it be then? The only possible reason was MySQL not being configured with utf-8 on table and fields…

Continue reading “MySQL encoding configuration”