martes, 29 de octubre de 2013

Introducing geol

Hi!

Don't you hate it when developers are working in disparate platforms and people commit changes that rewrite the whole file (even though they only changed a couple of lines) because they changed the EOL format of the file? (And don't you curse on Microsoft, as usual, for it?) Well, I do hate it.... a lot.... specially when I have to merge stuff and I find this awful conflicts in files that don't show up as groups of lines but as whole files replaced (which makes it cumbersome to find out what the changes were from each branch that you are merging).

I have fallen in love with git. It's so flexible that it seems like it's made of rubber. Taking advantage git's features I noticed I could create a tool that rebuilt branches correcting the EOL problems in the history to make it consistent to a single EOL format... and so geol was born (just a few days ago).

It's fairly simple to set up. You just init a repo, add a remote (the repository you want to "correct") and start it. You will have to use a file where geol holds the equivalents of each changeset between the original and the corrected repo.

I'm giving it a round of tests with one of our projects (which is a little large) and it seems to do the job fairly well.... if you want to give it a round of tests, let me know how it goes.

jueves, 29 de agosto de 2013

Why is plasma desktop hitting cups every once in a while?

Hi!

I had noticed on gkrellm that there was a process nagging with traffic on the loopback interface hitting cups. I'm running kubuntu 13.04.

I wanted to know what process it was.... I tried with netstat in and endless loop, ntop seemed like a litle too much for what I needed (though I'll take a closer look later on, seems like a very interesting tool), nethogs, lsof... the process just seemed to hide every time. So what is a man to do then? How about making myself show up as cups to see who is causing the trouble? Perhaps I could make it "hold" for a while till I could see with netstat what process it was.

So, first, stopped cups:

$ sudo /etc/init.d/cups stop
[sudo] password for antoranz:
Rather than invoking init scripts through /etc/init.d, use the service(8)
utility, e.g. service cups stop

Since the script you are attempting to invoke has been converted to an
Upstart job, you may also use the stop(8) utility, e.g. stop cups


No wonder there.... then, how will I make the process stall? How about a little nc magic? I could use it as bait and see who gets hooked on. So let's start listening on port 631 and wait to see what happens:

$ sudo nc -l 631
POST / HTTP/1.1
Content-Length: 244
Content-Type: application/ipp
Host: localhost:631
User-Agent: CUPS/1.6.2 (Linux 3.8.0-29-generic; i686) IPP/2.0
Expect: 100-continue

@bGattributes-charsetutf-8Httributes-natural-languagees-coBrequesting-user-namantoranz#
                                                                                       printer-typeDrequested-attributes
                                                                                                                        printer-nameD
printer-stateDprinter-state-messageD                                                                                                 printer-infoD
                                    printer-type



Can't really tell what it is but the process is waiting so let's see what netstat has to say for us:

$ sudo netstat -ntp | grep 631
tcp        0      0 127.0.0.1:59971         127.0.0.1:631           ESTABLECIDO 2992/plasma-desktop
tcp        0      0 127.0.0.1:631           127.0.0.1:59971         ESTABLECIDO 7217/nc        



Plasma desktop. Now, and getting back on the topic, why is plasma desktop hitting cups so often?

viernes, 16 de agosto de 2013

RMS, why did you skip the i?

Hello, everybody.

Today I had an epiphany. Why did RMS skip the i from "is" in GNU? I mean, he named it GNU after he fiddled with all the letters to make it a recursive acronym. Like GNU stands for GNU's Not UNIX (G N U, GNU, see? And I use the capitals in UNIX, aren't I a nice guy?). Great... but why did he choose to skip the I? I think it would have given him a lot of more possibilities and not end up with GNU. I have no problems with it, I can pronounce it like g-nu or ñu (I'm a native spanish speaker, keep that in mind), but it's been a pain for people since the beginnings of time.

What would have happened had he kept the I? Some possibilities like GINU or MINU, I find them interesting.... but then it hit me like a brick. How about had he chosen the L? Wouldn't that have been lovely? Just adding an x and we would have saved ourselves a lot of infighting.

Cheers!

jueves, 2 de mayo de 2013

Just published a GPS Parsing library

Hi!

Just wanted to let you know (as if you cared that much) that I just released a GPS Parsing library (based on NMEA 0183) for Java.

The way to use it is fairly simple. It can be used to read from Readers so files or streams is no different.

The parser can notify of events as they are read from GPS output by using listeners.

A simple example would be this:

aaahhhhh.... just take a look for yourself: FileAnalyzerTwoListeners.java

Well... hope you find it useful. It's released under the terms of MPL 2.0.

And most importantly, repo is here.

Cheers!