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

Python development setup

Pip

Pip is a package manager for Python packages. The list of more common packages can be found on Python Package Index (PyPI).

To install or remove a package you just need to do

$ pip install <package_name>
$ pip uninstall <package_name>

A cool feature coming with Pip is an easy way to manage “requirements” through a simple list (package name with versions). You can extract that and use it to replicate the environment with these commands:

$ pip freeze > requirements.txt
$ pip install -r requirements.txt

VirtualEnv

The cool feature this tools gives you it’s the ability to manage completely separated environments to develop in a non-messy environment. This also helps when you got to keep different versions of Python and libs for different projects.

To install it just do

$ pip install virtualenv

To create a new virtual environment just do

$ virtualenv TEST

That command will create a local folder with inside everything need to manage your new separated world. To use that (to install packages in it and run your project inside it) you should do

$ source bin/activate
(TEST) $

With the activate command your shell environment has been manipulated to let you run your python project within this new separated space. Your $PATH has been manipulated to have this virtualenv’s bin/ as first entry and your prompt now displays the name of the environment you’re in.

Now you can go on and install whatever you need with pip.

While inside your new environment your prompt will be modified to display in which environment you are (the “(TEST)” part).

and to exit it just and restore your shell environment just do

(TEST) $ deactivate

VirtualEnvWrapper

This project exploits VirtualEnv adding some other cool stuff and make the day to day work so much easier. The best things you got with this tool are:

  • virtual environments all stored in a single place, not spread around like before
  • wrapper to create, delete, copy and activate virtual environments with tab completion (!)

To install and setup it just do

$ sudo pip install virtualenvwrapper
$ export WORKON_HOME=~/Envs
$ mkdir -p $WORKON_HOME
$ source /usr/bin/virtualenvwrapper.sh

and insert following lines in .bash_rc to have this tools ready next time too

$ export WORKON_HOME=~/Envs
$ source /usr/local/bin/virtualenvwrapper.sh

Now that it’s installed let’s create a new environment

$ mkvirtualenv env1
New python executable in env1/bin/python
Installing setuptools, pip...done.
(env1) $

As you can see that command will also activate the environment. Now you can install whatever package you want with pip as usual. To list all installed packages you can use lssitepackages command.

To switch to another environment or to activate one just use workon (you can use tab to invoke the list of available environments or just issue the command alone to get a plain list)

$ workon
env1
env2
env3
$ workon (press tab)
env1      env2      env3
$ workon env3
(env3)$

To delete a virtual environment just do

$ rmvirtualenv env1

A full list of command can be found here.

ipython

IPython (capital ‘i’) it’s a powerful interactive shells that we can use within our preferred IDE (eg Eclipse+PyDev) to get cool features like tab completion (eg for attribute navigation), object exploration, magic functions, etc.

To install it and invoke it just do

$ pip install ipython
$ ipython
Python 2.7.6 (default, Mar 22 2014, 22:59:56)
Type "copyright", "credits" or "license" for more information.

IPython 2.2.0 -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
object? -> Details about 'object', use 'object??' for extra details.

In [1]:

References

  • http://virtualenv.readthedocs.org/en/latest/
  • http://mrcoles.com/tips-using-pip-virtualenv-virtualenvwrapper/
  • http://virtualenvwrapper.readthedocs.org/en/latest/
  • http://ipython.org/documentation.html