Linux: pmap command

Sometimes for me, when looking for which libraries was loaded by an application (mainly java libraries) I use on Linux a command that make the work easy; first of all, get the PID of the desired application:

$ ps -ef | grep java
ccardozo  3987 3964  2 11:10 pts/0    00:00:26 /opt/java/bin/java -Dprogram.name=run.sh -server…

Inspect it using pmap command…

$ pmap -x 3987 | grep jdbc
8dc02000       0       4       0 r-xs-  jboss-xa-jdbc.jar
8dc20000       0       4       0 r-xs-  tmp3817347529030789342jboss-xa-jdbc.rar
8dc21000       0       4       0 r-xs-  jboss-local-jdbc.jar
8dc22000       0       4       0 r-xs-  tmp7198301414175265274jboss-local-jdbc.rar
8dc23000       0       4       0 r-xs-  jboss-ha-xa-jdbc.jar
8dc24000       0       4       0 r-xs-  tmp3456161463617988766jboss-ha-xa-jdbc.rar
8dc25000       0       4       0 r-xs-  jboss-ha-local-jdbc.jar
8e600000       0       4       0 r-xs-  tmp9010150622292579202jboss-ha-local-jdbc.rar
8eb80000       0      12       0 r-xs-  jboss-common-jdbc-wrapper.jar

it’s all!

Qt apps on Ubuntu

As part of our planning for Natty+1, we’ll need to find some space on the CD for Qt libraries, and we will evaluate applications developed with Qt for inclusion on the CD and default install of Ubuntu.

Ease of use, and effective integration, are key values in our user experience. We care that the applications we choose are harmonious with one another and the system as a whole. Historically, that has meant that we’ve given very strong preference to applications written using Gtk, because a certain amount of harmony comes by default from the use of the same developer toolkit. That said, with OpenOffice and Firefox having been there from the start, Gtk is clearly not an absolute requirement. What I’m arguing now is that it’s the values which are important, and the toolkit is only a means to that end. We should evaluate apps on the basis of how well they meet the requirement, not prejudice them on the basis of technical choices made by the developer.

In evaluating an app for the Ubuntu default install, we should ask:

  • is it free software?
  • is it best-in-class?
  • does it integrate with the system settings and preferences?
  • does it integrate with other applications?
  • is it accessible to people who cannot use a mouse, or keyboard?
  • does it look and feel consistent with the rest of the system?

Of course, the developer’s choice of Qt has no influence on the first two. Qt itself has been available under the GPL for a long time, and more recently became available under the LGPL. And there’s plenty of best-in-class software written with Qt, it’s a very capable toolkit.

System settings and prefs, however, have long been a cause of friction between Qt and Gtk. Integration with system settings and preferences is critical to the sense of an application “belonging” on the system. It affects the ability to manage that application using the same tools one uses to manage all the other applications, and the sorts of settings-and-preference experience that users can have with the app. This has traditionally been a problem with Qt / KDE applications on Ubuntu, because Gtk apps all use a centrally-manageable preferences store, and KDE apps do things differently.

To address this, Canonical is driving the development of dconf bindings for Qt, so that it is possible to write a Qt app that uses the same settings framework as everything else in Ubuntu. We’ve contracted with Ryan Lortie, who obviously knows dconf very well, and he’ll work with some folks at Canonical who have been using Qt for custom development work for customers. We’re confident the result will be natural for Qt developers, and a complete expression of dconf’s semantics and style.

The Qt team have long worked well in the broader Ubuntu community – we have great Qt representation at UDS every six months, the Kubuntu team have deep experience and interest in Qt packaging and maintenance, there is lots of good technical exchange between Qt upstream and various parts of the Ubuntu community, including Canonical. For example, Qt folks are working to integrate uTouch.

I’d draw a distinction between “Qt” and “KDE” in the obvious places. A KDE app doesn’t know anything about the dconf system configuration, and can’t easily integrate with the Ubuntu desktop as a result. So we’re not going to be proposing Amarok to replace Banshee any time soon! But I think it’s entirely plausible that dconf, once it has great Qt bindings, be considered by the KDE community. There are better people to lead that conversation if they want, so I’ll not push the idea further here :-) . Nevertheless, should a KDE app learn to talk dconf in addition to the standard KDE mechanisms, which should be straightforward, it would be a candidate for the Ubuntu default install.

The decision to be open to Qt is in no way a criticism of GNOME. It’s a celebration of free software’s diversity and complexity. Those values of ease of use and integration remain shared values with GNOME, and a great basis for collaboration with GNOME developers and project members. Perhaps GNOME itself will embrace Qt, perhaps not, but if it does then our willingness to blaze this trail would be a contribution in leadership. It’s much easier to make a vibrant ecosystem if you accept a certain amount of divergence from the canonical way, so to speak ;-) Our work on design is centered around GNOME, with settings and preferences the current focus as we move to GNOME 3.0 and gtk3.

Of course, this is a perfect opportunity for those who would poke fun at that relationship to do so, but in my view what matters most is the solid relationship we have with people who actually write applications under the GNOME banner. We want to be the very best way to make the hard work of those free software developers *matter*, by which we mean, the best way to ensure it makes a real difference in millions of lives every day, and the best way to connect them to their users.

To the good folks at Trolltech, now Nokia, who have made Qt a great toolkit – thank you. To developers who wish to use it and be part of the Ubuntu experience – welcome.

Originally posted by Mark Shuttleworth here on Tuesday, January 18th, 2011 at 9:01 am

Connect to Oracle DB via JDBC driver – Java

Oracle JDBC example in Java.

Download Oracle JDBC
Get Oracle JDBC driver here – ojdbcxxx.jar
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection connection = null;
connection = DriverManager.getConnection(
	"jdbc:oracle:thin:@localhost:1521:ziben","username","password");
connection.close();
See a full example to show you how to connect to Oracle database via Oracle JDBC driver in Java.

File : OracleJDBC.java

import java.sql.DriverManager;
import java.sql.Connection;
import java.sql.SQLException;
 
public class OracleJDBC {
 
	public static void main(String[] argv) {
 
		System.out.println("-------- Oracle JDBC Connection Testing ------------");
 
		try {
 			Class.forName("oracle.jdbc.driver.OracleDriver");
 		} catch (ClassNotFoundException e) {
 			System.out.println("Where is your Oracle JDBC Driver?");
			e.printStackTrace();
			return;
		}
 		System.out.println("Oracle JDBC Driver Registered!");
 
		Connection connection = null;
 
		try {
			connection = DriverManager.getConnection(
			    "jdbc:oracle:thin:@localhost:1521:ziben","username","password");
 
		} catch (SQLException e) {
 
			System.out.println("Connection Failed! Check output console");
			e.printStackTrace();
			return;
 		}
 
		if (connection != null){
			System.out.println("You made it, take control your database now!");
		}else{
			System.out.println("Failed to make connection!");
		}
	}
}

How to run it?

Assume OracleJDBC.java is store in “/home/ziben/jdbc-test” folder, together with Oracle JDBC driver (ojdbc6.jar), then run following commands :

/home/ziben/jdbc-test$ javac OracleJDBC.java
 
/home/ziben/jdbc-test$ java -cp /home/ziben/jdbc-test/jdbc-test/ojdbc6.jar;/home/ziben/jdbc-test/jdbc-test OracleJDBC
-------- Oracle JDBC Connection Testing ------------
Oracle JDBC Driver Registered!
You made it, take control your database now!
 
/home/ziben/jdbc-test$

I Hack’n Rio

Divulgando – origem: http://www.riojug.org/?p=195

O maior evento de software livre do Rio de Janeiro: I Hack’n Rio

Aproveitando toda força e união que as comunidades de Software Livre têm de promover eventos no estado do Rio, a SL-RJ (Comunidade de Software Livre do Rio de Janeiro), em conjunto com as comunidades ArduInRio, Android In Rio, DojoRio, PHP Rio, PythOnRio, Rio.pm, RioJUG, RubyOnRio e Ubuntu-RJ, vêm apresentar o I Hack’n Rio !

Apesar da palavra “hacker” atualmente estar associada a uma pessoa que explora falhas de segurança em computadores e tenta prejudicar outros, no sentido original da palavra, ela designa alguém que é profundo conhecedor de algum assunto e utiliza maneiras criativas de resolver problemas. Por isso, o Hack’n Rio não é um encontro de usuários malignos de computador, mas sim de profundos estudiosos de computação, mais especificamente software livre, e pessoas que estão buscando este conhecimento.

A idéia do I Hack’n Rio surgiu quando os entusiastas de diversas comunidades de Software Livre se encontravam nos eventos promovidos pelo nosso estado, e sempre chegavam a uma mesma conclusão: está na hora de convergir. Convergir todos os eventos específicos de cada comunidade em um só grande evento, falar e fazer sobre tudo que se vê de novidades em cada tecnologia livre adotada em nosso estado.

O grande diferencial deste evento é que ele está sendo feito por todas as comunidades. E isto quer dizer que não há a centralização de tudo numa comissão organizadora só, mas sim a distribuição da organização. Cada comunidade contribuinte terá seu espaço no evento, para utilizar do melhor jeito que a mesma souber fazer.

O nosso objetivo é realizar um evento de elevado grau técnico onde todos os participantes tenham oportunidade de aprender como as tecnologias livres funcionam a fundo e também como contribuir para sua evolução.

Por isso, planejamos a seguinte estrutura:

  • Quando? 8 e 9 de abril de 2011
  • Onde? Cidade Universitária da UFRJ, na Ilha do Fundão
  • Quantas palestras? 28
  • Quantos mini-cursos? 8
  • E o que mais? Muita mão na massa com 2 salas abertas para hackfests, como Arduino Hack Day!

Você faz parte de uma das comunidades de software livre do estado? Então você também é parte do I Hack’n Rio !

Ajude a tornar o evento um sucesso procurando por patrocinadores, buscando por conteúdo relevante e chamando pessoas que fazem as coisas acontecerem – seja construindo coisas novas, seja contribuindo com projetos já existentes.

Algumas sugestões:

  • Patrocinadores: empresas que usam software livre e querem contribuir para sua evolução; empresas prestadoras de serviço ou desenvolvedoras de softwares livres que querem encontrar talentos para contratarem (as empresas podem até mesmo fazer uma espécie de “O Aprendiz” e oferecer vagas de empregos, se desejarem) e divulgar seu nome e serviços.
  • Conteúdo: não pense só em palestras e mini-cursos, pois isso temos em qualquer evento. Pense em encontros técnicos para correções de bugs ou desenvolvimento de novas aplicações ou novas funcionalidades para aplicações já existentes.

Ubuntu 11.04: Natty Narwhal Alpha 1 Released

Alpha 1 is the first in a series of milestone CD images that will be released throughout the Natty development cycle.  The Alpha images are known to be reasonably free of showstopper CD build or installer bugs, while representing a very recent snapshot of Natty. You can download it here:

http://cdimage.ubuntu.com/releases/natty/alpha-1/ (Ubuntu Desktop, Server)

Additional ISOs and torrents are also available.
https://lists.ubuntu.com/archives/ubuntu-devel-announce/2010-December/000793.html