Sunday, February 16, 2014

Fedora 20 release party at Red Hat São Paulo Office

Hi Guys!

I discovered a new event these days.On January 18th happened Fedora 20 Release Party at Red Hat São Paulo Office (here in Brazil). This event is a very special opportunity to get in touch to the contributors and subject matter expert which can answer almost anything about Fedora (and other Open Source stuff). You can also learn about the new features that Fedora is about to release, like Leonardo Vaz (the organizer of this event and a very cool metal open source friend =) ) talked about . And you can also learn some bleeding edge technologies, for example in this time  Ricardo talked about Openshift, a PaaS solution.

This event is really cool and everybody can go:

  • If you are just starting to use Linux;
  • If you are SysAdmin;
  • If you are a developer;
  • and so on.
Feel free to reach the people from the Fedora 20 Release Party close to you and let's share and learn information =D.

Below some photos of that day:

Monday, January 27, 2014

Quick tricky tip about JBoss CLI - stop a single server

Hello, guys.

I really like JBoss CLI, but sometime its syntax is pretty tricky and Google does not help. So, once for all: "How do you stop a single server instance in domain mode??" Yeah, not a group or a full host, but just a single server instance.

There it goes!



Hope it helps you!

Wednesday, January 8, 2014

What the hell is OSGi?

Hello, guys! Happy 2014!

Let's start this new year talking about a very nice and popular subject - OSGi. Have you already heard about it? What the hell is this OSGi that many people have been talking about?

The name OSGi comes from Open Services Gateway initiative. This name is now obsolete, since none refers OSGi for this initiative. OSGi talks about modular applications. No, not modular apps such as Maven apps and it's modules. Maven apps contain multiple sub-apps usually divided by function (web module, ear module and so on). When we talk about OSGi, we are talking about small pieces that together become a single application. This is pretty different from Maven concept, that works with applications that depend on each other and have a parent.

These small pieces of an application act like independent components. You could easily replace or upgrade them without stopping the application itself. Think about this situation as if your application were a car. A car has many independent components. You can change the car's tire without needing to buy an entire new car. Use the same idea for your application. You would be able to change one CRUD of your web app without needing to stop and start the whole application.

These small and independent pieces are usually referred as OSGi bundles (or just bundles). Your OSGi bundles can act together and compose your OSGi app with the help of an OSGi container/framework. There are many OSGi frameworks. Apache Karaf, placed inside JBoss Fuse, is one example. To be considered an OSGi framework, the container shall follow some specifications determined by OSGi maintainer groups.

This quick post just wanted to give you a brief idea about the meaning of OSGi. A nice book about this subject is OSGI in Action, from Manning Publications.

This is it! Hope you have enjoyed!

Wednesday, November 20, 2013

JBoss AS 7 - deploying modules globally on domain mode

Hello, guys! It's been a while, huh?

We are sorry for that. Luan and I are very busy writing a Maven book and giving a lot of talks in many conferences around Brazil and abroad.

Let's dive into our post!

In this post you will learn that your expose your framework/library throw modules and if you want that it automatically be access by any application deployed you can simplify your life declaring it as a global module (instead declaring the module each time in the application's XML)

While working on JBoss on domain mode, you might have to deploy your own modules. You can declare the modules on CLI in a way like that:

 /profile=MYPROFILE/subsystem=ee:write-attribute(name="HOSTNAME", value=[{"name"=>"com.ourdailycodes","slot"=>"main"}]  

Seems easy, huh?

But what happens if you do not want do add modules per HOST, but globally?

Well, there's a good trick for that.

Into domain.xml file, locate the subsystem where you want to add your module. In our case, it's "ee" subsystem. Then, add the tag <global-modules> as follows:

 <subsystem xmlns="urn:jboss:domain:ee:1.1">  
        <module name="com.ourdailycodes" slot="main"/>  
      <!-- Other subsystem configuration -->  

Done! By declaring that your modules will be visible globally to all hosts of a certain profile.

More information here:

There! Hope it helps you! You can ask any doubt a the comments section below =D Thank you!

Wednesday, October 2, 2013

Our Daily Codes now with weekly posts!

Hello, guys!

Luan and I were feeding the blog everyday with a new post. But it had been a very hard work to do, plus the fact that most people did not had time to read it everyday.

So, to not dismiss forces, we will start blogging every week, instead of one post per day. The experience of daily blogging was very nice. It was a big challenge in fact; we had to adjust our routines to be able to write and propose high quality tech posts.

We believe that we can improve our blog if we have more time to build the ideas for the further posts. We hope you keep reading the blog! =) We will try to vary the topics as we do to always bring fresh news from different parts of IT world =)

Tuesday, October 1, 2013

Neo4j - first steps

Hello, guys!

Some days ago we posted a very basic introduction about Neo4j. Let's see something more practical today! Let's give our first steps with Neo4j.

First thing we have to do is installing our database. If you use Mac OS, you can easily install the newest Neo4j version with HomeBrew. You need to have JDK 7 in order to see things running fine. Open a terminal and type:

 brew update  
 brew install neo4j  
 neo4j start  

Done!! Wait some minutes for Neo4j installation and after typing "neo4j start" you will have it up and running.

You can do a similar process for Linux or Windows. Or you can download the tar.gz file and do a manually installation process. You can have more information about downloading installing Neo4j here.

After starting Neo4j, you will see a message like this:

Accessing the suggested URL (http://localhost:7474/webadmin/), you will notice a panel with a look and feel similar to this:

You can take a tour for the web interface or check some tutorials.

We will create a sample quickstart Neo4j project to be able to create a Hello World sample. The project is at Github and you can download it here. You will need Maven to run the project.

Neo4j has several ways to run. We have showed you the traditional way to run it. However, it can run into an embedded form into Java applications. We will use this form for our first example. It is pretty fast and simple to use, but be aware that it is not good to use Neo4j embedded in production environments!

Take a look at the project, into the package com.ourdailycodes.neo4j_quickstart.helloworld (if you did not cloned the project from Github, follow this link to observe the classes). You will notice two classes. Let's explain them quickly. The first one and more important is It has a main method that starts Embedded Neo4j at the first method line:

 GraphDatabaseService graphDb = new GraphDatabaseFactory().newEmbeddedDatabase("database");  

This will create an embedded database into a folder called "database".

On the sequence, we start a transaction and create the nodes and relationships. We create two nodes - Pokemon and Trainer, and create a relationship between them. the relationship is declared into the class There, we defined CAPTURES relationship. After creating the nodes, we set a relationship between them. Then, we "commit" the transaction and shutdown the database.

There are several tools where you can visualise your final graph. One of the is Neoclipse tool, a nice open source tool to have a graphic representation of your graphs. Other graphic tools for Neo4j listed on this Stackoverflow answer.

This is it! Today we have seen a short quickstart about Neo4j: how to install full version and how to start a simple Java project, start embedded version and create nodes and relationships. NOTE: the project on Github will have more codes on other packages; they will be used on further posts to show more Neo4j examples. The examples on other packages different from the one mentioned on the post may not be working perfectly yet. Please be patient and wait for the next posts =)

Thanks for reading!

Productive Developer - Using IDE and RAD to be effective

Hi Internet!

Today I'm going to talk about being effective as a Developer/Software Engineer and some hints like to when it is good or not to use such Rapid Application Development (RAD) tools and Integrated Development Environment (IDE)s.

I was astonished when I couldn't find an wikipedia article describing this better, at least they have an article to reference RAD tools (not all of them, for example it is missing the JBoss Forge). So I thought I could help a little bit writing this post and reminding some good references to allow us to better understand our time and make the right decisions.

The idea behind RAD (and part of the IDE concept as well) is to increase the productive of the developer. In a nutshell, you would use a tool, for example some linux-based commands, that would make awesome applications very fast. So any simple command would result in instant (maybe even big) results. In this link tells more how the buzz-word RAD changed over the time, like the PERL language which was designed to be an RAD (it seems very weird but compared how the term is used nowadays).

For Java, I would recommend two RADs: Spring Roo (homewikipedia and source code) (unfortunately the Spring website changed and many links for that are broken) and JBoss Forge (home and source code) (it has a nice getting started in the documentation, mastertheboss and quickstarts in JDF). Those two guys are the state of art when the subject is RAD for Java. They will provide a good way to create instantaneously an entire applications following some internal scripts, maintain the code and insert new features without any trouble. Of course for big projects it probably be not a good choice to use RAD tools due the amount of details of your business require. But for Proof of Concept or a bootstrap for an application it might give a lot of help as it not only gives you a well-organized and good quality code but it also provides with Maven a way to keep the organizations and management of the project even after removing the RAD tools. Another good use of RAD tools is to learn new technologies and how to integrate them. Is like creating on the fly cool examples where you can test and destroy without worry due it is is very easy to re-build from scratch. There is an old dzone article  that talks more about those things for Spring Roo (but it is equivalent for JBoss Tools too).

My conclusion, first of all: there aren't silver bullets. It won't be just one little change like using a RAD will solve all your problem, specially if you going to buy such tool. You need a good team, always. About IDE, my advice is to try to master the shortcuts of your favorite IDE (like NetbeansIntelliJEclipse) also combining the best plugins available on market. For RAD, use it wisely and learn from the technologies already on them (even the technical preview ones, I know you will probably find a bug, but you can get the hands on and solve the problem and learn much more from this).

Thank you for reading, hope you enjoyed!

Luan Cestari