How to fix VirtualBox error when you try to import an ova file

If you download an ova file to import it to Virtualbox, maybe you will see the following message:

Failed to import appliance filename.ova.

Seeking within the archive failed (VERR_TAR_UNEXPECTED_EOS).

Result Code: VBOX_E_IPRT_ERROR (0x80BB0005)
Component: ApplianceWrap
Interface: IAppliance {8398f026-4add-4474-5bc3-2f9f2140b23e}

If you do it the same throught VBoxManage you will get:

# VBoxManage import filename.ova 
Progress state: VBOX_E_IPRT_ERROR
VBoxManage: error: Appliance import failed
VBoxManage: error: Seeking within the archive failed (VERR_TAR_UNEXPECTED_EOS)
VBoxManage: error: Details: code VBOX_E_IPRT_ERROR (0x80bb0005), component ApplianceWrap, interface IAppliance
VBoxManage: error: Context: "RTEXITCODE handleImportAppliance(HandlerArg*)" at line 877 of file VBoxManageAppliance.cpp

To fix it, you must extract ova content and compress again as follows:

tar xvf filename.ova
tar cvf newfilename.ova filename.ovf filename.vmdk

Also, you can import the virtual machine with double…

How to convert from LaTeX to HTML file

If you have a .tex file and you want to convert it to a .html file you can use LaTeXML.

# git clone
# sudo apt-get install libimage-size-perl libimage-magick-perl
# cd LaTeXML
# perl Makefile.PL

Warning: prerequisite Parse::RecDescent 0 not found.
Warning: prerequisite Text::Unidecode 0 not found.
Warning: prerequisite Image::Size 0 not found.
Warning: prerequisite XML::LibXSLT 1.58 not found.

To install these perl dependencies, you must use the following commands:

# sudo cpan z Parse::RecDescent
# sudo cpan z Text::Unidecode
# sudo cpan z Image::Size
# sudo cpan z XML::LibXSLT

looking for -lxslt... no
libxslt not found
Try setting LIBS and INC values on the command line
Or get libxslt and libxml2 from
If you install via RPMs, make sure you also install the -devel
RPMs, as this is where the headers (.h files) are.
No 'Makefile' created  SHLOMIF/XML-LibXSLT-1.96.tar.gz
  /usr/bin/perl Makefile.PL INSTALLDIRS=site -- NOT OK

If you h…

How to fix Low disk space on "boot"

A common issue is when /boot partition is full. You receive the following message:

"Low disk space on "boot". The volume "boot" has only 0 bytes disk space remaining"

To fix it, you must delete old kernels.
First, you must list all of them and I recomend remove the oldest and keep the last two newest (if you have problems with the last, you can use the other).

To list all of them, use this command:

# dpkg -l linux-image-\* | grep ^ii | awk '{print $2}'

Now, you must purge the oldest kernels with the following command:

# sudo apt-get purge linux-image-4.13.0-{36,37,38}-generic

You need to change the values according to the values you have.
Finally, update grub

# sudo update-grub

Enjoy it!

How to convert kml to shape format throught ogr2ogr

You can create your kml file online with scribblemaps and download it to your computer.
If you create lines and markers in the same file, you will get this error:

ogr2ogr -f "ESRI Shapefile" file.shp file.kml -skipfailures
Warning 6: Normalized/laundered field name: 'description' to 'descriptio'
Warning 6: Field timestamp create as date field, though DateTime requested.
Warning 6: Field begin create as date field, though DateTime requested.
Warning 6: Field end create as date field, though DateTime requested.
Warning 6: Normalized/laundered field name: 'altitudeMode' to 'altitudeMo'
ERROR 1: Attempt to write non-point (LINESTRING) geometry to point shapefile.
ERROR 1: Attempt to write non-point (LINESTRING) geometry to point shapefile.
ERROR 1: Attempt to write non-point (LINESTRING) geometry to point shapefile.

To avoid it, you must create separated files for points, linestring or polygon as:

ogr2ogr point.shp point.kml -skipfailures -nlt point
ogr2ogr …

How to find the shortest path from an Internet Zoo topology file throught Postgis/pgrouting

First, you need to download a topology from Internet zoo.
I will use Napnet as example:


Now, we need to convert graphgml to sql (to load from postgres). To do it, you can use simplekml library for python or pykml.
It's important use geographic coordinates without altitude value and only write edges in the kml file.

After, you can follow this post to convert from kml to sql.

To begin, first we need to create a database and create a password (usually is postgres) for postgres user:

sudo -u postgres createdb testing
sudo -u postgres psql  

postgres=# \password postgres
Enter new password: 
Enter it again: 

postgres=# \q

Now, load the sql query:

psql -U postgres -d testing -q -f "Napnet.sql"
psql: FATAL:  Peer authentication failed for user "postgres"

To avoid this issue, you can run it throught this way:

psql 'host=localhost port=5432 dbname=testing user=postgres' -q -f "Napnet.sql"
psql:Napnet.sql:17: …

How to install Qgis 3.0.x in Ubuntu 18.04

If you try to install from repositories, you will install version 2.18
To install the lastest version, you can download it from git, but first you need to install dependencies.
If you have Ubuntu 18.04 you need the following packages:

sudo apt-get install bison ca-certificates ccache cmake cmake-curses-gui dh-python doxygen expect flex gdal-bin git graphviz grass-dev libexpat1-dev libfcgi-dev libgdal-dev libgeos-dev libgsl-dev libosgearth-dev libpq-dev libproj-dev libqca-qt5-2-dev libqca-qt5-2-plugins libqt5opengl5-dev libqt5scintilla2-dev libqt5sql5-sqlite libqt5svg5-dev libqt5webkit5-dev libqt5xmlpatterns5-dev libqwt-qt5-dev libspatialindex-dev libspatialite-dev libsqlite3-dev libsqlite3-mod-spatialite libzip-dev lighttpd locales ninja-build pkg-config poppler-utils pyqt5-dev pyqt5-dev-tools pyqt5.qsci-dev python3-all-dev python3-dateutil python3-dev python3-future python3-gdal python3-httplib2 python3-jinja2 python3-markupsafe python3-mock python3-nose2 python3-owslib python3-plotly…

How to run Cplex throught Julia

In my last post I talk about how to run Gurobi throught Julia.
To do a benchmarking, now I going to explain how to run Cplex.
First, you need to register here to download cplex

chmod +x cplex_studio128.linux-x86-64.bin 

By default, cplex use /opt/ibm/ILOG/CPLEX_Studio128 to install it

After, you need to add the binaries to your PATH or create symbolic links to the executables:

sudo ln -s /opt/ibm/ILOG/CPLEX_Studio128/cplex/bin/x86-64_linux/cplex /usr/bin/cplex
sudo ln -s /opt/ibm/ILOG/CPLEX_Studio128/cplex/bin/x86-64_linux/cplexamp /usr/bin/cplexamp

cd /opt/ibm/ILOG/CPLEX_Studio128/cplex/python/3.6/x86-64_linux
sudo python3 install

Now, add Cplex package to Julia:

julia> Pkg.add("CPLEX")
INFO: Cloning cache of CPLEX from
INFO: Installing CPLEX v0.3.2
INFO: Building CPLEX
================================[ ERROR: CPLEX ]================================

LoadError: Unable to locate CPLEX installation. …