Man YeeGeology ParkBondi Beach at 45.3C!Summer Palace - BeiJingMykonosLotus purpleLotus pinkLotus pink yellow

       水泛金光 萬宜水庫

中國香港世界地質公園

Hong Kong Global Geopark of China

45.3°C @Bondi Beach!

日落 頤和園-北京

The Unforgettable @Mykonos

紫蓮•迪欣湖

Piwigo Fotorama Plugin Conflict with Embedded Video

Issue:

After installing Fotorama plugin in Piwigo provided that there is Embedded Video installed, the following error message will be shown while clicking the slideshow button on top of the video pages:

Notice: Undefined index: selected_derivative in /.../plugins/Fotorama/main.inc.php on line 54 Fatal error: Call to a member function get_type() on a non-object in /.../plugins/Fotorama/main.inc.php on line 54

Solution:

Maybe it is just a workaround for the issue. However, it works so far. Comment out the statements causing the error in main.inc.php of Fotorama plugin as below:

$type = $current['selected_derivative']->get_type(); 
    $defined = ImageStdParams::get_defined_type_map();
    if (!isset($defined[$type]))
    {
      $type = pwg_get_session_var('picture_deriv', $conf['derivative_default_size']);
    }
and rewrite the following line:
$type = pwg_get_session_var('picture_deriv', $conf['derivative_default_size']);
 

Config:

  • Piwigo          2.6.2
  • Embedded plugin: 2.6.2
  • Fotorama plugin:   2.6.h

Piwigo Fotorama Plugin Bug!

Issue:

The built-in slideshow feature of Piwigo has neither fading effect nor full-screen show. Though there is a CoolIris/PicLens plugin, it cannot work in iOS including iPhone and iPad as it requires Java. There is a new slideshow plugin for Piwigo called Fotorama that I have been waiting for a long time to empower the online albums.

However, it did not work in my Piwigo site. Just displaying all the thumbnails but no slideshow happened either under window or full-screen. No error message. Changing all combination of plugin configuration, nothing was changed.

Solution:

  1. Check Administration -> Configuration -> Options -> Genereal -> Gallery title
  2. Remove all text including Apostrophe (').

Config:

  • Piwigo     2.6.2
  • Fotorama Plugin   2.6.h

Tricks:

  • At the beginning, I observed that a slave Piwigo site works but the host site did not work, and interestingly another separate Piwigo site works while the slave site did not work.
  • As there is no error message while executing slideshow, it is difficult to find out the bug mentioned in the Solution above.
  • Posted a question in Piwigo Forum related to Fotorama plugin, but no one responded after a day.
  • The flow to solve the issue was by adding new slave Piwigo site under the working host Piwigo and then adding only the Fotorama plugin but nothing else, it works and then gradually configuring other settings. After adding a Gallery title, it did not work. Bingo! Usually, we use "LarryLai's Gallery" or "Mr. X's Gallery", then no luck, you are trapped by the bug. 

Secret of Mounting USB Storage on Cisco Linksys Router

Issue:

Using either Dolphin File Manager or ftp, copying a directory of around 70GB to an USB storage formatted in NTFS stopped mid-way without notification at less than 10GB copied.

Checking the system log (/var/log/messages), the following was supposed to be relevant:

  • quiet_error: 20 callbacks suppressed
  • Buffer I/O error on device sdc1
  • lost page write due to I/O error on sdc1

Though it's not easy to figure out what went wrong, I think it's the front USB port/channel issue on my HP. The source directory is another USB drive connected to the rear USB port. I have tried the rear USB port to test if it's the port issue. 

Solution:

  1. remove the USB storage and connect it to the router's USB port 
  2. Mount the USB storage as samba 

Config:

  • OpenSUSE       12.3
  • Dolphin              2.2
  • KDE                  4.10.5
  • Router              Linksys  EA6700
  • FileZilla             3.7

Tricks:

  1. Even after using a Windows 7 PC to full format the USB drive, fault still happened.
  2. Merely typing smb://192.168.1.1 on Dolphin may see the samba share content but cannot write on any samba directory
  3. Mounting the samba share requires stating the share directory in the command
  4. To let non-root user to write on the samba share, it's not permitted to mount the samba share from non-root user, chmod to 0777 had no change to directory permission state, but rather mount it by root and state in the option the uid of the linux user, i.e.

mount -t cifs -o uid=[userid], rw //192.168.1.1/[share] /[mount_pt]

Though the transfer speed between the PC and router fluctuated a lot from 7MB/s to 36MB/s (using USB2.0 instead of USB3.0), it's better to have it done eventually than using the USB port on the PC with stable transfer speed around 25MB/s and then I/O died down quietly. 

Using NTFS as the USB file system as it's good to be share among Linux and Mac as it's mature and both Linux and Mac have ntfs-3g utility to read and write NTFS drive. exFAT may be an alternative but not easy to find a way to deploy this Windows proprietary file system.

Blog tags: 

Mac Mini Must Read! Cheap & Nice Way to Cool Down

Issue:

Mac Mini' s over heat problem has been known for a while. Though the chassis is metallic, the components are closely packed and ventilation fan is small, over 90°C is quite common when processing graphics or encoding video files. My case was that the Mac Mini (mid 2011) would hang after CPU over-heating for a while even boosting the internal fan speed to over 5000rpm. Worst situation is not bootable for a while.

Solution:

Instead of placing the chassis horizontally, place it on a HK$65 metallic-like stand slightly tilted. Now on average CPU temperature is around 40°C even the fan speed is less than 3000 rpm, and around 70°C on heavy loading.

Configuration:

Mac Mini:  Quad-core 2GHz i7 CPU, 256GB SSD

Tricks:

There are many stands suitable for this task, but many of them are more expensive than this stand.

 

Blog tags: 

iPhone WhatsApp Intermittent Missing Message Input Window

Issue:

Suddently found that the message input window was missing. Instead there're only labels as Earlier and Later appearing at the bottom of screen, and you cannot find a way to input your message to send out.

Solution:

  1. Drag to the top of the message history
  2. Click "Info" at top right corner
  3. Drag to bottom of the screen
  4. Click "Send Message"

Config:

  • iOS 7.1
  • WhatsApp 2.11.8

Tricks:

WhatsApp is supposed to be a user-friendly app, but it's frustrating that when you want to send out message immediately as a reply to a friend, you cannot find a way to input any message.

Blog tags: 

zPanel Webmail Password Change

Issue:

zPanel is using RoundCube as the webmail frontend. It's clean and user-friendly. However, if it is going to be used by ordinary mailbox users without zPanel admin access, users cannot change their own password through RoundCube. Deploying the Password plugin is not easy for zPanel as RoundCube is an open source webmail software, and it is not dedicated for zPanel.

Solution:

  1. Open /etc/zpanel/configs/roundcube/main.inc.php
  2. Deploy password plugin by modifying: $rcmail_config['plugins'] = array() -> $rcmail_config['plugins'] = array('password')
  3. change dir to /etc/zpanel/panel/etc/apps/webmail/plugins/password/
  4. Copy config.inc.php.dist to config.inc.php
  5. Change the line: $rcmail_config['password_driver'] = 'sql' -> $rcmail_config['password_driver'] = 'zpmail'
  6. Add the following driver contributed by setris.
  7. Name it as zpmail.php and put it under directory ../plugins/password/drivers/:

<?php

/**
 * ZpanelX SQL Password Driver
 *
 * Driver for passwords stored in SQL database
 *
 * @version 1.1
 * @author 
 *
*/
class rcube_zpmail_password
{
    function save($curpass, $passwd)
    {
        $rcmail = rcmail::get_instance();
        $local_part  = $rcmail->user->get_username('local');
        $domain_part = $rcmail->user->get_username('domain');
        $username    = $_SESSION['username'];
        $host        = $_SESSION['imap_host'];
        // convert domains to/from punnycode
        if ($rcmail->config->get('password_idn_ascii')) {
            $domain_part = rcube_idn_to_ascii($domain_part);
            $username    = rcube_idn_to_ascii($username);
            $host        = rcube_idn_to_ascii($host);
        }
        else {
            $domain_part = rcube_idn_to_utf8($domain_part);
            $username    = rcube_idn_to_utf8($username);
            $host        = rcube_idn_to_utf8($host);
        }
        $sql = 'SELECT password FROM mailbox WHERE username="'.$username.'"';
        $host = "DBHOST"; // Usually localhost
        $dbName = "zpanel_postfix"; // your ZPanelX postfix database. Default value here
        $dbUser = "DBUSERNAME";
        $dbPass = "DBPASSWORD";
        try {
            $db = new PDO("mysql:host={$host};dbname={$dbName}", $dbUser, $dbPass);
            $db->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING );
        } catch (PDOException $e) {
            //echo 'Database error: '. $e->getMessage() . '';
            return PASSWORD_CONNECT_ERROR;
        }
        $res = $db->query($sql);
        $result = $res->fetch();$pass = $result["password"];
        $hash = str_replace("{PLAIN-MD5}", "", $pass);
        if (md5($curpass) != $hash)
        {
            // echo "Password mismatch error";
            return PASSWORD_ERROR;
        }
        $pass = "{PLAIN-MD5}".md5($passwd);
        $sql = 'UPDATE mailbox SET password="'.$pass.'" WHERE username="'.$username.'"';
        $res = $db->query($sql);
        if ($res) {
                return PASSWORD_SUCCESS;
        }
        return PASSWORD_ERROR;
    }
}
Don't forget to change parameters: $host, $db_User, $db_Pass above appropriately.
Config:
  • zPanel   10.1.1
  • RoundCube   0.9.5
  • Password plugin  3.2
Tricks:
There are many drivers in Password plugin inlcuding the default: sql, but none of them works with zPanel. That is the reason why we need to create new driver for the plugin.
 

Pages