Tuesday 30 June 2015

Postgres: could not open file "/etc/ssl/certs/ssl-cert-snakeoil.pem"

Hello,

Today I had a problem starting PostgreSQL server. I saw this error:

* The PostgreSQL server failed to start. Please check the log output:
CEST FATAL:  could not open file "/etc/ssl/certs/ssl-cert-snakeoil.pem"


To solve it I did these actions:

cd /etc/ssl/certs/
chown postgres ssl-cert-snakeoil.pem
chmod 777 ssl-cert-snakeoil.pem

cd /etc/ssl/private
chown postgres ssl-cert-snakeoil.key
chmod 700 ssl-cert-snakeoil.key

Best regards!!!

Wednesday 17 June 2015

Essential: List of categories as a tree

Essential is a fancy moodle theme that has a lot of settings... One of them is use icons in categories or not. If you select in Category Icons -> Enable category icons : Yes, you will see categories as folders:

If you select "No", you will see categories as a tree:

Best regards,
Iban Cardona.

Monday 8 June 2015

Using fputcsv without enclosure

Hi,

If you want to use the PHP function fputcsv in order to create a CSV file using no character as enclosure, you can write:

$list = array (
    array('aaa', 'bbb', 'ccc', 'dddd')
);

$fp = fopen('file.csv', 'w');

foreach ($list as $fields) {
    fputcsv($fp, $fields, ';', '');
}

But a warning will appear:

PHP Warning:  fputcsv(): enclosure must be a character

To avoid it, you need to write:

$list = array (
    array('aaa', 'bbb', 'ccc', 'dddd')
);

$fp = fopen('file.csv', 'w');

foreach ($list as $fields) {
    fputcsv($fp, $fields, ';', chr(0));
}

Best regards,
Iban Cardona.