Posts

How to configure a Matlab cluster in your lan

Image
First, you need to run admincenter to mange your cluster. It route should be there:

/usr/local/MATLAB/R2016a/toolbox/distcomp/bin/admincenter

Now, you must run mdce on each member node of your cluster

cd /usr/local/MATLAB/R2016a/toolbox/distcomp/bin
sudo ./mdce start    

WARNING: The mdce script detected that the number of processes allowed
is limited by ulimit. Be sure that the limit of processes for the ROOT user
(or the user running the mdce service) is set to either "unlimited"
or at least 128 * W, where W is the maximum number of MATLAB Distributed
Computing Server workers that will run on this machine.

Creating LOGBASE directory (/var/log/mdce).
Creating CHECKPOINTBASE directory (/var/lib/mdce).
Creating SECURITY_DIR directory (/var/lib/mdce/security).
Starting the MATLAB Distributed Computing Server in the background.

To choice who is the jobmanger or workers you need run each command by separate:

sudo ./startjobmanager
or
sudo ./startworker

Now, press Add or Find to add your clust…

IOError: [Errno 13] Permission denied: '/usr/local/lib/python2.7/dist-packages/protobuf-3.2.0-py2.7.egg/EGG-INFO/namespace_packages.txt'

If you try to execute a python script and you get this error:

File "~/.local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 3017, in <module>
    @_call_aside
  File "~/.local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 3003, in _call_aside
    f(*args, **kwargs)
  File "~/.local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 3045, in _initialize_master_working_set
    dist.activate(replace=False)
  File "~/.local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2575, in activate
    for pkg in self._get_metadata('namespace_packages.txt'):
  File "~/.local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2565, in _get_metadata
    for line in self.get_metadata_lines(name):
  File "~/.local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1471, in get_metadata_lines
    return yield_lines(self.get_metadata(name))
  File "~/.local/lib/python2…

How to install wine on Ubuntu 16.04 64 bits

If you try to install wine, maybe you will see the following error:

The following packages have unmet dependencies:
 wine1.6 : Depends: wine1.6-i386 (= 1:1.6.2-0ubuntu14)
           Recommends: fonts-droid but it is not installable
E: Unable to correct problems, you have held broken packages.

I tried installing these fonts but without solution.
To avoid it, you can download the source code and compile it:

wget https://dl.winehq.org/wine/source/2.0/wine-2.0.tar.bz2
tar xjvf wine-2.0.tar.bz2
cd wine2.0
./configure

checking whether gcc -m32 works... no
configure: error: Cannot build a 32-bit program, you need to install 32-bit development libraries.

This happend because you must be explicit if you want to install on a 64-bits platform.

./configure --enable-win64
make -j8
sudo make install

Enjoy it!

How to broke the pdf security to edit it

If you think the protection of pdf is enough for nobody can edit it, you are wrong.
Just execute the follow sentence to broke it:

sudo apt-get install qpdf
qpdf --decrypt encrypted.pdf decrypted.pdf

Enjoy it!

How to install a WhatsApp bot based on Python

First, we need to download the yowsup code:

git clone https://github.com/tgalal/yowsup.git
cd yowsup
sudo python setup.py install
python yowsup-cli registration -p 569xxxxxxxx -C 56 -r sms

Where 56 is the country code (Chile in my case)
You will receive a code in your phone to register the account

python yowsup-cli registration -p 569xxxxxxxx -C 56 --register 201-124

Now, create a file called mydetails with the following information and the password that yowsup-cli prints:

cc=56
phone=569xxxxxxxx
password=PUT_THE_PASSWORD_HERE

To send a whatsapp message, you only need write the following sentence:

yowsup-cli demos -c mydetails -s 569xxxxxxxx "hello world"

If you prefer the CLI, you need to do the following:

yowsup-cli demos --yowsup --config mydetails 
/L
/message send 569xxxxxxxx "hello world"

Enjoy it!

Install Netflix in RK3188 without google play

Image
To access to any android application, you can use apk-dl.com to get the apk file and install it without google play.
In my case I have a CYX_809III_RK3188, is a HDMI Stick for your TV and runs Android 4.4.2
If you try install on it the last Netflix version, you will see this message:



There is a problem parsing the package
To avoid it, you need to found a Netflix version compatible with your device. I used http://www.apkmirror.com/apk/netflix-inc/netflix/ to search every versions of Netflix. In my case, the last version that works on my device is Netflix 3.11 Enjoy it!



How to upgrade networkx to developer version in Linux

Weight functions are only available on networkx development version.
To install it you need to do the following:

git clone https://github.com/networkx/networkx.git
cd networkx
sudo python setup.py install
nosetest

ERROR: Failure: ImportError (No module named coverage)
ImportError: No module named pandas

To fix it, install these libraries and re-run nesetest:

sudo pip install pandas coverage
nosetests
----------------------------------------------------------------------
Ran 3045 tests in 33.191s


OK (SKIP=7)

If you run your python console you can ask for networkx version as follows:

python                
Python 2.7.12 (default, Nov 19 2016, 06:48:10) 
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import networkx
>>> print networkx.__version__

2.0.dev_20170321173742

But, if you run your code it still be using version 1.1 Now you need to remove the previous version and re-install the last ve…