Tuesday, July 12, 2005

Tiempo sin escribir.

Aqui esta para hacer conexiones a una base de datos en Oracle:

Class.forName("oracle.jdbc.driver.OracleDriver");
Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@ip_database:1521:contextdb","username","password");

Y si la conexion es desde un recurso de tomcat es asi:

Context initContext = new InitialContext();
Context envContext = (Context)initContext.lookup("java:/comp/env");
DataSource ds = (DataSource)envContext.lookup("jdbc/myoracle");
Connection conn = ds.getConnection();

el resto es asi:
PreparedStatement ps = conn.prepareStatement("select * from dual");
ResultSet rs = ps.executeQuery();
while (rs.next()){
out.println(rs.getString(1));
}

Saludos, por cierto... ya me case.. ahora pongo las fotos con mi bella esposa

Tuesday, March 01, 2005

Unexpected Signal 11 (Ocurre mucho con java)


OpenNMS will stop working after a period of time - this varies with the number of threads configured for the various daemons.

Intermittent servlet errors are encountered in the Web GUI - this seems to vary with the amount of concurrent usage of the GUI.

This has so far been reported with:

* Debian Woody/Sid, RedHat? 8.0/(7.x?), SuSe? 8.1
* OpenNMS 1.0.1
* Sun JDK 1.4.0, 1.4.1, 1.4.1_01
* Tomcat 4.0.3-0


Check for file like hs_err_pid9499.log in the directory that OpenNMS or Tomcat was launched.

It contains:

Unexpected Signal : 11 occurred at PC=0x404D4324
Function=size_given_klass__7oopDescP5Klass+0x44
Library=/usr/java/j2sdk1.4.1_01/jre/lib/i386/server/libjvm.so

Looking at the bottom of the dump file shows this:

#
# HotSpot? Virtual Machine Error : 11
# Error ID : 4F530E43505002E6
# Please report this error at
# http://java.sun.com/cgi-bin/bugreport.cgi
#
# Java VM: Java HotSpot(TM) Server VM (1.4.1_01-b01 mixed mode)

Doing a Google search on the error ID shows that it appears with other apps as well.

Here is an excerpt from one article:

I have seen this problem come up with a variety of applications, most notably JBoss 3.X. The way I got around it was specify the -Xrs and -Xint options to the VM before running any application.


Doing a "man java" gives:

-Xint Operates in interpreted-only mode. Compilation to
native code is disabled, and all bytecodes are exe-
cuted by the interpreter. The performance benefits
offered by the Java HotSpot VMs’ adaptive compiler
will not be present in this mode.


-Xrs Reduce usage of operating-system signals by Java
virtual machine (JVM).

Sun’s JVM catches signals to implement shutdown
hooks for abnormal JVM termination. The JVM uses
SIGHUP, SIGINT, and SIGTERM to initiate the running
of shutdown hooks. The JVM uses SIGQUIT to perform
thread dumps.

Applications that embed the JVM frequently need to
trap signals like SIGINT or SIGTERM, and in such
cases there is the possibility of interference
between the applications’ signal handlers and the
JVM shutdown-hooks facility.

To avoid such interference, the -Xrs option can be
used to turn off the JVM shutdown-hooks feature.
When -Xrs is used, the signal masks for SIGINT,
SIGTERM, SIGHUP, and SIGQUIT are not changed by the
JVM, and signal handlers for these signals are not
installed.


Note that -X options are non-standard and may change in the future.

Running with "-Xint -Xrs" results in stable operation.

In /opt/OpenNMS/bin/opennms.sh, find "HOTSPOT" and add the "X" flags like this:

if [ -n "$HOTSPOT" -a "$HOTSPOT" = true ] ; then
JAVA_CMD="$JAVA_CMD -server -Xint -Xrs"
fi


Also in /etc/tomcat4/conf/tomcat4.conf change the CATALINA_OPTS line like:

export CATALINA_OPTS="-Xint -Xrs -DTOMCATLAUNCH=true...

thats it...

Wednesday, February 02, 2005

Tu X ocupa mucha memoria en el TOP?

SI es asi, entonces estas bien

lee esto
http://info-x.co.uk/docview.asp?id=117

. Overview of memory management
Traditional Unix tools like 'top' often report a surprisingly small amount of free memory after a system has been running for a while. For instance, after about 3 hours of uptime, the machine I'm writing this on reports under 60 MB of free memory, even though I have 512 MB of RAM on the system. Where does it all go?

The biggest place it's being used is in the disk cache, which is currently over 290 MB. This is reported by top as "cached". Cached memory is essentially free, in that it can be replaced quickly if a running (or newly starting) program needs the memory.

The reason Linux uses so much memory for disk cache is because the RAM is wasted if it isn't used. Keeping the cache means that if something needs the same data again, there's a good chance it will still be in the cache in memory. Fetching the information from there is around 1,000 times quicker than getting it from the hard disk. If it's not found in the cache, the hard disk needs to be read anyway, but in that case nothing has been lost in time.

To see a better estimation of how much memory is really free for applications to use, run the command:
Code:
free -m
The -m option stands for megabytes, and the output will look something like this:
Code:
total used free shared buffers cached
Mem: 503 451 52 0 14 293
-/+ buffers/cache: 143 360
Swap: 1027 0 1027

The -/+ buffers/cache line shows how much memory is used and free from the perspective of the applications. Generally speaking, if little swap is being used, memory usage isn't impacting performance at all.

Notice that I have 512 MB of memory in my machine, but only 503 is listed as available by free. This is mainly because the kernel can't be swapped out, so the memory it occupies could never be freed. There may also be regions of memory reserved for/by the hardware for other purposes as well, depending on the system architecture.

y lee esto-.....
3. The difference among VIRT, RES, and SHR in top output
VIRT stands for the virtual size of a process, which is the sum of memory it is actually using, memory it has mapped into itself (for instance the video card's RAM for the X server), files on disk that have been mapped into it (most notably shared libraries), and memory shared with other processes. VIRT represents how much memory the program is able to access at the present moment.

RES stands for the resident size, which is an accurate representation of how much actual physical memory a process is consuming. (This also corresponds directly to the %MEM column.) This will virtually always be less than the VIRT size, since most programs depend on the C library.

SHR indicates how much of the VIRT size is actually sharable (memory or libraries). In the case of libraries, it does not necessarily mean that the entire library is resident. For example, if a program only uses a few functions in a library, the whole library is mapped and will be counted in VIRT and SHR, but only the parts of the library file containing the functions being used will actually be loaded in and be counted under RES.




Sunday, January 30, 2005


volmar y yo en margarita Posted by Hello

Monday, January 17, 2005

Fedora

I found this useful information about fedora that i didnt know
perhaps is something very known but i didnt know it.

enjoy ...

Fedora Linux Installation: "
/boot: the kernel boot files
/etc: configuration files
/dev: device files
/lib: basic dynamic libaries ('.so'), the kernel modules
/proc: process information
/bin: system programs
/sbin: system programs which don't use dynamic libraries
/tmp: world writeable for temporary files
/usr: the bulk of the software
/usr/local: additional software not installed through packages /var: apache web server, user mail, ...
/home: user accounts
/root: the home directory for root

Whenever a command in prefixed by $, it is meant to be executed by a non-root user, when prefixed by a # it is meant to be executed by root.

startx -- :1 (start your X manager on DISPLAY window 1)

Also, to run kdm and not gdm one have to change
vi /etc/sysconfig/desktop
DISPLAYMANAGER="KDE"

i found out reading the code in
vi /etc/X11/prefdm

and to make it work, the system must be rebooted
well maybe it can be simpler than that but i dont know
what to do (i even did init 1 init 5 and it didnt change),
theres so many things to learn in unix
i am just a kid in all this

Happy Hacking




Friday, January 14, 2005

Slashdot | Gates Elaborates on IP Communists

Great quote!!!
Slashdot | Gates Elaborates on IP Communists: "War is like love, it always finds a way. -- Bertolt Brecht, 'Mother Courage'"

1 John 4:20,21

If anyone says, “I love God,” yet hates his brother, he is a liar. For anyone who does not love his brother, whom he has seen, cannot love God, whom he has not seen.

21And he has given us this command: Whoever loves God must also love his brother.

Excellent thought... i want to give the look of my desktop



do you like it?

Thursday, January 13, 2005

Slashdot | Backing Up is Hard to Do?

Un script interesante para hacer backups.

href="http://linux.slashdot.org/linux/05/01/13/1745226.shtml?tid=198&tid=106">Slashdot | Backing Up is Hard to Do?: " if [ `df |grep /media/BACKUP |wc -l` == '0' ]
then
echo Backup drive not mounted, skipping procedure
exit 2
fi
cd /media/BACKUP
nice -n 10 rsync -va --exclude-from=/root/exclude $1 $2 $3 $4 $5 / .

where /root/exclude contains:

/mnt
/proc
/tmp
/udev
/sys
/media "

Great site for suse rpm packages

Despues de buscar y buscar encontre el mejor sitio para paquetes de suse linux.

enjoy....

PackMan.Links2Linux.org: "Development

Finance

Games/Amusements

Graphics

Internet

Kernel

Libraries

Update! Multimedia

Update! Network

Other

Security

System"

Tuesday, January 11, 2005

setear JAVA_HOME en linux

Esto me ayudo mucho :D:D:D:D

ABIERTOS.ORG: "Hola,

Tienes que tener la ruta absoluta del j2sdk en la variable de ambiente PATH.

ej.:
[CAMBIA A ROOT]
en /etc/profile, antes de los export, anade esto:

JAVA_HOME=/ruta/hacia/mi/j2sdk y luego;
PATH=$PATH:$JAVA_HOME/bin y luego;
export JAVA_HOME y luego;
source /etc/profile [ESTE PASO COMO USUARIO NO-ROOT]

Si no te funciona, verifica que tu ruta sea la correcta. Entonces ya estaras preparado para escribir java[ TECLA TAB] y se desplega todas las concidencias a java, significando que esta bien.

Si es muy engorroso, prueba con:
export PATH=$PATH:/ruta/hacia/j2sdk/incluyendo/directorio_bin

El problema es que con esta sola linea cuandos apagues tu pc tendras que hacerlo nuevamente."


SMB HOWTO

Excelente howto para cuando se necesite usar samba.

saludos
SMB HOWTO: "SMB HOWTO
David Wood, dwood@plugged.net.au
v1.3, 20 April 2000

This is the SMB HOWTO. This document describes how to use the Server Message Block (SMB) protocol, also called the Session Message Block, NetBIOS or LanManager protocol, with Linux using Samba.

1. License

2. Introduction

3. Further Information

4. Installation

5. Running The Daemons"

....

GOOOOODDD

Para conectarse remotamente a DB2 desde linux sin problemas usando java

para windows y linux:

1. instalar db2 en el servidor o en el gateway si te conectas al gateway.
2. tomar el db2java.zip del directorio de java de sqqlib en el servidor y ponerlo en un directorio que este en el classpath (no puede ser otro)
3. el servidor debe estar corriendo el jdbc driver server en el puerto 6789 (facil de recordar) (esto si se usa el driver net)
4. hacer la conexion usando COM.ibm.db2.jdbc.net.DB2Driver
5. usar el formato siguiente para el string jdbc:db2://host:6789/db
6. listo (se debe estar pendiente de las rutas de conexion si el servidor esta en otra subred)

Esta pregunta me parece interesante por eso la copie ;):

I've got some problem with db2-jdbc:
I've got UDB Personal on Win 2000 and I can't connect to my server /UDB on Linux/, from java.
I've done it with the following driver/dburl:
COM.ibm.db2.jdbc.app.DB2Driver
jdbc:db2:DATABASE
But, if I set the URL on the following way:
ConnectionURL=jdbc:db2://hostname:523/DBName
I've got thefollowing error meassage:
"Error opening socket. SQLSTATE=08S01"
I've tried it with COM.ibm.db2.jdbc.net.DB2Driver too, but it didn't work.

IBM UDB: db2 - jdbc problem: "
Port number 523 is used for db2 admin server.

For jdbc connection, try the default port 6789
or the port number specified when you start
the demon.

Make sure the java demon (db2jd) is running.
('ps -ef | grep db2jd' to check the process)

If not, start it using 'db2jstrt' [default to port 6789]
or 'db2jstrt port_number'.
('netstat -na' can be used to check the port number)
"

necesitamos una foto aqui:

eso esta mejor...

Thursday, January 06, 2005

Chat application using multicast

Hoy estuve hablando con efrain sobre una aplicacion que hicimos en operativos que permitia compartir archivos, chatear, foro, etc
en lan usando ip multicast.
Esta es parte de la conversacion:

(09:31:24) Efrain: para que si tenemos nuestro messenger distribuido do operativos que le entregamos a figueira
(09:31:35) Fredo (Leyendo tu correo): jajajaj
(09:31:41) Fredo (Leyendo tu correo): verdad que eso si era bueno
(09:31:46) Fredo (Leyendo tu correo): yo creo que deberiamos patentarlo
(09:32:06) Efrain: el problema es que todo el mundo ve a todo el mundo
(09:32:29) Efrain: habria que hacerle unas modificaciones menores
(09:33:33) Fredo (Leyendo tu correo): cobrar por licencias dices?
(09:33:53) Fredo (Leyendo tu correo): $$$$$$$$$$$$$$$$$$
(09:34:02) Efrain: no no no
(09:34:04) Fredo (Leyendo tu correo): (L)$(L)$(L)$(L)$(L)$(L)$(L)$(L)$(L)$(L)$(L)$(L)$
(09:34:06) Efrain: eso es muy antiguo
(09:34:09) Efrain: es un modelo malo
(09:34:12) Fredo (Leyendo tu correo): aja
(09:34:16) Efrain: debemos usar el modelo BREW
(09:34:20) Fredo (Leyendo tu correo): como es eso?
(09:34:21) Efrain: Cobrar cada vez que lo uses
(09:34:27) Fredo (Leyendo tu correo): jjajajaaj
(09:34:59) Efrain: $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
(09:40:00) The conversation has become inactive and timed out.
(09:42:25) Fredo (Leyendo tu correo): SI SI SI
(09:42:36) Fredo (Leyendo tu correo): I THINK I SHOULD BLOG THIS
(09:43:10) Efrain: :P


esta es la foto del pana:


jijijijiji jujujuju

Gambas IDE = VB linux

Esto de gambas podria ser el visual basic para linux que estabamos esperando. Excelente para los que no saben C++ o java o c#.
Mi novia esta haciendo este blog conmigo .... un besito para ella

Slashdot: News for nerds, stuff that matters: "A few months ago, the GPL IDE Gambas reached 1.0 release candidate phase, and now reader drfreak writes 'Gambas has now hit 1.0 and looks promising as GNU/Linux's answer to Visual Basic. Now, if it ran in Windows too, it would truly crush VB for database applications. Check it out at gambas.sourceforge.net.' A 1.0.1 release came out on January 3rd to fix a few bugs."

Wednesday, January 05, 2005

Te quiero mucho nenita

En estos momentos mi nenita preciosa esta leyendo mi blog.

Yo la amo mucho.. Ella se llama volmar...

yo le regalo este FLOR



Nos vamos a casar pronto.
:D:D:D:D

Firefox mucho mas rapido que ie

Con este truco pude hacer volar a firefox mas que ie.
yujuuuuuuuuu
href="http://www.freemode.net/archives/000136.html">freemode.net: Firefox 0.9 Released: "Firefox 0.9 Released

Woo-hoo! The best web browser out there just got better. Mozilla Firefox 0.9 has been released. Read all about it on slashdot, or get it yourself.

It's faster than its predecessor out of the box, but you can improve its speediness by applying a few hacks to enable HTTP pipelining for page requests and speed up page rendering (see original post by MatthewHSE at webmasterworld):

Type 'about:config' in your FireFox address bar. Scroll down a bit in the list.
Set network.http.pipelining to 'true'.
Set network.http.proxy.pipelining to 'true' if you use a HTTP 1.1-compliant
proxy server.
Set nglayout.initialpaint.delay to 0 to improve rendering speed.

While you may run into connection problems with some older or unusual web servers that don't support HTTP pipelining, these settings will noticeably improve your overall browsing speed. You may also notice some odd visual artifacts with CSS layouts - if this bugs you, set nglayout.initialpaint.delay back to the default (250). There's more technical information available on the MozillaZine forums."

Umbrello UML sounds like a good tool

I found this tool under sf.net and i think maybe can help me do what i want here at my job.

This the feature list:
Umbrello UML Modeller Features: "Alpha: Umbrello 1.4 (KDE 3.4, Spring 2005)

If you want a feature added, checks the beastie database and add a wishlist if it isn't already there. All code contributions welcome.

Planned features include:

* XMI standard compliance
* Move canvas items using the keyboard
* PHP 5 code generator
* Fixed many issues in Perl code generator
* Sequence diagrams can now create objects
* Notes are editable directly
* Tabbed diagrams
* Entity Relationship diagrams

Umbrello 1.3.2 (KDE 3.3.2, December 2004)

* Not much difference, most work happening in HEAD

....

Blogthis awesome

I came to find something called blogged this, an extension for firefox. IT IS AWESOME. it leaves me copy things to my blog so i can remember it next time if i look in my blog.... gooooooooood thing..

mozilla extension page


Frase para el dia de hoy:
"In a word without walls and fences, what are Windows and Gates for?"
Dont-know-who

First blog. Whats so fun about this?

hello everyone, i would like to say hi to all of you
i normally speak spanish, so sometimes i'll write in spanish and some other times
i will write english.

supongo que uno hace monologo aqui y luego se lee uno mismo.
esto ya lo he hecho antes en el notepad pero supongo que no queda grabado.

i'd like to say that i dont like CAPITAL letters. dont know when to write them. so i will never
use it. I guess thats ok.

bueno para que se vayan ambientando, esto es lo que van a conseguir en este lugar:
First. I love Jesus, i am christian. first and more important.
Second, i am a linux geek, i read everyday http://slashdot.org/, i even have a slashdot hat i bought from thinkgeek.

how do i do to stay christian? i pray and hear praises music. praise the Lord.

otra parte de mi es que no me gusta dormir, siempre estoy leyendo o haciendo algo. a veces voy al trabajo medio dormido, pero bueno me gusta aprovechar todo el tiempo.

lastly... i live in caracas venezuela. So hi to you all from venezuela.

This post needs a picture



nice one, i love it.