Wich Operating System do you use?

12 06 2009

From the begining of the computing we have the chance of choose the Operating System (OS from now on) that is running on our computer. Most likely people trends to use Microsoft XXXX because by default it is installed on their computers, which from my point of view it is a very bad practise from the computer manufacturers because they would give the option to choose this or this other OS that I like. But any way, that is a different story than the one I am targeting today.

In the options that we have also there is GNU/Linux and all the range of different distributions within this OS. Therefore we can choose  the distribution we like because we are more use to it or the one that fits better in our computer or that that has been developed for an specific task that we want to do…

Our third main option is Mac OX for the one that have Apple computers and that people say that when you try this one it is difficult to go back to a normal pc… Well my experience with this system is great and I wouldn’t go back to Windows but GNU/Linux is there.

Each of this three OS has it’s owns pros and cons as in therms of stability, usability, GUI, compatibility… You can read more about this topic in this article of CIO.

However I can see the “new” OS that you, me, us are running and using every day and that it is totaly independent of the one that ir running on your computer and that may be you won’t use it anymore in this last years and that we won’t use anymore going back to the old dummy terminals that were connected to a mainframe. You might figure out by this time what I am talking about, I am after all the services that the big companies over internet are providing to the user. How many of you are using all the google stuf? (google mail, google reader, google docs, blogger, the search engine of course) But not only google, Microsoft has all his enviroment under the name of MS Live that contains more or less the same services as iGoogle. I am saying that because more often when you see the screen of a computer you only see a browser running with several tabs open or serveral windows of the server there, but not more than that, so basically we are running and using Google OS with its services, Microsoft OS with its, Yahoo

Have you ever notice this? This was planned a long time ago, but now at days it is more explicit than it was before thanks to the popularity of clowd computing, the appearance of the netbooks and the evoluton of cellphones and fast comunications by the new mobile networks.





Set up of a xen image

27 03 2009

If you want to set up a xen image on a different server than the one you have it running on, once you have copied all the files (image.img, image-swap.img, image-config.img,…) there are some things that you have to have into account.

  • Change the config file: the config file has to be according with the new path of the files and you might probably want to change also the way that the virtual image behaves regarding the start, shutdown, or the new network configuration, that might be different if we move network.

But not only changing the configuration file will make our image start correctly, because it can start but with some failures regarding modules dependencies, this can be because when we change the image form a computer to another, if the kernel of the host is not the same as the kernel of the previous host xen server, the modules dependencies wouldn’t be the same and in the “creation” of the image, xen will complain because of this. But there is an easy way to solve this issue it and make xen happy in this step.

  • Mount the xen image in a directory by using mount -o loop image.img mount-directory by doing this you can access to the file system of the image as if any other device would it be.
  • In the host go to /lib/modules, crate a directory called as your kernel name (mkdir `uname -a`), go inside this new folder and run depmod -a this will create several dependencies modes for your host computer.
  • Copy this entire folder into the image it has to be also in the folder /lib/modules and it will tell xen which kernel you have and where to find dependencies for the modules.
  • Umount the guest image directory umount mount-directory

Now is when we can start our xen image as we use to do so: xm create -c image-comfig.cfg (-c if we want to see the start console, that helps to see whether if we have a problem or not during the start).

I hope this small tip helps you with the deployment of xen images in different servers.





Create a Xen image.

19 02 2009

I have just created my first Xen image.

  1. Create a disk image (dd if=/dev/zero of=somefile.img bs=1 count=1 seek=8G)
  2. Format disk image (mkfs.ext2 somefile.img)
  3. Mount disk image (mount -o loop somefile.img looppoint)
  4. Copy your files (tar -zxSf yourtarballingzformat -C looppoint)
  5. Unmount your loop (umount loop)
  6. Create your swap file (if you want) (dd if=/dev/zero of=xen-swap.img bs=1M count=256) <– no sparse file for this…
  7. Create your xen.conf file for that image.

xen.conf…

name            = ‘myvm’
memory          = ‘256′
disk            = [ 'tap:aio:/xen/myvm/somefile.img,sda1,w',
'tap:aio:/xen/myvm/xen-swap.img,sda2,w',
]
root            = ‘/dev/sda1 ro’
vif             = [ 'mac=00:16:3e:22:10:f8,bridge=eth0' ]
on_reboot       = ‘restart’
on_crash        = ‘restart’
vcpus           = 2
kernel          = “/xen/centos_boot/vmlinuz-2.6.18-92.1.18.el5xen”
ramdisk         = “/xen/centos_boot/2.6.18-92.1.18.el5xen.img”

You just need to change the  kernel and ramdisk according to your host computer settings and play it.





Showing data contained into a XML Element

20 11 2008

The other day I had an small issue trying to show the data contained into a DOM element, due that I was targeting a null value, because of the way that Node and Element are managed.

Let’s go to the beginning. What I had was a hole Document store in a variable, from that document I got a NodeList of Elements (in this case as it is a NodeList they are Node) that have this aspect, a normal element with data inside:

<c:customer xmlns:c=”http://engage.bt.com/customer”>
<c:id>1</c:id>
<c:name>John</c:name>
<c:lastname>Smith</c:lastname>
<c:department>Finance</c:department>
</c:customer>

I wanted to take the values that the child within this Node have, but they way that the type Node is manages doesn’t allow you to get the children of this element and get the node value that is inside a child such as <c:id>, for instance, because you end up getting the null point that I commented as my problem.

So here it comes the trick, what you have to do is cast the Node (the one shown above) into an Element.

Element customerElement = (Element)customersList.item(i);

Once you have this done, you have to get the Elements within the father by using the function getElementsByTagName(String tagName) , where you will get again a NodeList of elements with the tag name that you say. So now we only have this: <c:id>1</c:id>. So now as a list that it is we should point in the first item, so item(0). Once in this item the value is treated as a child so we need to get that child out by using the function getFirstChild(). Now we reach the point where the value is within our node, so we only need to getNodeValue(), which return a String, so we have to be careful and parse the real Type that we need.

Ok this is been specify step by step, but to make it clear what I used in the end is a function in which you give an Element (<c:customer> in this case) and a tagName (any tag of the children) and gives you the value back. The function is not other than this:

private String getData(Element customer, String tagName){
return customer.getElementsByTagName(tagName).item(0).getFirstChild().getNodeValue();
}

Therefore using this call you get the value for free

String customerData = getData(customer,”c:name”);





FKFT conference

18 07 2008

Last week it took place in Barcelona (Spain) the 1st Free Knowledge Free Technology (FKFT) conference, where around 200 people involved in FLOSS (Free/Libre/Open Source Software) and teaching were talking about how FLOSS can come into the classrooms in all the levels, from the school to the university.

In the 3 days that the conference consisted, we had so many different speeches in some others topics. From presentations of official Libre software masters to the rights in of the content in media types now at days. I was there because I am part of the team in NetGenners, one of the projects related with this issue that we were discussing there.

What we could get from there is that the use of FLOSS in the teaching, mostly in the high level (university and masters) is growing and growing because of his facility to be used and studied, due to you have everything  online to study it and the added value of a community, either big or small, behind each project. That is one of the reasons that make teachers to introduce this type of software (or other projects not software related such as documentation, …) into the classrooms. And I’m not only talking about university students, also this type of projects is used to continue with the formation of some other professionals that want to improve their knowledge in this technology because they need it or because they like it.

Also the meeting was good to know new people interested in open new projects together big or small collaborations that helps the community to be more active and create a bigger social network working together in different topics of with the same base, the FLOSS in the teaching.





F2F Meeting Madrid

2 03 2008

El otro día después de un día laborioso y de una sensación por momentos de frustración y desesperación uno de los grandes hitos que nos habíamos propuesto en el proyecto BEinGRID en la URJC (con su delegación en BT, yo jeje) conseguimos que la plataforma de juegos AGASY, hiciera funcionara utilizando unos wrappers que se encargan de codificar mensajes corba a mensajes soa, con lo que a partir de ahora, esa plataforma se puede gridificar, es decir, utilizar mecanismos grid, para obtener una mejor calidad para el cliente. Estos mecanismos nos permiten ofrecer el mejor host disponible para cada juego.

Pues bien, para hacer esto, Santiago y yo estuvimos en la tarde del día D. Haciendo test y trabajando arduamente hasta que conseguimos que uno de los componentes se hablara con el otro y, de esta manera, tener una comunicación directa de uno con otro utilizando el nuevo protocolo de comunicación que debiamos utilizar. Y la gente se preguntará y todo esto para qué? Pues muy fácil. Porque la semana pasada tuvimos un Face 2 Face meeting en la urjc en Madrid y dónde teníamos que mostrar al menos algún resultado satisfactorio de lo que habíamos hecho hasta el momento y… Cual fue nuestra sorpresa que conseguimos llegar a tiempo no sin problemas. Pero llegamos y, tras dos días de debates sobre el estado del proyecto nos tocó el turno de presentar nuestra parte. Así que allí estuvimos Santi y yo arrancando todo lo necesario para que pudieramos jugar y… cual fue nuestra satisfacción cuando mientras seguíamos los pasos marcados para crear una partida todo iba siguiendo su curso normal, hasta que vimos en la interfaz web la partida.

Finalmente, una vez estuvo la partida creada y arrancada, con el cañón puesto y después de mucho tabajo recogimos nuestro fruto y mostramos a todo el mundo que se podía jugar con la antigua plataforma y los nuevos wrappers de por medio. No me queda más que decir que enhorabuena por el trabajo realizado.