How to play your BlurayDisks on ubuntu

After several attempts and a few “ok I just go on using my PS3 to do it” I finally got the solution to play those BlurayDisk on linux (in my case on ubuntu 14.04). Got to thank my buddy negativo17 for the help!

The main trick is to use MakeMKV. The latest release at this moment is v1.9.5 and it’s available on makemkv.com forum. As a first step download both binary and source files from the forum page then run following command on a shell.

$ sudo apt-get remove libaacs0
$ sudo apt-get install build-essential pkg-config libc6-dev libssl-dev libexpat1-dev libavcodec-dev libgl1-mesa-dev libqt4-dev

In my case I found that the removal of libaacs0 was not enough (probably I messed around a bit in the previous attempts): in case the file /usr/lib/libaacs.so.0 is still present just delete it manually.

Extract makemkv-bin-1.9.5.tar.gz and makemkv-oss-1.9.5.tar.gz in a temporary directory.

Access makemkv-oss-1.9.5 directory and execute following commands:

$ ./configure
$ make
$ sudo make install

Then access makemkv-bin-1.9.5 and execute following commands:

$ make
$ sudo make install

Now execute following commands:

cd /usr/lib
sudo ln -s libmmbd.so.0 libaacs.so.0
sudo ln -s libmmbd.so.0 libbdplus.so.0

Now your VLC can play BD disks (just the movie, not the menu)!!

Enjoy.

References

  • http://www.makemkv.com/forum2/viewtopic.php?f=3&t=7009
  • http://www.makemkv.com/forum2/viewtopic.php?f=3&t=224

How to install and build a custom Zepto library

If you’re searching for a light-weight JavaScript library similar to jQuery to use in your development for mobile hybrid app (i.e. with PhoneGap) then Zepto is your choice! This library it’s really compact, open source (MIT license), weights just 9.2kB and if you already know jQuery (who doesn’t?) Zepto APIs match jQuery ones…

Zepto’s default package contains these modules: zepto, event, ajax, form and ie (check Zepto site for explanations and full list of modules!).

A very cool thing about Zepto is that you can create your own package with only needed modules! To build a custom Zepto library you should have Node.js installed on your system and follow these steps (for linux and OSX):

  • download Zepto source code from Github (i.e. in zip archive)
  • unzip it and open a terminal in that directory (i.e. you should be inside something like ‘/tmp/zepto-master/’)
  • execute following command:
    • npm install
    • npm run-script dist
    • MODULES=”zepto event data” npm run-script dist

…where “zepto event data” is a space-separated list of wanted modules! After this you should find your Zepto custom library (uncompressed, minified and gzipped) inside ‘dist’ directory (i.e. ‘/tmp/zepto-master/dist/’)…

Please note that inside your custom library you can find in the first line a comment with your choosen modules.

Why swap all the time… let’s check the swappiness!

Since 2003 my system has a linux based SO… and I’m very happy… I took a quick peek at Windows 8 and I’m glad I don’t need it.

But it’s not always a bed of roses.

I got 8Gb of ram in my workstation but sometimes (lot of browser tabs, netbeans, virtualbox, etc) I run out of free ram. The kernel then start to use the swap file. And up to this time it’s all by the book.

It happens, often, to reach quota 6/7Gb but not over that… in these cases the kernel decide to swapout something and I find myself with about 2Gb of free ram and 1.5Gb of swap file… the problem is that at this point my user experience become tiring.

So I found that the problem regards a certain kernel parameter: vm.swappiness. In Ubuntu it’s default is 60 and the valid range is 0 to 100 (0 means “try to not swap unless is necessary”, 100 “swap whenere you feel like it”). To find out your actual value try this in a command shell:

cat /proc/sys/vm/swappiness

Now… if you want to try a new value you can launch this command:

sudo sysctl vm.swappiness=30

Once you found  the right value for you it’s possible to put this setting in the configuration file “/etc/sysctl.conf”:

# swap tendency
vm.swappiness = 10

To check your configuration you can use this command and watch “si” and “so” columns (“swapin” & “swapout”):

vmstat 1

 

Adding your favicon to wordpress

After a bunch of articles with geeky theme code manipulation I found a simple and easy solution: Captain Favicon plugin for WordPress from CaptainTheme. Works like a charm and if my theme got updated no need to modify sources again.

How to embed images inside a qrcode

There’s actually 2 ways of doing this: the first, and imho the less good looking one, is to overlay a semi-trasparent image to qrcode; the second is to put an image directly alongside qrcode “bits”.

As explained here qrcode standard “allows up to 30% deterioration” (you should set it up during generation). Keeping that in mind you can put anything inside the generated qrcode.

If you use a vector-enabled graphic suite you can generate qrcode here to get a easly editable file.

Here’s an example…

Reference: