Smart ps
Just a minor Linux hack. You can override ps command to get rid of the usual | grep -v grep.
Define your own ps version in /usr/local/bin:
#!/bin/bash
/bin/ps $@ | grep -v -e "^.* \+.\+ $$ \+.*" | grep -v grep
Don't forget to make it executable, but make sure you have complete control of the basic commands you execute, since overriding commands such as ps is the first thing to do when implementing rootkits.
Updated on 02/14/08 20:40:34
QueryJ screencast
I recorded a screencast that describes the methodology we use at Ventura24 regarding designing, modelling and accessing persistence layers from an application.
I'd have wished to spend more time explaining QueryJ in particular, but it was only part of what we wanted to describe. Anyway, you can enjoy the QueryJ experience without installing it :).
The screencast is 50-minute long, and take into account I'm not as fluent in english as I'd like.
There're two versions, the original (1280x1024), in both ogg format, and one adapted for ipod.
In any case, I'd be glad to hear about your comments.
Files:
- Screencast in Theora (video) + Ogg Vorbis (audio) screencast.ogg.
- Screencast converted for watching in iPods screencast.ipod.mp4.
- Screencast in MP4 format screencast.mp4.
Updated on 02/12/08 07:01:48
QueryJ screencast
I recorded a screencast that describes the methodology we use at Ventura24 regarding designing, modelling and accessing persistence layers from an application.
I'd have wished to spend more time explaining QueryJ in particular, but it was only part of what we wanted to describe. Anyway, you can enjoy the QueryJ experience without installing it :).
The screencast is 50-minute long, and take into account I'm not as fluent in english as I'd like.
There're two versions, the original (1280x1024), in both ogg format, and one adapted for ipod.
In any case, I'd be glad to hear about your comments.
Updated on 11/01/07 21:47:13
As you may already know, the main development of QueryJ is right now being pushed by Ventura24 requirements.
We are including more features as soon as we find nice-to-haves. First, the query validation, the customization of templates to make Spring be aware of heterogeneous transactions (Connection/DataSource), some performance improvements, and so on.
Lately I made QueryJ support a dsl to support logical statements as part of the comments of the physical table model.
So far, the following statements are interpreted:
Used to improve performance by avoiding the need to access the database to operate on certain static tables, such as typecodes. This keyword makes QueryJ generate constants in the Java side with the contents of the table, at development time. The column-name is used to build the constant name.
Identifies the table as a child of given one. This means it inherits parent's attributes and relationships, besides its own.
(...)
Blog/podcast thoughts
I read somewhere the average lifetime of a blog is 6 months.
Despite I write less often lately, and that my posts are brief explanations of simple scripts or news, I plan not to stop writing.
Now I'm not sure whether using Trac as blogging system fulfills my needs. I don't really care about formatting too much, so wiki-like format support is enough for me. The important thing is RSS. I'll go on with current deployment, since anyway I don't think I have enough hardware resources to install a separate blogging system.
The reason why I wanted to start blogging has not changed: I still like to share some opinions, thoughts, or pieces of work. At first it can be a little embarassing, but it also pays back.
So I'll try to retake some unfinished topics. But during last year, I've become a podcast addict
Error: Failed to load processor FootNoteNo macro or processor named 'FootNote' found
, even though all I listen is in english and I don't understand everything since it's not my mother language.
(...)
Updated on 07/22/07 09:08:28
Server moved to Atlanta
The websites for www.acm-sl.org, svn.acm-sl.org, and www.acm-sl.com have now moved to a remote UML-based hosting.
The server is not full of resources, but now that I can compare I think the bottleneck was my home ADSL connection.
Let's hope hosting provider offers vserver-patched uml-compatible kernels someday soon...
Updated on 07/21/07 10:09:23
Script to display inline descriptions of USE flags from emerge -uv output
When updating a gentoo system, knowing what are each USE flag for is important.
USE flags affect how each package is built, whether it includes support for optional features, and so on.
For that reason, I pay attention to each flag. It makes me constantly grepping /usr/portage/profiles/use.* to know what is the meaning of each flag.
I've created a script to parse emerge -uv output and display the description of each affected flag, so that you can setup your /etc/portage/package.use/ file accordingly.
If you're interested, you can find it here.
Script to sort USE flags
When updating my system, mplayer got affected, and I found out that I already had a number of USE flags defined in my /etc/portage/package.use/mplayer.
I like to maintain the USE flags sorted alphabetically, so I decided to write a simple script to do it for me.
If you're interested, you can find it here.
Updated on 07/07/07 16:36:45
Unhiding custom entries in /proc in vservers
I use vservers very often. They are easy to maintain and to deploy, and allow clean environments for servers with different purposes, avoiding the need to invest money on hardware resources.
I recently installed Oracle on a vserver, and got some errors from the Enterprise Manager application saying:
java.lang.Exception: Cannot read /proc/partitions
I noticed that such file was not unhidden by vprocunhide script. Such script uses two configuration files (in given order):
- /etc/vservers/.defaults/apps/vprocunhide/files
- /usr/lib/util-vserver/defaults/vprocunhide-files
The format is simple: each line points to a file in /proc to unhide. You can actually hide them, prepending a - character.
Refer to the actual source code for /usr/lib/util-vserver/vprocunhide to get the full options and syntax.
In our context, we just need to
mkdir -p /etc/vservers/.defaults/apps/vprocunhide/
(...)
Updated on 06/14/07 06:38:17
Firefox Add-ons
I've just created a page with Firefox Add-ons, their links and brief descriptions, so that I can evaluate them and have an homogeneous toolset in all computers.
Take a look if you're interested: firefox-addons.
Script to generate bibtex entries from filenames
I've written a small bash script to generate BibTeX entries from the information found in the filename passed as argument.
Since the pdf files I have respect a format like this:
publisher - book name[ - year]?.pdf
I've been able to write a script to generate the following:
@book{filename_translated,
title="book name",
publisher="publisher",
note="complete filepath"
}
The complete source is in Subversion (misc/trunk/bin/importbookcd.sh).
Blog posts migrated
I've just finished re-publishing posts from old Roller system.
I did it by directly performing SQL queries against the MySQL database, retrieving the text, fixing all invalid characters (due to some encoding problems which arose after a MySQL version upgrade), and republishing them directly using the Trac web interface.
The only problem with this approach has to do with the publishing timestamp. Blog plugin uses now no matter the timestamp you want it to use (which it's probably good). Since by default the plugin takes the timestamp of when the post was started to be written, and uses it as the name of the associated wiki page, by respecting the original timestamp in the post names I was able to do some SQL logic to fix the pubtime timestamp in Trac database (SQLite).
So I did the following:
- Start emacs
- M-x sql-sqlite -> database: trac.db
- select name,time from wiki where name like '200%';
(...)
Updated on 05/25/07 19:47:45
Linking to SourceForge
Some of the projects now hosted here were initially signed up in SourceForge.
I decided to update them again, pointing them to this server, and start defining a release mechanism so that they can be downloaded from the SF mirrors.
Milestone names
From now on I'll use a different naming scheme for milestones: famous algorithms.
The purpose is to learn something or at least invite to a brief reading about the concrete algorithm.
The list I'll use is provided by Wikipedia of course:
http://en.wikipedia.org/wiki/List_of_algorithms
Trac-hosted blog
I decided not to restore the previous server at blog.acm-sl.net, which was using JRoller software.
Once I migrated the servers, I found Trac useful to manage not only source-code views, but also as a full-featured wiki.
The blog plugin lacks some features comparing to previous server, but fulfills my requirements.
Now it's time to migrate previous posts.
Keep tuned :).
Esto que voy a contar de forma breve tiene relación con el escrito titulado "¿tres capas?"
Error: Failed to load processor FootNoteNo macro or processor named 'FootNote' found
en el cual expongo una forma de realizar interfaces de usuario de forma sencilla mediante la utilización de html y cgi.
En un momento dado relato que el cgi escrito en C/C++ deberá pasear el documento html que se quiere presentar al usuario y que se cambiarán ciertos TAGS presentes en dicha página por datos que decide la capa de negocio o parte inteligente de la aplicación.
Esto, en general, se hace parseando el documento de la forma en que se describió en el ártículo anterior, pero hay una forma mucho más rápida y sencilla la cual paso a describir ahora.
Sencillamente en el documento que será presentado se añade un %s en cada punto donde se quiera añadir algo de forma dinámica. Para que quede claro, se escribe el documento html a mano o como queramos y donde nos interese añadir algo se introduce un %s.
Supongo que cualquiera que sepa algo de C/C++ ya ve por donde me estoy encaminando. Efectivamente, cuando se va a presentar el documento y ya lo hemos leido del disco duro y lo tenemos en forma de string, sin parsear ni hacer nada complicado se puede sustituir el %s por lo que queramos con un sencillo "sprintf()" y lo mejor es que podemos poner tantos %s como queramos.
(...)
Analogías entre gestión de software y de música
Desde hace poco tengo a mi disposición una iPod.
No es que esté orgulloso, máxime cuando por el momento me resulta muy poco asequible cambiarle el firmware por uno libre.
Aunque no todo está perdido: afortunadamente mi iPod nunca conocerá iTunes :).
En cualquier caso, dejando a un lado el dispositivo de moda, el haber dedicado algo de tiempo a organizar la música, conocer qué son los Podcast, etc.
me ha hecho pensar sobre un concepto sencillo que nunca he aprovechado demasiado: las playlist.
Aunque suene trivial, los dispositivos de almacenamiento que usaba hasta la fecha (fundamentalmente cds o mp3 de pequeña capacidad) permitían no esforzarme mucho en cómo organizar los archivos: un directorio por autor, otro por disco y poco más.
Fue cuando perdí la organización presente en mis cds cuando me di cuenta de que en realidad, las playlist no son más que lo que se denominan tags en sistemas de control de versiones como CVS o Subversion.
En el ámbito de desarrollo de software (que es dónde mayor acogida tienen estos sistemas, a pesar de que es provechoso para cualquier documento que vaya evolucionando) se utilizan tags y branches para referenciar colectivamente un conjunto de archivos (en el primer caso) y poder bifurcar el progreso de los mismos (en el segundo).
(...)
Updated on 05/23/07 21:46:41
¿Tres capas?
Lo primero que quiero decir es que la idea de escribir este texto surgió de
un conversación con un desarrollador de entornos web que programa en C#
(sharp). También diré que las ideas que trataré de exponer no son propias, a
parte de que deben estar en muchos libros, a mi me lo explico un buen amigo.
El caso es que dicho desarrollador me enseñaba con orgullo las cosas que
hacía, lo bonitas que le quedaban y la magnífica herramienta de desarrollo
de que disponía.
Bien Yo, que no soy desarrollador de páginas web y que me dedico a los
entornos empotrados probablemente sea el menos indicado para hablar de este
tema, pero para esto está la web, para decir lo que quieras y en este caso
sin ser un experto, tampoco creo que vaya a decir algo sin sentido.
Dicho programador me enseñaba como loco lo fácil que era crear una
aplicación y lo mucho que le ayudaba la herramienta, y la verdad es que
tenía razón, una vez que aprendes a manejar la herramienta, cosa que no
parecia inmediata realmete parecia todo muy fácil.
Cuando me enseñaba el código que se generaba me di cuenta que se mezclaba
(...)
El victimismo ilustrado
Como todo el mundo sabe, recientemente falleció Pinochet.
Es difícil no haber recibido la noticia, dado que ha dado lugar a numerosas impresiones por parte de casi cualquier profesional de la comunicación.
Yo por ejemplo vi a Pablo Motos haciendo chistes congratulándose del hecho, a Jesús Vázquez comentando la noticia con júbilo, y da la impresión de que se entiende por correcto el mostrar desprecio por ese personaje y alegría por su fallecimiento.
La verdad es que mostrar alegría por la muerte de alguien me produce, cuando menos, rechazo.
Me produjeron rechazo las imágenes de palestinos (o vete a saber quiénes eran en realidad aquellas personas) difundidas por todos los medios celebrando el éxito del 11-S, igual que las muestras de júbilo por la pena de muerte para Sadam Hussein, e igual que las del caso con el que he comenzado.
También me llama la atención que uno pueda hacer juicios de valor y establecer una opinión sobre Pinochet cuando no ha sido juzgado.
Creo que el no haber sido juzgado es más importante que su muerte, porque el no existir un veredicto ni una investigación que permita arrojar objetividad al historial del acusado, impide que uno tenga la autoridad moral para emitir juicios objetivos (los únicos válidos afortunadamente).
(...)
Bloom's Taxonomy on Software Delivery
There's a big difference between developing something that works and packaging software as a product.
Many people think the main purpose of a piece of software is to perform a set of tasks.
However, there're many other issues which affect the average user satisfaction: Is it easy to understand? Is it easy to make it understand what I want it to do? Some people tend to summarize all of them in a single one: Is it simple?.
In the bazaar model widely spread among free software projects, the software is delivered when a set of features or bug fixes are completed.
Sometimes it includes useful documentation along with the software itself.
Users are free to ask questions in forums and mailing lists, and even on irc.freenode.org.
Most of the times the learning process consists of a set of trial and error steps till the user manages to configure the software to fit her needs.
The more difficult it takes for the user, the more likely she will give up.
At the end, only two kind of users manage to get the software working: lucky newbies and unlucky experts.
(...)
Keep It Accurate, Stupid
Have you ever heard of the KISS
Error: Failed to load processor FootNoteNo macro or processor named 'FootNote' found
principle? It usually refers to software engineering, and means Keep It Simple, Stupid.
The idea behind is: whatever you do, make it as simpler as possible regarding what it has to do.
I guess it's so simple :) that everybody would understand it, and most will agree with it.
I'm one of the ones who don't.
Let me explain why.
I tend to think a piece of software is a model of something "real", (I mean, part of the nature).
We split the reality in pieces, and provide models to the ones we are interested in (say customer behavior, flood simulation, etc.).
Should we have no hardware constraints, we could be building an increasingly better model of the world.
Such model would cover some aspects in detail, and some others very abstractly.
That's not what's happening, at least in business-oriented software.
Each company focuses on its field of interest, and its competitors do the same.
At the end, we probably won't know more, and won't have better models.
(...)
Democracia, Alternancia, Rotondas y Semáforos
Se me ha ocurrido una analogía entre determinadas prácticas políticas y formas de regular el tráfico.
La democracia, tal como comúmente se concibe, favorece el criterio más respaldado por la mayoría.
Eso da lugar, como es sabido, a lo que se denomina como dictadura de la mayoría.
Este hecho es algo característico y me da la impresión de que se considera valioso.
Por otra parte, en ocasiones la democracia se pone en práctica de forma que el poder se va alternando de una forma más o menos periódica entre (por lo general) dos partidos, los cuales "representan" (dicen representar) la voluntad y el criterio de amplios porcentajes de la población.
Dejando a un lado si de hecho se representa a nadie, y si dichos representantes actúan realmente como portavoces de los que dicen representar, se podría hacer un paralelismo, y pensar en la alternancia como un semáforo, que regula a quién se le permite pasar durante un período de tiempo en detrimento del resto.
Ese sistema es bastante fácil de entender, dado que no es muy sofisticado: se reparte el derecho de uso en franjas temporales.
(...)
Mis reflexiones teológicas
Encontré una frase de C.S. Lewis que me hizo reflexionar sobre la existencia de Dios:
«En "Hamlet" se rompe una rama y Ofelia cae al río y se ahoga. ¿Ocurre el suceso porque se rompe la rama o porque Shakespeare quiere que Ofelia muera en esa escena? Puedes elegir la respuesta que m¡s te guste, pero la alternativa no es real desde el momento en que Shakespeare es el autor de la obra entera».
Poniendo en contexto la cita, C.S. Lewis trata sobre el dilema: ¿Quién tiene la responsabilidad de un suceso acaecido? Las leyes de la naturaleza o Dios. En la cita Dios es Shakespeare, y es que claro, si Shakespeare es el creador de la obra tiene poco sentido analizar quién es el responsable de la muerte de Ofelia, lógicamente Shakespeare lo quera así.
Me llama la atención como un ateo se convierte al cristianismo tras años de conversaciones con Tolkien, y dedica parte de su tiempo a escribir sobre el tema. Pero claro, si yo hubiera tenido la suerte de conocer a Tolkien puede que ahora también fuera creyente.
(...)
What I think about homosexuality
The songs says "love is all around", but I think that is true not for love, but for sex.
I'm convinced of the absurd of thinking of others' lives regarding habits or tastes.
Such absurdity becomes unacceptable when instead of merely think, we judge, moreover if our criteria is based on sane and free sexual practices.
This leads me to support gays in their quest for a more fair society.
Their cause is a clear symptom of how immature is our self-satisfied reality in terms of freedom and respect, and in this sense there's a great benefit for us all if they succeed.
There're other fights of this kind, though.
Besides the rightfulness or fairness of their claims, it's very important to restore lost rights with no regret.
Otherwise the overall message gets interpreted as an attempt not to promote progress towards a more fair society, but to selfishly improve the situation of a certain minority.
In case of homosexuals, I would like to tell my daughter nobody will have a word regarding the kind of people she will get sexually attracted by.
(...)
Freedom of speech
What is Freedom of speech?
I guess it could be defined as the right of an individual to express his or her opinions, even if they are considered wrong or inadequate.
Such a right makes people get used to reject and to react against any law aiming to allow only certain opinions.
That is somewhat associated to democracy, since it's not possible without such individual freedom.
But the opposite is not necessarily true.
I personally find such right so obvious it cannot be discussed.
If everyone had the duty to think the correct way or else shut up, we'd not have not only real democracy, but we'd slow down progress, since nothing important would actually be allowed to be questioned.
However, freedom to speech doesn't come at no cost.
Actually, even if you are given such right, the kind of things you can say is limited at least by law.
The society you belong to somehow decided what subjects are considered harmful.
For me, here's the point.
As long as you agree with what the society you're in thinks is too bad to be allowed, you'll never notice any restriction on your right to express your opinions.
(...)
La moderación agotadora.
El problema de ser una persona reposada en sus razonamientos, sin grandes extremismos y con una actitud de ... digamos ... no odiarlo todo, es que acabas siendo el abogado del diablo en casi todas las ocasiones.
Da igual el que tema que se esté debatiendo, para cualquier interlocutor que tenga una postura sobre el tema a debatir suele parapetarse en uno de los extremos posibles, sin que en ningún momento se les pueda atraer hacia opiniones diferentes a la suya.
Por cierto que las ideas podran ser tanto razonadas como aprendidas, pero en mi opinión priman claramente los conceptos aprendidos ya que incluso los que parecen más despiertos tienen ideas de otros más despiertos aún.
Es más, mientras más poderosa sea la mente del que influye más radical se mostrará alguién influenciado, y por supuesto las declaraciones desprendidas, serán dadas como propias.
Considero agotador tanta discrepancia, todo el mundo "sabe de todo" y su opinión siempre es la más válida y no sólo eso, además es siempre una opinión colgada del extremo más alejado posible sobre la opinión del otro.
(...)
Libros 2005
Recopilatorio personal de los libros que he leido durante 2005.
No coincido con la marcada fobia comunista del autor, pero aporta mucha información sobre los logros de Stalin.
- Gödel, Escher, Bach-Hofstadter.
Este libro es increíble. Exageradamente bueno. No tengo palabras.
- ¿Qué es la propiedad?-Proudhon.
Muy interesante.
Debe ser una de las primeras obras dedicadas a este tema.
- Via revolucionaria-Yates.
Novela sobre el EEUU de los 50, con personajes muy creíbles.
- Mente y materia-Schrödinger.
Breve pero hace reflexionar sobre Darwin/Lamarck, y hace una graciosa advertencia sobre el posible efecto del funcionariado en la evolución del hombre.
Los personajes conocen al autor en la propia novela.
- Cómo se reparte la tarta-Chomsky.
Chomsky duele, pero es que la realidad duele.
Muy recomendable para tener un punto de vista propio sobre la preocupante propaganda actual destinada a conseguir, por la fuerza, un consenso social para demonizar lo que hasta ahora era un valor: compartir.
(...)
La riqueza del lenguaje
No hace mucho le comenté a un amigo que el lenguaje oral no necesariamente permite la transmisión del meme sin alteraciones.
Es decir, la utilización del lenguaje para transmitir una idea conlleva una representación verbal muy ligada a la forma que suponemos que el receptor interpretará el mensaje.
Todo esto es una forma muy abstracta de expresar algo tan sencillo.
De hecho, el párrafo anterior junto con éste permite una realimentación que hace que pierda ese toque de sencillez.
Muchas veces da la impresión que las dificultades en la comunicación tienen que ver con la riqueza de vocabulario.
Sin embargo, hay mucha información en el contexto.
Puedes mentir sin que el otro se dé cuenta, o decir la verdad sin saber que el otro cree que mientes.
Pero en cuanto haya realimentación, la cosa se complica.
Y es que, si lo que se quiere es que lo que se dice se interprete de una forma particular, hay que cuidar no sólo el qué, sino también el cómo.
Pero eso no es todo.
Puede que ambos deban parecer congruentes.
(...)
La toma de decisiones
Vengo un tiempo utilizando un cliente RSS
Error: Failed to load processor FootNoteNo macro or processor named 'FootNote' found
, el KNewsTicker.
Eso me permite recibir titulares de artículos y noticias de mis fuentes preferidas.
Uno de ellos es República Internet
Error: Failed to load processor FootNoteNo macro or processor named 'FootNote' found
.
En la opinión alarmista de fondo en lo referente a lo político y social, solemos concidir.
Al ver el titular
Error: Failed to load processor FootNoteNo macro or processor named 'FootNote' found
RSS de Nemo, he seguido leyendo y me he vuelto a sorprender de lo que se entiende por "capacidad para tomar una decisión".
La noticia en sí no es más que una de las tantas del estilo, en las que se pide a nuestros representantes políticos que evalúen una propuesta y tomen una decisión al respecto, dando como resultado una absoluta falta de criterio y conocimiento.
Habida cuenta de las dificultades que encuentra la gente para entender el software libre, podría entenderse que una muestra de ese público general tomara asiento en el congreso.
(...)
Periodismo
Hay una característica de los medios de comunicación tradicionales, como la televisión o la prensa, que establece una relación informante-informado muy desigual en su cardinalidad.
Es obvio, el contenido no se adapta al receptor: la misma noticia la leen muchas personas.
Tampoco hay realimentación o bidireccionalidad, el efecto o la opinión producida en respuesta no se divulga, y sólo es captada indirectamente a través de mecanismos que en cualquier caso únicamente proporcionan una estimación de la reacción de la audiencia, en promedio.
¿Y todo esto a qué viene? Bueno, por un lado, mi papel como receptor cada vez me resulta más incómodo.
Por otro, me hace cuestionar tanto la aptitud como la actitud de los informantes o mensajeros.
Será cuestión de organizar un poco más la argumentación.
Probemos con un ejemplo:
Hace poco puse la tele cuando transmitían (como que yo sepa sólo lo hicieron una vez, no hablaré de "retransmisión") unos informativos en Telemadrid.
Digo el nombre porque no encuentro el motivo para no hacerlo.
(...)