Kodi add-ons on Ubuntu 16.01.1 LTS

On latest Ubuntu distributions (based 16.01 LTS) Kodi's add-ons won't connect to the internet due to a bug in the systems python-openssl package, wihich is outdated. They throw following error to the logs:

URLError: <urlopen error [Errno 0] Error>

So uninstalling the system package and upgrading to pyopenssl using pip worked just fine.

# sudo apt-get remove python-openssl
# sudo apt-get install python-setuptools python-pip python-dev libssl-dev
# sudo pip install --upgrade pyopenssl

Add-ons are working afterwards.

Limit per request bandwidth using Apache 2.4

Apache 2.4 has a module called mod_ratelimit. This module gives you the ability to limit the bandwidth of your requests posted to the web server. The usage is quite simple (read the docs):

First load the module (Apache 2.4 on FreeBSD). Uncomment following line in /usr/local/etc/apache24/httpd.conf

LoadModule ratelimit_module libexec/apache24/mod_ratelimit.so

This will load the module during next startup. Now how do i use it? Well, let's say you want the whole server to limit every request to 5MB/s, then use this:

<IfModule mod_ratelimit.c>
    SetOutputFilter RATE_LIMIT
    SetEnv rate-limit 5120
</IfModule>

The same can be applied to only specific directories if you need to:

<IfModule mod_ratelimit.c>
    <Location "/downloads">
        SetOutputFilter RATE_LIMIT
        SetEnv rate-limit 5120
    </Location>
</IfModule>

Last step, as apache needs to load a new module, restart your webserver, not reload:

# service apache24 restart

Enabling shared folders with open-vm-tools

First install following package  when using Ubuntu:

sudo apt-get install open-vm-tools-desktop

Manual mountafterwards:

sudo mount -t fuse.vmhgfs-fuse .host:/ /mnt/hgfs -o allow_other

Auto-mount at startup (/etc/fstab):

.host:/ /mnt/hgfs fuse.vmhgfs-fuse allow_other 0 0