Sunday, April 9. 2017
I have moved to another job again (I know, I can not stand still) and in my new company the old IRC is used. Besides all the people inform their status changing their nicks (for example if you go to lunch, your nick username would be modified to username|lunch or something similar). I have to say that it is a mess but... When in Rome do as the Romans do. Pidgin is my favorite program for chatting. It is a very mature program and it saved my ass once in the past so I configured it to join to the different rooms I have to be present. Some plugins were indeed interesting and I also configured them to make my job easier. Nevertheless I did not find anyone to change my nick when I change my general pidgin status.
The ircaway plugin does a similar job, it changes your nick to usernameAway when the IRC status is changed to away. Indeed it would have been enough, but it is not exactly what I wanted. I had defined several statuses in pidgin (for example cofee, lunch, brb, afk, meeting,...) and, when my status is changed to one of them, my nick should be changed accordingly. Looking to some plugins source code it should not be very difficult, so I started to develop one and here it is the result: ircstatus.
The plugin does exactly what I want:
It should be configured with one IRC account (I thought in configuring more than one but I changed my mind, it is not necessary). That account is the one that will receive the nick changes. You can also configure the separator string (by default is "|" but you can configure another one, "_" for example).
The plugin listens for status changes (signal savedstatus-changed) and performs the change of the nick in the IRC account specified in the preferences. Obviously the plugin checks that the IRC account exists and is connected. The new nick is constructed by the concatenation of the initial username, the separator and the title of the status. The title is sanitized (non-alphanumeric characters are replaced by an underscore "_").
And that is all. The plugin is very simple but it works exactly like I want. Besides I can combine it with another plugin away-on-lock which changes automatically your status if the screen-saver is activated. This way my nick is always modified even when I forget to change my status manually, which is quite often because of my bad memory (away-on-lock changes the status to one of the away status, you can configure which one, and in turn my ircstatus changes the nick accordingly). I suppose that such a bothering plugin will not be needed by a lot of people, but you can clone or download it from my github anyway.
Saturday, February 18. 2017
Supporting DNIe 3.0 inside OpenSC keeps improving. Some days ago some users reported a problem at the creation of the secure channel. The problems semmed to be related to a reset of the card that is done just before starting the process. That reset has been talked about several times since I am involved inside the DNIe driver development, it seemed unnecessary but it still remained there. I had also experienced the same issue previously but, in my case, it was very very rare (for what I understand to the affected people it was just a blocker, it never worked). Another pull was submitted for deleting the call to the reset function but some refactoring was also included.
The pull request has been accepted but at that time I asked German to check it too (four eyes see more than two). He found some problems with the signature (which I think were related to his environment and not produced by my changes, mainly because the modifications with DNIe 3.0 always affect the secure channel creation -login- and no other parts). Currently I just test code changes with my tester, I did it just for that purpose and it is very fast and (I think) complete. Besides the old page that I used to test (@firma demo page) has been removed and now you are redirected to download a new AutoFirma application. This new application does not work (at least for me) but I cannot pass the first window that asks me to introduce the DNIe (although it is there). So I finally tested the singing process using the pkcs11-tool command, my dnie-pkcs11-tester, jsignpdf as explained in this Spanish entry and the signer daemon I presented in a previous entry. All of them worked. But I had downloaded previously the @firma applet and I even tested the library with the old official application. (I knew that I had some problem because my local @firma did not work. But the problem was previous to all the DNIe 3.0 changes. This time I spent some time trying to figure out what was happening and finally I discovered that the applet used the system OpenSC library, not the compiled one. Removing the package was enough and the old @firma worked again.)
In order to not lose it (because I cannot find @firma application again) I have uploaded it to my blog. You can test it here. But I needed to change the manifest file (it was fixed to only work in the official test site) and, therefore, I also had to re-sign the applet. I did it with a self-signed certificate so it is going to be problematic for sure. In my case it works with the icedtea-plugin inside firefox (I do not know if I configured something weird in the past to make it work). Do not trust in me and do not sign anything real with it. It is just for me, to not lose it and have access to it from everywhere.
That is all. I just want to upload the @firma to the blog. As I said at the beginning the pull request is now accepted and the changes are in the master branch. So the DNIe will work better in the next OpenSC stable version.
Spiral out! Keep going!
A very quick entry this time. The previous week I had to email some documents manually signed. You know, print, sign, scan and send. The problem was some documents have a lot of pages and I only had to sign the last one. So I decided to, instead of print and scan all the pages, just do it for the last one, the one that I need to modify signing it, and re-arrange the pdf again.
In summary, I developed a simple java tool to transform a pdf into images (each page is an image) and a set of images into a pdf (each image is a page). It is a very simple tool because pdfbox can handle all pdf work and ImageIO all image stuff. The tool is a converter to do the transformation both ways. This way I could convert original pdf to images, substitute the last the last one with the signed one and transform back the images to a final pdf.
That is all. The simple class can be download and used from my github repository.