Installing oracle instant client on Linux

Posted in Computación with tags , , , , , , , on 20/July/2009 by Alex Pérez

This is a miniguide to install sqlplus with the minimal oracle-software fingerprint. As far as I can, I avoid to install the Oracle Client in my computers, because in MS Windows it modifies heavily the registry, and in linux you should set a lot of environment variables and deal with Oracle Universal Installer (OUI) that depends on many packages, versions, java … etc. And there is a better solution to install a simple sqlplus without installing the whole Oracle Client: oracle instant client.

I’ve used the 10.2.0.4 version, but I suppose that using any other 10.X or even 11.X version should be similar. Read more »

tcpdump – Packet size limited during capture [ENG]

Posted in Computación with tags , , , , , , on 16/July/2009 by Alex Pérez
Wireshark logo

Wireshark logo

[Due to the # of hits of this entry, I translated this to English .... my poor English xD]

I was looking why a web application was not running at all. The browser must send a request and the app should add some headers in order to login without problems … but seeing that the web application didn’t behave as expected, I decided to see what’s going on and what was sending *exactly* the browser to the app.

So, I left a “tcpdump” running in the server, and replayed the issue with the browser. When I opened the dump file with Wireshark (Ethereal fork, AFAIK), I found that too many frames got a tag “Packet size limited during capture”.

WTF?

After searching with Wireshark some strings that are supposed to exist in the HTTP request ….no luck. But I’m 100% sure that the browser is sending the string I’m searching!?

Wireshark - Packet size limited during capture

Wireshark - Packet size limited during capture

No luck. And … what’s this message “Packet size limited during capture”?

After googling for a while, it seems that older versions of tcpdump, or running tcpdump in old OSes, by default the packet size it’s truncated to 96 or 68 bytes. So, the Wireshark/Ethereal option “Follow TCP Stream” is unable to show what’s exactly going on between the broswser and HTTP server.

If we want to capture network frames full-length, you must use “-s 0″ flag. (ie # tcpdump -i eth0 -w file.cap -s 0). But in tcpdump manpage they alert that this is a lot of extra work to the server. With the “-s 0″ flag, the frames are captured with the original length, and we can follow the TCP stream as required.

HTH

Plata coloidal casera

Posted in No Computación with tags , , , , , , on 3/July/2009 by Alex Pérez

Desde hace algunos meses estoy asistiendo a lo que parece un resurgimiento de las terapias alternativas/ocultismo/paraciencias en algunos blogs que frecuento. He alucinado bastante con algunos posts acerca de:

  • chemtrails/orgonita
  • campañas anti-vacunación
  • radiestesia, astrología … etc

Sería un error pensar que esto son creencias marginales y restarle importancia al asunto. Al contrario: hace unos meses me sorprendí discutiendo con una amiga acerca de la existencia de los chemtrails. No es un problema de formación, puesto que ella es ingeniera (si, ya sé que no es garantía de nada, pero tiene un nivel alto de formación), sino que más bien lo veo como una total falta de pensamiento crítico. Y -cómo no- su discurso era bastante conspiranoico: en cuanto le respondía que algun punto de teoría hacía aguas siempre aducía la existencia de grupos de control/farmacéuticas … que se estaban encargando de que la opinión pública ignorara semejante proyecto. El colmo es el asunto de la orgonita, en el cual un compuesto de resina-cuarzo-metal se supone que emite un tipo de radiación (por supuesto: no medible, ni detectable, ni tiene efectos observables) que neutraliza la acción de los chemtrails. Como todos sabemos uno de los efectos de los chemtrails es la modificación del clima.
Con los chemtrails, alguien que sigue pensamientos mágicos para esto lo tiene fácil:

  • si no llueve, es por los chemtrails
  • si llueve, es por la acción de la orgonita que está neutralizando los chemtrails
  • si llueve demasiado, es por los chemtrails… (nunca llueve a gusto de todos, está claro xD)
  • si querías ir a la playa y llueve, es por los chemtrails
  • si hace unas semanas que no llueve, es por los chemtrails

Read more »

unos (tristes?) chistes

Posted in No Computación with tags on 26/April/2009 by Alex Pérez
  • ¿Por qué los informáticos confunden Halloween con Navidad? Pues porque 31(oct) = 25(dec)
  • ”μ”, dijo la vaca científica
  • “Un homeópata dejó de tomar su medicamento y murió de sobredosis”. (ver Ley de infinitesimales)

The UNIX haters handbook

Posted in Computación with tags , , , , , on 25/April/2009 by Alex Pérez

Buscando por ahi (no recuerdo las fuentes) he encontrado esta pedazo de joya de libro.

Sí! ya sé que está mal visto hablar mal de Linux/Unix o hablar bien de windows. Pero como ya no tenemos 15 años y tengo el vicio de leer cosas con las que no estoy de acuerdo, pues lo voy a poner igual.

El libro: The Unix Haters, del 1994. Aprovechando que últimamente estoy revisando algunos de los libros más viejos que tengo, este me ha llamado particularmente la atención. Básicamente son historias dignas del peor BOFHer, acerca de “cagadas de administrador” recopiladas a través de listas de correo/grupos de news.

Quitando el tema de que está escrito en un tono panfletario y jocoso, hay que reconocer que lo que se comenta tiene un punto de certeza. También si evitamos el tópico de que todo lo que viene de Microsoft es malo y todo lo que es GPL es bueno -nunca me gustó simplificar tanto- se puede realmente avanzar en algo. El tópico de que un administrador experimentado al que se le cuelga la instalación de SQL Server seguramente dirá: “j*** microsoft”, hará unos chistecitos acerca de algun familiar de Bill Gates … etc. Pero a un administrador experimentado en linux, no se le ocurre decir “j*** linux”. En este segundo caso, el reflejo es autoculparse; mientras que si el problema es en windows aunque la cagada sea de uno mismo, el reflejo es culpar a MS.

Y aquí va el libro en PDF:

http://www.simson.net/ref/ugh.pdf

PD: abstenerse de leer si no se tiene un mínimo de sentido del humor/autocrítica.

Shared SCSI Storage with VMWare Server 1.X and OCFS

Posted in Computación with tags , , , , , on 22/April/2009 by Alex Pérez

Sometimes, when testing software while a pilot test with virtual machines you need to emulate a SAN or setup some kind of shared storage between all nodes. I remember that some (old?) versions of VMWare products allowed SCSI controller to be shared between some nodes, and thus all the devices attached to this SCSI controller are accesible to all nodes: simple and neat. Perhaps that was an option only with VMWare Workstation, or ESX …

VMWare Logo

Free VMWare products -at least VMWare Server 1.0.X- can do the same despite it’s a bit tricky. Along this post I will explain how to setup this kind of shared storage between a group of VM. I’m using a CentOS 5.2 VM because it’s Linux and it’s 99.9% compatible with it’s RHEL counterpart that you can find at your favourite production environment. So, for this test I used the CentOS available at bagside that I found at the VMWare Appliances MarketPlace. Read more »

XSL basics

Posted in Computación with tags , , , on 12/March/2009 by Alex Pérez

I’ve been playing arround with XML and XSL transformations recently. XSL transformations may be very useful for:

  • transforming XML to XML with different structure.
  • converting XML to another well-known formats, as CSV or SQL. Then, you can pipe the output to another tools like awk/sqlplus or perform some complex querys in a RDBM.
  • simple ordering / extracting node-values from the XML. Do you want to extract only a numeric value from a SOAP-response, if there is no a “soap fault” element?

All the above possible usages make XSL a powerful tool to deal with XML specially when integrating applications.

So, lets see a sample XML file, storing some info about music CDs:

< ?xml version="1.0" encoding="ISO-8859-1"?>
<catalog>
    <cd>
        <title>Empire Burlesque</title>
        <artist>Bob Dylan</artist>
        <country>USA</country>
        <company>Columbia</company>
<price>10.90</price>
        <year>1985</year>
    </cd>
    <cd>
        <title>Hide your heart</title>
        <artist>Bonnie Tyler</artist>
        <country>UK</country>
        <company>CBS Records</company>
<price>9.90</price>
        <year>1988</year>
    </cd>
....
</catalog>

And a Java class to perform XSL transformation:

public static void main(String[] args)
    throws FileNotFoundException,
    TransformerException {
    File inXMLFile = new File("input.xml");
    File inXSLFile = new File("transformation.xsl");
    File outXMLFile = new File("output.xml");

    javax.xml.transform.TransformerFactory tFactory =
    javax.xml.transform.TransformerFactory.newInstance();

    // Get the XML input document and the stylesheet
    javax.xml.transform.Source xmlSource =
    new javax.xml.transform.stream.StreamSource(inXMLFile);

    javax.xml.transform.Source xslSource =
    new javax.xml.transform.stream.StreamSource(inXSLFile);

    // Generate the transformer.
    javax.xml.transform.Transformer transformer =
    tFactory.newTransformer(xslSource);
    // Perform the transformation, sending the output to the response.
    transformer.transform(xmlSource,
    new javax.xml.transform.stream.StreamResult(outXMLFile));
}

In the code above, there are three files:

  • input.xml: XML input file. We are using the CD catalog as input for our tests.
  • transformation.xsl: XSL sheet. The cornerstone of this test.
  • output.xml: The resulting XML from the XSL processing will be stored here. The output may no be an XML file (csv,txt,…) Read more »

incidencias HOYGAN

Posted in Computación with tags , , , , , on 30/October/2008 by Alex Pérez

Esto es una parida se mire por donde se mire, pero me ha parecido gracioso. Últimamente estoy muy viciado a Ogame, y rebuscando por los foros para ver consejos de estrategia .. etc me encontré con este pedazo de post. Me partía, asi que me puse a indagar sobre los HOYGAN, vida y milagros de una tribu del internet:

beran les cunto tango un ipone qeu lo conpre en una tin da y resufrta que llo lo en siendo y entonses esta en sendido y sale la man sana la man sana que da bueltas y abla y despues sale como si tubiese un briquiage es desir esta como briquiado yo el ipone lo avia jaquiado y funsiono funsiona va asta que de go de funsionar porfabor que peudo aser estoi des esperado por que es tube haorriando durante muncho timpo y aora no funsiona nesesito alluda ur gente grasisrasias [1]

preg qlia,bueno la wa es qu no puedo estar mas aburrio y pense ya voy apreg una wea qu siempre quise saver(aparte de kerer saver para

qu xuxa toi vivo) y me asalto esa pregunta… si el ocio me hace pensar en puras weas.

en fin la wa es qu todo el mundo anda hablando de facebook y la wa qu es bkn y esa onda
y onda me da risa x qu todos los dias llega un wn y me dice :”"oye wn hacete un facebook, el otro dia pille a un ex-compañero de pre-kinder y ahora somos super amiguis y carreteamos”
ademas que me tiene hinchado el sistemilla este, no por si mismo, sino por lo mucho que explotó acá. Me hablan de él , en el diario, en el instituto, en la micro, en la TV.

y weno eso a ti, usuario de Facebook, te pregunto, qué gracia le encuentras a esa wea?
eso po [2] Read more »

tcpdump – Packet size limited during capture

Posted in Computación with tags , , , , , on 28/October/2008 by Alex Pérez
Wireshark logo

Wireshark logo

Despues de medio superar la crisis postvacacional, ahora que está tan de moda la palabra crisis … volvemos.

Estaba yo buscando porqué no funcionaba una aplicación. Se suponía que el navegador del cliente debía hacer la petición y meterle algunos headers para poder autenticar sin problemas. Al ver que la aplicación no se comportaba como tocaba, decidí ver qué estaba mandando exactamente el navegador del cliente.

Así que, manos a la obra, dejo un “tcpdump” ejecutando en el servidor y reproduzco la incidencia con el navegador. Al abrir el volcado con Wireshark (el sucesor de Ethereal), me encuentro que muchos frames tienen la nota “Packet size limited during capture”.

Ein?

Varios intentos de buscar cadenas de texto en las peticiones HTTP … sin resultado. Pero, ¡estoy seguro de que el cliente está mandando esa cadena en la petición!.

Wireshark - Packet size limited during capture

Wireshark - Packet size limited during capture

Nada, que no hay manera. ¿Y ese extraño mensaje “Packet size limited during capture”?

Al googlear un rato, parece que versiones viejas de tcpdump, o en SOs “viejos”, por defecto se trunca el tamaño del paquete a 96, o 68 bytes. Con lo cual, la opción “Follow TCP Stream” queda inútil en lo que a HTTP se refiere.

Así que, si queremos capturar toda la longitud de los paquetes, hay que usar la opción “-s 0″. Ojo, que según el man, esto supone mucho más trabajo para el equipo y tal. Pero al final, captura todo todito, y podemos hacer el Follow como es debido.

Espero que esto le sea útil a alguien más!

LDAP/Jira user importing: jira-ldap-userimporter

Posted in Computación with tags , , , , on 28/September/2008 by Alex Pérez
JIRA - Bug tracking, issue tracking and project management software

I’ve slightly modified the jira-ldap-userimporter script to fit my needs. This script manages the Jira-LDAP integration, by doing a LDAP query to a server and generating a Jelly Script that can run througt the Jira’s Jelly Runner. The goal of this modification is accepting some parameters in the ldap.properties to optionally wrap the <jira:createUser> tags with a <jira:Login> tag, this way the resulting Jelly script can be run as a service.

In my scenario there are continuously adding/removing users, so I should run the jira-ldap-userimporter with crontab and executing the output as Jelly service. I found this modification may be useful for other people.

Executable XML

Jelly - Jelly : Executable XML

You can download the jar file from the project’s page, and set the jelly.service=1, jelly.username and jelly.password in ldap.properties.