Wednesday, October 19, 2011

Error in API call to delete - Vagrant

These days, I'm heavily working with Vagrant and Chef. During my working sessions, I created several scripts then run "vagrant up", scripts fail then "vagrant destroy" then do some modifications, run "vagrant up" again and this loop occurs for many times. Suddenly, "vagrant up" doesn't run but arises this message:

[node1] Destroying VM and associated drives...
/var/lib/gems/1.8/gems/virtualbox-0.9.1/lib/virtualbox/com/implementer/ffi.rb:106:in `call_and_check': Error in API call to delete: 2147944126 (VirtualBox::Exceptions::COMException)
    from /var/lib/gems/1.8/gems/virtualbox-0.9.1/lib/virtualbox/com/implementer/ffi.rb:80:in `call_vtbl_function'

Looking into log files (${HOME}/.VirtualBox), I found that for an unknown reason "vagrant destroy" can not delete the directory which contains the disk attached to the virtual machine.  Solution: erase that directory by hand. Problem solved!


Tuesday, October 18, 2011

extracting audio content from video files with open source tools

These days, I have downloaded many music videos and I have enjoyed them but I don't only want to watch them but also listen them. I looked in Internet and found this interesting link which give many tips about how to transform and extract information from multimedia files using ffmpeg.

Then, I created this bash script which extracts audio content from music videos.

#!/bin/bash
OUTPUT=""
if [ $# = 1 ] ; then
    OUTPUT=${1%.*}.mp3
elif [ $# = 2 ] ; then
    OUTPUT=${2}
else
    echo "Usage:"
    echo "     ${0} video_filename output.mp3"
    exit
fi
/usr/bin/ffmpeg -i "${1}" -vn -ar 44100 -ac 2 -ab 192 -f mp3 "${OUTPUT}"

Cut and paste it into your preferred editor (VI). This link explains how to retrieve just the file name without its extension.


Sunday, October 2, 2011

Getting high resolution images from PDF files

Today I was preparing a lecture for Thursday (I guess) and I found very illustrative images from a PDF book but I got some problems for extracting them from the book.
  • Acroread (for Linux) didn't keep the image in the clipboard 
  • The "convert" tool (from Imagemagick) by default, made a poor conversion from PDF to any format
I searched in Internet and I found these two links that gave me a clue
  • http://ardvaark.net/useful-pdf-imagemagick-recipes
  • http://www.imagemagick.org/discourse-server/viewtopic.php?f=1&t=11476
For my needs "convert -density 300 pdffile.pdf image.png" did the trick. The image.png file gave me an excellent resolution. From that point, I used gimp for cropping the region that I need.


Friday, April 15, 2011

Post-installation commands...

I have been a big fan of Fedora but those days I gave a try to Ubuntu 11.04 (Beta2). I like the way how Ubuntu manages packages since it looks very clean and stable although it's a Beta [2] release.

I was playing around with new packages and some updates ('apt-get dist-upgrade') which provoke a unstable system so a couple re-installations have been necessary. After every re-installation I executed the following commands:
  1. sudo software-properties-gtk, the Ubuntu's mirror for Colombia is not synchronized and the 'apt-get update' procedure throws some errors. Through this command, I could change the Colombia Mirror for the 'Main Server' option.
  2. gnome-window-properties, this command allows to modify the current windows behavior e.g. 'Select windows when the mouse mover over them' and Roll up window on the 'Double-click titlebar' event happens.
Give a try to Ubuntu 11.04, it's cool and fast.

PS: Fedora guys, why are you looking for a code name for Fedora 16 when Fedora 15 has not been released yet. Awkward, ah?

Monday, April 11, 2011

Ubuntu 11.04 Beta

Last week, I installed Ubuntu 11.04 Beta on my laptop. My Linux box exhibits a better performance during the login procedure.
Despise the new graphical environment is dramatically different, the learning curve is not so steep.
I'm a Latex user and some additional packages were needed for a fully operational environment
  • texlive-latex-base
  • latex-beamer
  • texlive-fonts-recommended
OK, unexpectedly [g]vim was not installed, so vim-gtk package was also installed by hand.

Monday, April 4, 2011

Working with Web Services

"Web services" is a paradigm that allows the development of loosely coupled applications composed by several modules which interact through well-known and widely adopted protocols, e.g. SOAP and HTTP.
Web services allows to orchestrate several modules [perhaps provided by different developers] in one single process known as workflow.
A workflow is then a special kind of application which integrates software components who expose their functionality through the web service description language, WSDL.
May be you are wondering if a particular development platform is necessary for creating web service-based applications. The answer is NO. Any platform able to understand (reads and writes) SOAP messages, it is also able of interacting with any other platform to speak the web service language. Therefore, web service is a framework to leverage the integration of multiple software stacks, operating systems + programming languages.
Despise diverse technologies which have been developed to support this paradigm, this entry would focus on a widely known Java-based software stack Apache Tomcat + Axis2. Tomcat is an application container and Axis2 is the framework to process SOAP messages.

How to install tomcat + axi2
Download the most recent version of Apache Tomcat. Apache Tomcat is a Java-based application container to support different technologies such as Servlets and JSP. (Check References section)

For Axis2 is highly recommended to download the .WAR distro. The war distro provides an easy way to deploy web services.

How to write/deploy a web service
There are different ways for deploying Java web services. Right here, and only for demostration purposes, the deployment and execution of POJO-based classes is presented.

Write a usual Java class, for instance HelloWorld.class.
class HelloWorld {
  String sayHello(String name) {
     return "Hello " + name;
  }
}

Compile the file and copy the class file into the ${TOMCAT_CONTAINER_DIR}/webapps/axis2/WEB-INF/pojo directory. If 'pojo' does not exist, please create it.

[Re-]run your tomcat container and check the available services. The HelloWorld service would be listed.


References
  • Apache Axis2 Web Services - An introductory tutorial is accessible in this link.
  • Tomcat - Version used during this tutorial was Apache Tomcat 7.0.8
  • Apache ODE - Orchestration Director Engine
  • BPEL - Business Process Execution Language
  • Eclipse - Helios release was used during this tutorial


Tuesday, March 15, 2011

Projects for Distributed Systems Lab

These projects are fundamental for creating a computational ecosystem in which vast majority of networking management tasks could be automatized. For portability, the services and tools must be deployed on virtual machines.

Network services
  • DHCP Server
  • DNS Server
Deployment services
  • Fedora mirror
  • Cobbler/koan
Services to enable remote access
  • Tools to support remote monitoring via remote terminal as well as browser interface
    NOTE: wake-on LAN service would be enable in all machines at lab
Repository services
  • Git tool
Security tool
  • To search, evaluate and select a network intrusion detection tool
There would be two operating systems in the lab
  • CentOS would be the Linux distro in which cobbler/koan service would reside
  • Ubuntu server would be used to deploy DNS, DHCP and Git programs along with a network intrusion detection tool.
Repositories for both environments would be required. Only last releases would be maintained.