Social Icons

twitterfacebookgoogle pluslinkedinrss feedemail


Monday, December 10, 2012

ReteLIM project presentation - network problems

Here you can find the link to a presentation of mine of the ReteLIM project.
The main goal of the project is to enable hospitalized children to keep in contact with his classmates and teachers; I explained a bit in a previous post of mine.

The main big problem in Italy is the lack of good network connections in the schools AND in the hospitals.

Unfortunately hospitals are not build with a 2.0 conception. People often risk to spend lot of lifetime in an hospital and there should be the availability of a free guest network connection, isolated from the internal hospital network, so that citizen either sick or relatives can have a view of the world and a means to keep in touch with the outside.
This is place where free internet has an additional meaning.

Unfortunately in Italy we are much in late with the free internet access.

Maybe in the context of the "Agenda Digitale" there could be means to address also this problems:

- Bandwitdh for schools and hospitals
- Public cloud where PA (and schools obviously) can procure computing power for services

These are themes that have to be centrally solved.

Sunday, December 09, 2012

JBoss 7.1.1 + GeoServer 2.2.2

I'm deploying GeoServer 2.2.2 into JBoss 7.1.1 and there are not many hint around on how to solve some issues.

If you download the WAR version of GeoServer and just deploy it into the standalone/deployments folders you get the following errors:

14:47:26,944 ERROR [stderr] (MSC service thread 1-5) java.lang.NoClassDefFoundError: com/sun/imageio/plugins/common/BogusColorSpace

14:47:26,944 ERROR [stderr] (MSC service thread 1-5)     at it.geosolutions.imageioimpl.plugins.tiff.TIFFImageReaderSpi.onRegistration(

14:47:26,944 ERROR [stderr] (MSC service thread 1-5)     at javax.imageio.spi.SubRegistry.registerServiceProvider(

14:47:26,944 ERROR [stderr] (MSC service thread 1-5)     at javax.imageio.spi.ServiceRegistry.registerServiceProvider(

14:47:26,959 ERROR [stderr] (MSC service thread 1-5)     at javax.imageio.spi.IIORegistry.registerApplicationClasspathSpis(

14:47:26,959 ERROR [stderr] (MSC service thread 1-5)     at javax.imageio.spi.IIORegistry.(

14:47:26,959 ERROR [stderr] (MSC service thread 1-5)     at javax.imageio.spi.IIORegistry.getDefaultInstance(

14:47:26,959 ERROR [stderr] (MSC service thread 1-5)     at org.geoserver.GeoserverInitStartupListener.contextDestroyed(

14:47:26,959 ERROR [stderr] (MSC service thread 1-5)     at org.apache.catalina.core.StandardContext.listenerStop(

14:47:26,959 ERROR [stderr] (MSC service thread 1-5)     at org.apache.catalina.core.StandardContext.stop(

14:47:26,959 ERROR [stderr] (MSC service thread 1-5)     at org.apache.catalina.core.StandardContext.start(

14:47:26,975 ERROR [stderr] (MSC service thread 1-5)     at

14:47:26,975 ERROR [stderr] (MSC service thread 1-5)     at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(

14:47:26,975 ERROR [stderr] (MSC service thread 1-5)     at org.jboss.msc.service.ServiceControllerImpl$

14:47:26,975 ERROR [stderr] (MSC service thread 1-5)     at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(

14:47:26,975 ERROR [stderr] (MSC service thread 1-5)     at java.util.concurrent.ThreadPoolExecutor$

14:47:26,975 ERROR [stderr] (MSC service thread 1-5)     at

14:47:26,975 ERROR [stderr] (MSC service thread 1-5) Caused by: java.lang.ClassNotFoundException: com.sun.imageio.plugins.common.BogusColorSpace from [Module "deployment.geoserver.war:main" from Service Module Loader]

14:47:26,990 ERROR [stderr] (MSC service thread 1-5)     at org.jboss.modules.ModuleClassLoader.findClass(

14:47:26,990 ERROR [stderr] (MSC service thread 1-5)     at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(

14:47:26,990 ERROR [stderr] (MSC service thread 1-5)     at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(

14:47:26,990 ERROR [stderr] (MSC service thread 1-5)     at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(

14:47:26,990 ERROR [stderr] (MSC service thread 1-5)     at org.jboss.modules.ConcurrentClassLoader.performLoadClass(

14:47:26,990 ERROR [stderr] (MSC service thread 1-5)     at org.jboss.modules.ConcurrentClassLoader.loadClass(

14:47:26,990 ERROR [stderr] (MSC service thread 1-5)     ... 16 more

14:47:27,006 ERROR [] (MSC service thread 1-5) MSC00001: Failed to start service jboss.web.deployment.default-host./geoserver: org.jboss.msc.service.StartException in service jboss.web.deployment.default-host./geoserver: JBAS018040: Failed to start context
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService( [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
    at org.jboss.msc.service.ServiceControllerImpl$ [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask( [rt.jar:1.6.0_35]
    at java.util.concurrent.ThreadPoolExecutor$ [rt.jar:1.6.0_35]
    at [rt.jar:1.6.0_35]

To solve the problem you have to  create two files:

<classloading xmlns="urn:jboss:classloading:1.0"


<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.1">
                    <path name="com/sun/imageio/spi"/>
                    <path name="com/sun/imageio/plugins/common"/>

These files have to be added inside the WAR in the \WEB-INF\

This solves the problem and you get a nice and working GeoServer inside the JBoss application server.

Tuesday, December 04, 2012

WebRTC mozilla implementation

Here is a great demonstration of the next WebRTC implementation that Mozilla is developing for Firefox 18.
This is going to put in the trash all the web conference solutions. or at least rising the minimum feature offering. The power to send the currend browser to the other participant is amazing and powerful.

This could have a big impact on eLearning tools, adding new communication tools directly within the platform (I'm thinking at a Moodle on steroids).
The interesting aspect is the fact that the WebRTC technology enable a new world of integrated applications on the web, just a few click away.

I hope that projects like OpenMeetings will soon be able to leverage on this standard.

Saturday, December 01, 2012

New cloudstack' VMs security and password management

I happen to work with cloud infrastructure and use to create lots of virtual machines to test and develop new puppet modules.

Since the target is to finalize cloud templates and correct installation of the modules often these VMs stay up a few days to allow refining and so on.

I start from a very basic template, and all is installed by puppet, security has to be managed by the cloud and these machines are destined to stay in the internal private network exposing just the services they offer (whether they are a moodle machine or a JBoss server or whatever).

So no particular attention has been made in securing the host, but to be able to work with ease I just opened the 22 port of SSH server to connect and to the configurations.

Unfortunately the password was a simple one and since the work sometimes take more than a couple of days some machine were compromised; brute force attack to SSH server.

This to learn to use a good password: so since using a different password for each VM in the cloud could be difficult to remember (especially if you want to use non simple ones) I decided to use a nice feature of keepass: the ability to execute PUTTY as a URL action; in this way I do not have to bother to remember or type complex passwords anymore.

Here the code to insert in keepass:

cmd://PuTTY.exe -ssh {USERNAME}@{URL:HOST} {URL:PORT} -pw {PASSWORD}

cmd://WinSCP.exe scp://{USERNAME}:{PASSWORD}@{URL}

The first is for opening ssh URL the second to create a "scp" URL.  Mind that there is already an "ssh" URL scheme, but if you have SSH on another port you have to follow the command above to manage to connect.  This command works with the latest keepass 2.x version

To add it go to Tools -> Options...    press "URL Scheme Overrides"
Keepass options dialog

Create a new Scheme pressing "Add..."

URL Override

Adding "ssh" to scheme and the command above in the URL Override.

This way you can start PUTTY from keepass using secure complex passwords with ease.

To solve the problem of unsecure new machines I also added the installation of fail2ban to the puppet node description: no more brute force attack allowed.

Will work on automatically changing the root password and creating a CSV file to send to administrator to add info to central keepass DB.

Friday, November 23, 2012

Puppet, Augeas and sudoers

I'm developing some puppet modules in these days and I'm working on a Moodle module.

The interesting thing is that Moodle has a nice CLI interface that is possible to use to make the installation unattended and not iterative so is possible to create a puppet module that manages the whole installation by itself.
The module is still in the works, but I'm trying to make it as modular as possible since I could need to have the MySQL DB in a different host and so I prefer to set up the module to delegate to MySQL the task of building the DB.
This is something that many modules around to not take into consideration: not all environments have the DB in the same host as the application you are installing.  In my case is particularly true in my case since I work in a cloud environment and I need the machine to be automatically deployed in CloudStack letting the Moodle machine to export the DB need to the MySQL central machine.

To solve this problem I'm using the exported resources and I can say that it works pretty well as I posted some times ago.

With this approach the Moodle module just takes care of the Moodle stuff and demand (issues a export resource and MySQL will catch it and create the DB) to other modules the task of managing their resources.

Thankfully puppetlabs is working hard to provide a set of good basic modules to manage thinks like MySQL (had to use the GIT version since there is a bug that has been fixed there)
One of the thingsI had a really awful time to solve is the use of Augeas in puppet to configure the /etc/sudoers file.
The problem is that Moodle CLI wants to be executed as the Apache user, but the apache user do not have TTY and is not allower to work without a password so googling around (I'm not a sysop, more a jack-of-all-trades and thus have to google a lot in my day :-) ) it turned out I had to have sudo and write /etc/sudoers to enable apache to work.
It seems easy ... (at least if you use visudo), but using puppet ...
Looking around I felt lucky augeas can write on /etc/sudoers ... but how?  No good example around so after many trials and error I decided to make this post to help others not loosing all the time I did:

augeas { "sudoapache":
    context => "/files/etc/sudoers",
    changes => [
      "set spec[user = '$moodle::params::web_user']/user \"$moodle::params::web_user\"",
      "set spec[user = '$moodle::params::web_user']/host_group/host \"ALL\"",
      "set spec[user = '$moodle::params::web_user']/host_group/command \"ALL\"",
      "set spec[user = '$moodle::params::web_user']/host_group/command/runas_user \"ALL\"",
      "set spec[user = '$moodle::params::web_user']/host_group/command/tag \"NOPASSWD\"",
      "set Defaults[type=':$moodle::params::web_user']/type :$moodle::params::web_user",
      "set Defaults[type=':$moodle::params::web_user']/requiretty/negate \"\""],

This will produce the two rows in the file that allowed the CLI to make its own work.

Defaults:apache !requiretty

Good puppetizing!

Wednesday, November 07, 2012

VUVOX a timeline storytelling

This is a really powerfull solution for alternative form of presentations.

The timeline approach transmits a narrative flow to the presentation and the power of hyperlinks to show videos, images, audio is a big addition.

This is one complementary alternative to Prezi.

You give the user the power to control the flow and the hyperlink is something tha Prezi lacks. These two tools offer a new way to present content in a rich and engaging style.

I can advise it.

Friday, November 02, 2012

Your data in the social network

This video is really funny!!

Is a good example of how our personal information is available to public access.

This true especially for young users of the internet, too many times people publish things that could represent a problem for their current or future public image or a threath to the security of web accounts.

Tuesday, October 23, 2012

TEIID 8.1 tutorial - Part 5

We prepared a VDB in the previous part of the TEIID tutorial.

Now we want to test it on a TEIID server.

To do so we need a fresh and clean TEIID installation.

We download a JBoss AS version 7.1.1 and unzip it into a folder (I'm runniong the tutorial on windows, but you can do the same on linux).

I usually check that JBoss works out of the box before installing anything.

When you have checked the JBoss AS installation you are ready to install TEIID, that is pretty easy stuff to do as you have to download the TEIID distribution and just unpack it into the JBoss installation; there is the same folder structure so everything will go to its place.

For the demo we'll going to run JBoss in standalone mode, this means that we'll look at the files into the standalone folder.

Since there is a standalone-teiid.xml file I usually create a start script to set the config file to be that one, but is a habit of mine, you can rename it standalone.xml and work on that (just keep the original standalone somewhere should you need it).

Done that just start JBoss again and this time we'll see that also TEIID modules gets loaded and it is ready and running; obviously there is no DB right now.

Shut down everything and make some few configurations (all these stuffs can be done in different ways, as a tutorial I prefer to show what gets written into the XML file so that is known what web consolle does behind the scene).

Since we are going to connect to MySQL we need to prepare the module for MySQL with the driver so that JBoss and TEIID can make a connection to MySQL create a datasource to our DB with the correct jndi name we used in the VDB.

The TEIID installation comes with a usefull set of examples/templates for the modules so we just have to copy the MySQL one in the modules folder, copy the jdbc driver in the folder, configure the modules with the correct name of the lib and the driver is ready.

We than need to add the driver information within the standalone.xml file.

Done that we can add the driver information in the standalone.xml file and set all the parameters to be able to correctly connect to the DB.

When you have finished the configuration start JBoss and go to the web concolle and check the functioning of the datasource testing the connection with the DB.

Once we have finished this part we can deploy the VDB.

Thursday, October 18, 2012

Project ReteLIM - thanks to open source

I'm working on a very interesting project called ReteLIM.

Is a project to help hospitalized children to stay in contact with their class and to enable them to work together with their classmates.

I'm working side by side with teachers finding the best technical solution to apply to the task.

The project aims to define which hardware and software use and how to help teachers apply technology to the learning experience.

The model start with hospitalized children constraint, but can be applyed to any "remote" situation.

Our idea is to implement a "virtual classroom" using integration of open source tools to enable a complete learning experience helping a standardization of approach.

We decided to use a cloud hosting to serve the software.

In the cloud the teachers will find a Ubuntu desktop that they will be able to access from anywhere thanks to NX web access.

This desktop is loaded with all sort of program dedicated to education (it could be an Edubuntu distro, but for now we preferred to go with the standard one).

This desktop will also mount an NFS share from a server.

The server hosts an integrated environment composed by Joomla!! + Moodle + Mahara + OpenMeetings (single sign on thanks to Joomdle).

The nfs share will be seen by Moodle as a repository so all the content, produced and saved into a particular folder of the desktop, will be seen and available to Moodle without any trouble for the teacher.

Also OpenMeetings will be available as a Moodle activity so that it will be possible to use it to work with the hospitalized child and the support teacher (the teacher will be equipped with a tablet PC) and the class where a LIM (that is the italian acronymn for an interactive whiteboard) can be used: either the one done with the WII or commercial ones that public administration gave to the school.

The project is fantastic and the energy of the group is vibrant, this is why I choose IT as working life: it can really help making the difference for the lives of many, seeing the happyness in the eyes of the children that can feel to be still part of a normal routine is the greatest satisfaction.

I just feel that is important for me to thanks all the people that work in the open source ecosystem: without their work this project would not be possible and affordable.

Thanks guys.

Evolution of TEIID 8.1 tutorial

I've decided to expand this tutorial to add integration with other pieces of software I'm using in the Open-DAI project I'm working on.

Just to remember what I've already published in the tutorial right now:
1) Create a relational mapping
2) Create a XML document from an XSD schema
3) Map the relational DB to the XML document
4) Create the VDB

Planned coming next:
5) Install TEIID in JBoss AS
6) Deploy the VDB in TEIID server
7) Connect to the VDB with SquirrelSQL and get the XML document with a query
8) Create a web service that will publish the relational tables
9) Deploy the new VDB and the Web Service and test it with soapUI

The tutorial will follow these additional steps to demonstrate the integration of a data service generated with TEIID with other platforms:

10) Publish the TEIID web service with WSO2 API manager
11) test the published API with soapUI
12) publish the relational tables as REST service
13) Call the REST service using node.js
14) Call TEIID from node.js
15) How to update tables from a VDB

This will be the "coming next" for this tutorial, if you are interested in some more integrations or further explanation please leave a comment.

TEIID tutorial 8.1 - Part 4

In the previous steps we created a relational model from a MySQL DB, we imported an XSD and created an XML model document based on that XSD and mapped the relational tables to the XML document.

Now we need to create the VDB so that all this work can be used in applications.

The Virtual DB will be treated as a normal DB and we'll connect to it with SquirrelSQL and issue a query to get back the XML document.

The process require to create in our project a new element that is the VDB database, give a name in the form and do not choose the models in the form, we'll to it later.

Now we find in the VDB view and we need to choose which are the models we want to publish: we need to remember that in a VDB we need to include all the models an which the model we'll query depend on.

If we choose the model we want to use TEIID Designer will automatically import all dependent models.

Also have to remember that if we make modifications in the models after we included them in the VDB we have to come back in this view and mark the checkbox that will be unmarked by default (this is a reason of many troubles).

After having included the models we have to save the VDB and we are ready to deploy it in a TEIID server.

Since TEIID is a module of JBoss AS weìll need to install TEIID into a clean JBoss installation.

We'll explain how to prepare TEIID to be able to deploy our VDB.

Thursday, October 11, 2012

TEIID 8.1 tutorial - Part 3

In this part the target is to create the view model from the XSD to generate an XML document based on one of the XSD elements.

I choose bookListing.

You create a new Model and choose "XML" instead of "Relational"; obviously it asks you the XSD to use and you choose the correct one from the project.

Now you got a new "orange" model (a view model) with an object of type XML document.

The problem is how to fill the XML with relationa data.

The mapping tool comes to help, but you have to know well your DB and the XML you want to generate.

In this easy example you have to fill the book element and the author one: this means two mapping and the second depends on the first since the author depends on the book (in this XML).

So there goes the mapping, not too complicated (you could also write down the query by hand, but the tool is usefull).

I'm just not able to force it to choose "object" conversion instead of "string", but in any case is possible to fix it by hand.

Remember to save before invoking the tools otherwise an annoying popup will remind you that you have not saved.

In the end you have mapped a relational DB to an XML document with ease ... and now what?

Well you can query it with SquirrelSQL or publish it as a web service ... but before you have to do the most important thing create the Virtual DB.

But this is stuff for the next part of this TEIID tutorial.

TEIID 8.1 tutorial - Part 2

Here the second part: very fast, just importing the XSD that we'll be using to create the view model.

Just remember to place the XSD in the schema folder; sometimes it gets quirky and do conflicts with the preview files it generate in the root during the import.

Go to the third part of the TEIID tutorial.

TEIID 8.1 tutorial - Part 1

This is the first of a series of tutorial on the use of TEIID.

TEIID is a piece of software from JBoss that allows you to do very sophisticated EII creating a new virtual DB getting data from many different sources, transforming them and publishing in different ways.

In these tutorials I'll explain how to get a relational DB (from MySQL), and exposing its content as an XML document conforming to a given schema through either a JDBC connection or a SOAP service.

The video is without audio since I do not like to talk too much during registration and I'm too lazy to record it later.

Also the installation is in italian, but hope that is clear enough for all to understand in any case leave a message is something is not clear.

This new tutorial uses TEIID version 8.1 on application server JBoss 7.1.1 and TEIID designer 7.8

I'm starting from a mostly clean and fresh installation of Designer (did not record the creation fo the MySQL driver, but should not be a problem).

This first part explain how to get the physical model from the DB, very quick and easy.

For sake of easyness I'm using the book DB you find around in the examples from JBoss so you'll find youself at home.

Go to the next part of the TEIID tutorial.

Yii framework and CloudStack and Flex and ...

For the Open-DAI project I need to create a quick and dirty consolle (I hope it will become something more sophisticated, but for now I need something functional).

The target is to manage to pilot CloudStack to create VMs. I cannot use the CloudStack interface since it does not allow for adding "user data" so I need to use API calls to di the job

The problem is that I need to do this job cross CloudStack domains.

So have to get the list of API key and secret key and other CloudStack related data and write down a small program to issue the calls.

Obviously since you need to manage creation you need to be able to see what is going on in time so a small DB will be needed and also since the architecture of Open-DAI require to create management VMs in a precise order There will be the need to manage a simple workflow.

I also like to present the user with a view of the architectural deploy model describing the state of the deployed VMs.

Since I want to do things in a fast way without having to install too many things I decided to use PHP, a SQLite DB, Flex for the "toppings".

Since I believe that reinventing the wheel is not advisable I looked over to some of the PHP frameworks around ... at firts looked at Zend 2.0 ... really nice but ... damn complicated, you surely manage to do a lot but have to overcome a steep learning curve, so after few hours of hacking I looked somewhere else and ... landed on Yii.

Well I can say I'm surprised. It took more or less three hours (following the tutorial) to have a first scratch of application, integrated with the CloudStack library and ready to receive some of the code I already prepared in the last days (tomorrow will be a day of cut and paste and fix).

I can advice to look at it.

Sunday, September 09, 2012

Puppet and modules

I've been working with puppet and the good impression of the product balances with the few really good modules around.
There are lots of modules, some are good, but most are build to statisfy the specific needs of the author and not a generic management of the software also there is little integration or common approach: one uses wget another curl, one manage different ps, one require dependecy to a module from the same author and not to more official ones ( comprehensible but can be problematic when the dependancy is with things like apache or Java ).
Obviously this is the normal characteristic of oss project but I think that this calls for more control from project' developers.
The project is a good one and with version 3 has lots of good features: we need a bunch of basic modules designed with the state of the art so that there can be a common solution over which people can develop new more complex or dedicated mods.
This could help the grown of the contributing community.

Thursday, September 06, 2012

Puppet and exported resources

I've recently started using puppet for the european project Open-DAI I'm working on and I can say that after a steep learning period the tool is really nice.

I expecially like the exported resources that allow for "piloting" the creation of resources on a remote node from a first node.

The use case is installing stuff like a DB on a remote DB host for the application we are installing.
My example case is Zabbix.
I want to install zabbix in a distributed configuration using an existing MySQL server I have on the cloud and placing the application on a new cloud host.

Usually all the example and modules I find around imply to have all the stuff on the same host.

The idea id to declare on the application node the fact that you need a DB and to transform this declaration to a command execution on the Db to provision the required DB.

I'm using puppet 3.0.rc4 and opting to use puppet-mysql from puppetlabs (I must say that there is a bit of jungle on the puppet modules around and prefer to stick and possibly contribute to the puppetlabs collection)

The solution I found is to use exported resources on the application node and collecting them on the DB node in this way

In the zabbix host

@@mysql::db { zabbix1:
user => 'zabbix1',
password => 'mypass',
host => $::fqdn,
grant => ['all'],
tag => 'new_db_nodeDBname'

On the MySQL node

class { 'mysql::server':
config_hash => {root_password => 'changeme',}
Mysql::Db <<| tag == 'new_db_nodeDBname' |>>

Now I'll have to solve the orchestration and piloting of the whole process that is after created the DB I'll have to issue a sql creation and to do so I'll need to be sure to have the DB installed so this will require to:
force a puppet agent execution on the MySQL node (possibly using mcollective)
a second run of the puppect agent on the zabbix node to check the availability of the DB and proceed with the installation.

In any case a nice start.

Thursday, April 19, 2012

Mobile app with phonegap

I've managed to implement my first application using phonegap.
I'm very happy with the results.
Operative in no time with no problems.
Made a simple dumb application in half an hour.
Next step is to add a bit of business logic behind to test all the steps that will be needed for the EU project I'm following.