Fixing Mail IMAP synchronization in Mavericks

After the update to Mavericks, got stuck and wouldn’t synchronise mails automatically with the server. Manually forcing the new mail reception worked.

The fix is very simple:

  1. Go to Mail -> Preferences -> Accounts and choose the IMAP account to fix.
  2. In the advanced tab, tick the box “Use IDLE command if the server support it”.
  3. That’s it! Synchronisation of IMAP should be fixed 🙂 Enjoy it!
Posted in IT stuff | Tagged , , , , , | Leave a comment

Add missing wpsql_errno in PG4WP plugin

Today I tested updating our website based on WordPress using a Postgresql database through the PG4WP driver. Unfortunately, it seems that the author doesn’t update it anymore since 2012. Version 3.9.1 of WordPress makes new functions calls to the database that are not handled by the original driver. I needed to tweak 2 parts of the code to make it work:

1) Sorving the “Warning: Missing argument 3 for wpsql_result()”

Edit the function wp-content/pg4wp/driver_pgsql.php on line 58 with :

function wpsql_result($result, $i, $fieldname = null) {
		if (is_resource($result)) {
			if ($fieldname) {
				return pg_fetch_result($result, $i, $fieldname);
			} else {
				return pg_fetch_result($result, $i);

2) Solving the error “PHP Fatal error:  Call to undefined function wpsql_errno() in /path/to/your/site/wp-content/pg4wp/core.php(32) : eval()’d code on line 1531”

Add at the end of your wp-content/pg4wp/driver_pgsql.php:

function wpsql_errno( $connection) {
 $result = pg_get_result($connection);
 $result_status = pg_result_status($result);
 return pg_result_error_field($result_status, PGSQL_DIAG_SQLSTATE);

Source 1:
Source 2:

Posted in IT stuff | Tagged , , | 6 Comments

Changing the duration of login in WordPress

WordPress remembers your login during some time. If you want to change it to one year, add this code to your functions.php

add_filter( ‘auth_cookie_expiration’, ‘keep_me_logged_in_for_1_year’ );

function keep_me_logged_in_for_1_year( $expirein ) {
return 31556926; // 1 year in seconds

Source: Stefano Gorgoni’s blog

Posted in IT stuff | Tagged | Leave a comment

Unlock Brother HL-2240D

3 Brothers 2240D got stuck on error led in our office. The support kindly gave me the procedure to reset it and solve the problem. Here we go:

  1. Switch off the printer
  2. Open the hood
  3. Press the go button
  4. Without relaxing the go button, switch it on
  5. Press 2x the go button, the LEDs should all go on
  6. Press 6x the go button
  7. Close the hood

That’s it! The printer should work again 🙂


Posted in Uncategorized | Tagged , , | 2 Comments

Google calendar sync with Mac/iPhone

For those having troubles syncing a Google account in a Mac or iPhone for syncing the calendar, here goes a tip:

open Calendar, and go to Calendar > Add Account > Add CalDAV Account.  Set Account Type = Manual and set Server Address =, and use your Google User Name and Password.

Worked like a charm for me as my Google account didn’t want to validate on my Mac and sync was broken. On my iPhone I was still using the deprecated exchange service. Changed all to a standard CalDAV service with as server address and all worked like a charm. Thanks Ben Blazak!


Posted in IT stuff | Tagged , , , , , , | Leave a comment

Use Thunderbird with maildir storage

As you should know, maildir storage is more efficient for backups. And we all need backups. To configure Thunderbird to use maildir storage instead of default mbox you should go to preferences -> advanced -> configuration editor and look for “storeContractID”.

Then, change any occurrence of;1 to;1

Quit Thunderbird. Remove all mbox you find in your config and relaunch it. You are now using maildir! Congratulations.

Be careful, this is still a beta feature… Bugs may occur.


Posted in IT stuff | Tagged , , , , , | Leave a comment

Enable autologin on GDM (Linux)

Just edit /etc/gdm/custom.conf with your favourite editor. Then, under the [daemon] section, add 2 lines so it looks like the code below (obviously change username to the username you want to use)


Source: megahertz post on CentOS forum Thanks dude!

Posted in IT stuff