Get rid of MantisBT date_default_timezone_get() warning

If you installed a MantisBT instance on a system with a recent PHP version, there’s the chance you get a warning saying:

SYSTEM WARNING: date_default_timezone_get(): It is not safe to rely on the system’s timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected ‘Europe/Berlin’ for ‘CET/1.0/no DST’ instead

A quick way to get rid of this is to set an explicit time zone.

Just open the config_inc.php file and add the date_default_timezone_set() line.

  1. <?php
  2. date_default_timezone_set("Europe/Rome");
  3. $g_hostname = 'localhost';
  4. $g_db_type = 'mysql';
  5. $g_database_name = 'db_name';
  6. $g_db_username = 'user';
  7. $g_db_password = 'secret';
  8. ?>

Please refer to this list to discover the available time zones.

Linux Shell Survival Toolkit

Hi, having a strong Windows background, I hardly remember all options of the huge set of commands available in the Linux shell… so, I’m slowly but steadily building up this Survival Toolkit. Hope it helps.

File and directory management

Symbolic link

Sometimes it is useful to hide the real location of a directory. For instance you could have various folders containing different versions of the same software. So, for instance you got /opt/package-1.2, /opt/package-1.3, /opt/package/1.4beta. But maybe you like to have an /opt/package folder that should contain the version that should be currently used, so, you can use a symbolic link:

  1. ln -s <existing_directory> <path_of_the_link_to_be_created>

In our case

  1. ln -s /opt/package-1.3 /opt/package

Compressed files

Often one downloads an open source project as a bundle which extension is .tar.gz. Here’s how to inflate it.

  1. tar xvf [filename.tar]