How to unpack a gem for local usage?

This bugged me for a while, so I decided to make a note to self for future reference.
If you try to include the gem in your bundle (e.g. for a rails app), you need to unpack the gemspec too.

The commands are:
 $ gem unpack gemname --target vendor/gems
 $ cd vendor/gems/gemname-VERSION
 $ gem unpack gemname --spec

Owncloud pdf viewer not working on synology NAS

I ran into this problem multiple times now. Unfortunately, it occured with a considerable delay, so I had forgotten about the solution the second and third time around.

The error is, that you click on a PDF-file in your owncloud web interface file listing and want to view it. But no luck – the viewer only gives you an error message.

Like, the error is caused by an Apache module called mod_xsendfile.
On my synlogy NAS it has a config file located at: /etc/httpd/conf/extra/mod_xsendfile.conf-user

This you need to edit to contain the following:

LoadModule xsendfile_module modules/
XSendFile on
XSendFilePath /var/services/web /var/services/homes
XSendFilePath /volume1

Especially the last directive is key to making owncloud work again.

Now restart the webserver with:
httpd -k restart

Hope this saved you some time. It will for me the next time I encounter this error. 😉

PS: found this fix at:

log into mySQL on Plesk server

If you can’t log into your mySQL with your admin username and password on a Plesk (> 11) machine, this is for you. Try:
# mysql -u admin -p`cat /etc/psa/.psa.shadow`

This takes the contents of the /etc/psa/.psa.shadow file and uses it as the password for your mySQL-server. This works for me and seems to be the new default. 😉

Hope this works for you, too.

enable horde webmail to display html (and multi-part) messages inline

Did your users complain, that they can’t open emails with html content in them? Are those users using your Horde installation? 😉

This problem occurs due to the default setting in Horde Webmail, which is justifyable: Displaying HTML content and images opens the door for SPAM and potentially even malware. So, I’d even go so far and say it is a good default. But we all want to make our users happy, right? So how do we go about this?

Easy: Look at the documentation here ->

Then stop and think: “shoot, I have a Plesk machine that might override the settings at every reload of domain.” 😦
Ok – I’ve been there. Here’s my (admittedly imperfect) solution:

  • create a file called mime_drivers.local.php in /etc/psa-webmail/horde/imp
  • put the following content in:
$mime_drivers['html']['inline'] = true;
  • make a link to that file in /usr/share/psa-horde/imp/config
  • done

I can’t guarantee, that this will last beyond the next server reconfig, but for now my users are happy. 😉


increase acceptable email size in Plesk with Postfix

If you want to increase the acceptable size of an email on your server configured with Plesk (> 11), this might help:
In order to increase it to over 50M, you have to configure the mailbox_size_limit parameter in Postfix to 0. This limit is totally arbitrary and needless if using Plesk. It says in the knowledge base (, that Plesk controls the size of a mailbox independently.

Anyway, this saved my afternoon. Hope it might save yours one day. 😉