dpmWare Just my stuff, nothing else

13Jan/120

Recipe: From SVN to Git without pain

Are you already in love with Git? I'm pretty sure of that, that's the reason why you are reading this, huh?

These are the steps you should follow to migrate an existing SVN repository to a Git one:

1 - Create a file where you will map SVN users to Git users, following this pattern:

svn_user = git_user

This is the one I created to migrate some SVN repositories from Google Code:

$ cat authors_mapping_googlecode
dpecos = Daniel Pecos Martinez
(no author) = Daniel Pecos Martinez

The author (no author) is required to match some commits made by Google in the SVN repository creation process.

30Dec/110

Blog rollback

A couple of months ago I took the decision to reset my blog and start it again from the beginning, creating a more professional computer technology oriented content. I wrote some technical articles and I feel really proud of them, but there was something left, some place where I could write about my thoughts or anything I would think it would deserve it.

Some days ago I make a quick revision of a backed up previous blog where I found some articles I liked very much, some of them with several comments, containing really interesting stuff, and some others that were really crap articles. I started thinking that maybe the restart of the blog was not a good decision, that what my blog really needed was a good clean up and not a complete reset. And that's what I've been doing for a couple of days, recovering articles that I feel are interesting or that made me feel in some special way when I wrote them.

Now I am proud to present this refurbished version of my previous blog and the more recent one. It contains technical content, personal stuff, opinion articles and more written in Spanish and English. To make this change more noticeable, I have decided to give it a new name: dpmWare, just my stuff, nothing else (just to show the influence of my recent blog Debug yourself! Simply code, just that). I'm also planning to apply a new style to the site so maybe you'll see some changes in a few days.

Of course I will continue writing technical articles and finish some series of articles still pending. I hope you will enjoy these articles at least as much as I enjoyed writing them.

Daniel Pecos Martinez

PS: Happy new year 2012!

Filed under: General No Comments
28Aug/110

Git-SCM (Part 2)

In a previous post, we have seen what Git is and its main characteristics. Now, we'll go more into detail about its functionality and we'll see what a usual day working with Git looks like.

But before, some initial concepts:

  • Repository: A working tree of files and directories which can be versioned, keeping track of every single modification made over the working tree, been able to move forward and backward in its history.
  • Branch: it is an alternative image of the repository, keeping track of its own history of modifications. A repository has a main branch called master, and it can have an undefined number of branches, some of them may be copies of remote branches and the default name for the upstream repository is origin. The current branch of the working copy can be always referenced as HEAD.
  • Commit: it is a concrete state of a branch, containing the modifications made to the entire working tree since the previous commit in the history, as well as author information and timestamps. It can be identified by its SHA hash, but a name or tag can be associated to it in order to make thing easier.
  • Merge: it is the process of integrating changes or commits of two different branches. This integration is automatically carried by Git, if there are no conflicts between commits.
  • Push: the changes committed in a local branch into a remote branch.

These are the basic concepts we are going to use in the rest of this post. Now let’s start with the fun!

31Mar/110

amCharts Javascript Tutorial: Parsing dates and styling up the chart

Recently I began a collaboration with amCharts, writing some tutorials for their blog. This is my first contribution, and you can find the original post in amCharts blog.

http://blog.amcharts.com/2011/03/amcharts-javascript-tutorials-part-3.html

I hope you'll enjoy my first tutorial about this great graphs library! And, of course, feedback is wellcomed!

8Dec/101

HTTP connection + HTTP Authenticacion + Proxy + SSL

Many times during your life as a java developer, you will face the situation of retrieving some resources using an HTTP connection. At first, it will seem easy, but probably some problems will arise such as:

  1. Needing to use an HTTP Proxy (maybe authentication would be required)
  2. Establishing an HTTP authenticated connection
  3. Connecting to a server that uses SSL self-signed certificates

I'm sure you will quickly find the Apache Commons solution: commons-httpclient. In this article I will show you some code that, I hope, will ease you the  resolution of the previous obstacles using this great API from Apache.

18Nov/100

Git-SCM (Part 1)

One of the key tools of a software project development is the repository where it's hosted. During my experience as software developer I have been working with several flavors, such as Visual SourceSafe, CVS, Mercurial, and of course, SVN. But latetly I have found this little jewel called Git.

Git was initially developed by Linus Torvalds as a result of an unsuccessful research to replace the propietary SCM BitKeeper, used back in 2005 in the Linux Kernel project (kinda strange that the opensource star project was hosted with a propietary software, huh?). Back then, the ability to freely use BitKeeper was withdrawn by its copyright holder, so Linus was forced to find a replacement for it. He was looking for a VCS with a high performance in the process of applying patches and keeping track of the changes, but he didn't find any opensource solutions that fitted his requirements, so he started the developement of Git (as he says on Git's Wikipedia entry, Git was named after himself, because he considers himself an "egoistical bastard, and I name all my projects after myself"; git is the British English slang word for an stupid or unpleasant person).

That's why its main characteristics are oriented to help the development and management of a huge, distributed and collaborative project like the Linux Kernel. These are the most noticeable of them:

  • Strong support for non-linear development
  • Distributed development
  • Efficient handling of large projects
  • Cryptographic authentication of history
  • ...

But for me, the most shocking one is its decentralized structure in distributed development: there is no need for a central repository where all commits are sent by the people working in the project (but still, it is recommended to use a main branch for that purpose).

In following posts I will explain how to use Git in the lifecycle of a software project and how can it improve our performance.

Tagged as: , , , , , No Comments
7Oct/090

Nuevo foro de fotografía: enfocas.es

Enfocas

http://enfocas.es

En origen, ENFOCAS, está formado por un grupo de amig@s de Castellón, unidos por su pasión hacia la fotografía. El foro en sí, nace como punto de encuentro de quienes como nosotros, sientan la necesidad de compartir esta afición, a través de las imágenes que podamos aportar, junto con los comentarios, dudas, informaciones de interés o cualquier otro aspecto que pueda surgir a lo largo de su vida.

No pretendemos ser ningún referente, tan solo queremos disponer de una parcela de la red para poder compartir nuestra pasión por la fotografía, con quienes quieran acercarse a él, y lo hagan de forma respetuosa hacia las obras, aportaciones y opiniones de los demás.

Precisamente en este talante de respeto hacia las aportaciones, grandes o pequeñas, y de las opiniones de sus componentes, esperamos que surja un foro vivo y participativo, donde  el propio foro, su estructura, su estilo  sea fruto de la participación de quienes lo componemos.

Por último, no podemos evitar tener presente en nuestro pensamiento, que la comunicación a través de Internet, aún siendo deseable y de gran importancia, no puede ni debe suplir, en la medida de lo posible, un contacto directo y personal. Tratamos, pues, de conseguir una participación más cercana, buscando fomentar la presencia activa a través de puntos de encuentro, ya sean mediante KDD´s en nuestra comunidad o fuera de ella, si fuera posible, y a través de todos aquellos birrings que nos permitan compartir unos momentos de amigable camaradería y conversación.

2Sep/090

GNU HttpTunnel: Como saltarse un proxy HTTP

Creo que es la primera vez que posteo sobre una aplicación, pero creo que en este caso merece la pena hacerlo. Se trata de GNU HttpTunnel, una pequeña aplicación que crea un túnel HTTP sobre el que podemos meter cualquier servicio. ¿Ventajas? Pues que al ser HTTP, si nos encontramos en una red que solo tiene salida a Internet mediante un proxy HTTP, con esta aplicación (y un PC fuera de la red), podemos salir de la red con el servicio que más nos interese.

HTTP Tunnel

Aquí va el chuletario:

En el PC al otro lado del proxy (fuera de la red) ejecutamos:

$ hts -w -F host_remoto:puerto_remoto puerto_local_servidor

y en el cliente (detrás del proxy) ejecutamos:

$ htc -P ip_proxy:puerto_proxy -F puerto_local_cliente ip_servidor:puerto_local_servidor

Por ejemplo, si quisiera crear un tunel HTTP para el SSH que tengo en mi servidor de casa (cosa muy útil, por si tuviera que abrir nuevos túneles ;-) ), tendría que ejecutar el siguiente comando en dicha máquina:

$ hts -w -F localhost:22 7022

lo cual crearía un tunel a la expera de conexión en el puerto 8022 del servidor (este puerto tendría que hacerlo accesible desde internet, en caso de que nos encontremos detras de un router sin NAT), y en la máquina desde la que me quiero conectar ejecuto:

$ htc -P ip_proyx:80 -F 22 ip_servidor:7022

de forma que ahora al conectarme al puerto 22 de la máquina local, realmente me estoy conectando al puerto 22 del servidor de mi casa.

Pues espero que os sea útil!

Un saludo!

Más info:

24Apr/090

Adiós Gloria

Me ha costado bastante escribir este post, pero finalmente creo que el recuerdo lo merece.

Gloria Martínez

Gloria Martínez

Como homenaje, se están recogiendo firmas para dar su nombre a una de las aulas del ESTCE: http://homenajeagloria.uji.es/

El pasado 14 de abril de 2009 falleció nuestra compañera y amiga Gloria Martínez. Gloria fue una de las profesoras encargadas de poner en marcha en 1991, fecha de su creación, los estudios de informática en la Universidad Jaume I. Desde entonces ha estado involucrada, muy activamente, en todos los aspectos tanto organizativos como docentes de dichos estudios. También fue una de las personas más destacadas en muchas de las actividades extraacadémicas de esta Universidad como son, por ejemplo, las jornadas iParty, o el grupo de Amnistía Internacional de la UJI. Además, también destacó a nivel nacional como impulsora de la Asociación de Enseñantes Universitarios de Informática (AENUI) de la cual era Coordinadora en el momento de su fallecimiento.

Muchas de las personas que tuvimos relación directa con Gloria, tanto estudiantes como profesores y amigos, consideramos que ha dejado una gran huella allí por donde ha pasado y desearíamos que su memoria no se olvidase fácilmente en el lugar al que dedicó gran parte de su energía. Para ello, todas las personas abajo firmantes, solicitamos que se dé su nombre a una de las aulas de la ESTCE donde ella desarrolló su actividad docente.

Gloria, gracias por enseñarme como lo hiciste y ser como fuiste. Tus clases son de de los mejores recuerdos que mantengo de la universidad. Gracias.

(Si alguien quiere saber más sobre cómo era ella, aquí dejo la dirección de su blog donde posteaba con frecuencia: http://servidora.blogspot.com/)

13Jan/090

2009: Odisea con el funcionariado

Tiemblo cada vez que tengo que tratar con un funcionario, es como si te echaran una maldición:

  • De entrada tienes pocas esperanzas de poder hacer el trámite a la primera, sin que te toque volver n-mil veces a tratar con el/la individu@ en cuestión.
  • Una vez te decides a intentarlo, siempre te queda la duda de si ir al edificio público en el que ejerce su profesión o si acudir directamente a la cafetería de al lado (lo cual me hace reflexionar si su profesión es aquella por la que recibe un sueldo, o la que ejerce donde pasa la mayor parte de su jornada laboral... puede ser un tema de reflexión bastante interesante).
  • Por último, si has tenido suerte, los astros se encuentran en la conjunción adecuada y encuentras al funcionario en su sitio, tienes que poner la sonrisa más agradable para que el/la personaje, con su cara de estreñido (o de "deja de joderme, que yo a ti no te voy a buscar a tu trabajo y me pongo a darte por el culo"), se digne a darte un trato poco despreciable y a conseguir un mínimo de información, que con suerte, puede llegar a ser hasta útil (porque hay veces que se contradicen, o mejor aún, se dedican a pasarse la pelota, osea tú, de unos a otros).

Posibles motivos de que esta gente se comporte de este modo:

  • Porque no les gusta lo que hacen: pues tuvieron que estudiar bastante tiempo y disputárselo entre muchos para conseguir lo que tienen, por lo que estoy más que seguro que conocían lo que se iban a encontrar (tal vez, con toda la idea, de tocarse las pelotas durante los restos).
  • Porque el sentimiento de seguridad y de ser intocables en el trabajo les hace descuidarlo: poco más que decir, si no rindes cuentas a nadie y tampoco te motiva lo que haces, es obvio que cada vez lo vas a hacer peor y con menos ganas (siempre existe la posibilidad de que se dejen el trabajo, pero también existe la posibilidad de que llueva hacia arriba).

Concretando, todo esto se solucionaría eliminando la permanencia asegurada de un funcionario en su puesto de trabajo e implantando unos controles y seguimientos de los rendimientos de su trabajo. ¿Por qué no se hace? Pues porque seguramente lo tendría que tramitar un funcionario y es probable que se le fundieran los sesos al intentar averiguar qué impresos son necesarios.

Como bien dice mi padre, un funcionario es alguien que hace un esfuerzo en un momento de su vida y se pasa el resto de ella descansando. O como dice un amigo funcionario, que entran a las 8 al puesto de trabajo, pero trabajar nunca se sabe a qué hora se comienza (igualito que en mi empresa :-( )

Y es que francamente, ¿quién no ha pensado que la tarea que realizan 5 funcionarios administrativos la podrían hacer perfectamente 1, como mucho 2, personas trabajadoras como cualquiera? Da la sensación que cuando entran les hacen un test de aptitud y a los que lo superan les rechazan para el puesto (de hecho, el amigo que he comentado justo antes, fue acusado de trepa por sus compañeros funcionarios porque rendía demasiado :-o !?!?!?!?! :-o ).

Nota: he intentado referirme concretamente a funcionarios de caracter administrativo, de los que te atienden tras un mostrador o mesa, aunque, por sorprendente que parezca, estoy convencido que hay funcionarios de gran calidad tanto personal como profesional, por lo que tampoco es correcto generalizar.