Simple MySQL Command line DB dump for cron

If it doesn’t already exists, create the file .my.cnf in your home directory. Add the following to it, replacing db_username and db_password with the database username and password. make sure the file permissions are set to 600 (chmod 600 .my.cnf) so it is...

Location of Gnucash Invoice Template on Ubuntu

This is one of those things that drives me mad, that I can never find in the documentation. I’m currently running Gnucash 2.4.11 on Mint 14 (based on Ubuntu) and sometimes need to edit the invoice template. I can never find where the damn thing is. Currently,...

Enabling mod_rewrite on Apache

This is one of those things I often forget to do when setting up WordPress on a new server, which means pretty permalinks don’t work: If you have a problem with permalinks not working on WordPress, it may be because Apache does not have mod_rewrite enabled. An...

Get the last rows updated in a database

When debugging applications, it can be useful to see what’s going on in the database without referring to the code. In MySQL, you can use the information_schema database to get this information. here’s what I do: Select table_name, table_rows, update_time...

Spliting strings with awk / nawk

I mainly use nawk to extract elements from a string where I know the position (eg to get just the filenames when running a grep and I’m just too lazy to remember the correct grep syntax). so, to extract field number x from strings in where the field separator...