tag:blogger.com,1999:blog-16089024073391982872024-03-15T12:19:06.590+01:00OpinionesErnesto Revillahttp://www.blogger.com/profile/00275386312174630515noreply@blogger.comBlogger25125tag:blogger.com,1999:blog-1608902407339198287.post-20510059934240695502017-05-13T22:01:00.000+02:002017-05-13T22:01:50.726+02:00Incompatibilidad entre Autofirma 1.4.x / 1.5.x y Google Chrome 58
El problema
Hace ya 1-2 semanas me ha dejado de funcionar Autofirma con Google Chrome bajo OS X.
Mirando la consola en las herramientas para desarrolladores he podido encontrar el siguiente error: net::ERR_RESPONSE_INSECURE. Al intentar conectar rápidamente con Google Chrome a https://127.0.0.1:<Puerto indicado en mensaje de error> ya que Autofirma se cierra después de un corto tiempo, yErnesto Revillahttp://www.blogger.com/profile/00275386312174630515noreply@blogger.com0tag:blogger.com,1999:blog-1608902407339198287.post-80372068769203542312017-05-01T19:45:00.001+02:002017-05-13T21:53:26.443+02:00hg share: Sharing mercurial repository between different clones / checkouts
Our starting point
At our company, we developed a product based on Django. To manage code changes, we use mercurial and to manage all dependency stuff we use buildout + setuptools. buildout recipes are wonderful if you need to do other things than just pulling code and resolving and building library dependencies. These thing could be:
Building any binary from source. We use it for Ernesto Revillahttp://www.blogger.com/profile/00275386312174630515noreply@blogger.com0tag:blogger.com,1999:blog-1608902407339198287.post-64747876149613978382017-05-01T18:24:00.000+02:002017-05-01T18:24:18.205+02:00Fast PDF scaling with page numbering under Ubuntu
The problem
We want a backend process to scale PDF files and number pages. Currently, wer'e using some Java code bases on the last LGPL iText version (2.1.7) which does PDF scaling and stamping. But the code includes some features for custom output formatting (text tables, barcodes) for footers and margins written in Java, so that only software developers have the knowledge to customize and Ernesto Revillahttp://www.blogger.com/profile/00275386312174630515noreply@blogger.com1tag:blogger.com,1999:blog-1608902407339198287.post-15928898113339997442016-01-10T12:28:00.002+01:002016-01-10T12:29:15.768+01:00Escaping single quotes in bash
The problem
We want to define an alias for deleting python .pyc files. The alias definition:
alias rmpyc="find . -name '*.pyc' -delete
does not work correctly
Solution
Combining the bash rules for quoting:
Any variable and pattern is escaped whenever it is NOT enclosed within single quotes
Backslash escaped single quotes NOT enclosed within single quotes produce literal single quotes
Ernesto Revillahttp://www.blogger.com/profile/00275386312174630515noreply@blogger.com0tag:blogger.com,1999:blog-1608902407339198287.post-65598653301191725332015-11-11T20:41:00.001+01:002015-11-12T09:49:46.155+01:00Hints for Java JMX monitoring (for Tomcat, Alfresco, Liferay, etc.)
The problem
We want to monitor an Alfresco server which is not directly accesible from the outer world. It sits inside a (VMWare) private virtual network behind a firewall.
Have you ever tried to access JMX in private virtual nets behind a firewall?
It's not easy at all, because of the way JMX connection establishment works: The client connects to a well know RMI registry host:port.Ernesto Revillahttp://www.blogger.com/profile/00275386312174630515noreply@blogger.com0tag:blogger.com,1999:blog-1608902407339198287.post-58178683031889283612014-05-27T12:42:00.002+02:002014-05-27T13:00:13.369+02:00Liferay 6 and SentryIntroduction
Sentry [1] is a great tool for error tracking and Liferay [2] is a very popular portal software that we deploy for out customer as part of our main product.
Log4j configuration with Liferay
As stated in [3], custom log4j configuration is done adding these files:
portal-log4j-ext.xml
log4j.dtd
to folder:
tomcat-[version]/webapps/ROOT/WEB-INF/classes/META-INF
where [version] isErnesto Revillahttp://www.blogger.com/profile/00275386312174630515noreply@blogger.com0tag:blogger.com,1999:blog-1608902407339198287.post-89319646183346601442013-12-30T16:55:00.002+01:002013-12-30T16:55:53.214+01:00¿Por qué los polvorones y mantecados contienen E-320?
Pregunta abierta a fabricantes y distribuidores de polvorones y mantecados y especialistas de alimentación
Hasta ayer no sabía nada sobre el antioxidante E-320, pero al leer los ingredientes de los polvorones y mantecados, y en la tónica de revisar los ingredientes de los alimentos para vigilar la alimentación en nuestra familia, me he encontrado con este ingrediente que desconocía.
Según Ernesto Revillahttp://www.blogger.com/profile/00275386312174630515noreply@blogger.com2tag:blogger.com,1999:blog-1608902407339198287.post-60227665537785772452013-12-27T09:10:00.002+01:002013-12-27T09:10:20.330+01:00Make Java applets work with chromium-browser on Ubuntu
The problem
On some Ubuntu versions, notably Ubuntu 12.04 LTS and some newer ones, Chromium >= 30 may not execute Java applets. In some browser versions, it will crash the browser process.
Run your own test:
http://www.java.com/en/download/installed.jsp
The result should be something like this:
The problem is a name clash with a Java library: libnet.so.
This does not Ernesto Revillahttp://www.blogger.com/profile/00275386312174630515noreply@blogger.com0tag:blogger.com,1999:blog-1608902407339198287.post-39844261194958368482013-12-03T17:07:00.000+01:002013-12-03T17:07:19.347+01:00Buildout errors with gocept.recipe.env
The syntom
I get a really very strange error when running buildout.
While: Installing nginx. Getting option config:PS1.Error: The option name in substitution, ${debian_chroot:+($debian_chroot)},has invalid characters.
One strange behavior is that it does not occur every time. I still haven't discovered exactly when this error occurs. But the most strange and surprising fact isErnesto Revillahttp://www.blogger.com/profile/00275386312174630515noreply@blogger.com0tag:blogger.com,1999:blog-1608902407339198287.post-85566395091627614842013-11-08T12:01:00.000+01:002013-11-08T12:27:16.268+01:00Enable Wifi Tethering on my MTK6589 Flying F600 with Android Jelly Bean 4.1.2
The problem
Google has introduced changes in the tethering module since Android 4.1.2 to allow carriers to charge their customers Internet usage from other devices. [1]
On the other hand, I have a less famous Android 4.1.2 mobile phone, the Flying F600, which uses the Mediatek MTK6589 Quad Core processor, so I needed a rooting kit that works with this phone and preferably with my MacBook ProErnesto Revillahttp://www.blogger.com/profile/00275386312174630515noreply@blogger.com0tag:blogger.com,1999:blog-1608902407339198287.post-16909192445050980762013-10-21T01:21:00.001+02:002013-10-21T01:21:54.247+02:00Parsing X509v3 certificates and PKCS7 messages with Python
Introduction
Recently I had the need to get out the following information out of certificates and PKCS7 messages:
A certificate's validity period (notBefore, notAfter attributes)
A PKCS7 digital signature's author and signing time
Some basics
Digital certificates are ASN.1 (Abstract Syntax Notation One) structures DER (Distinguished Encoding Rules).
ASN.1 is Ernesto Revillahttp://www.blogger.com/profile/00275386312174630515noreply@blogger.com6tag:blogger.com,1999:blog-1608902407339198287.post-68723179304357012932013-01-16T15:36:00.000+01:002013-01-16T15:36:33.147+01:00Changing Alfresco object properties with python + cmislibThe problem
Some code saved some wrong (custom) property values but you have not the XML extensions to edit the values with Alfresco-Explorer or Alfresco Share.
One possible solution: Use Python and cmislib
If you haven't easy_install or python pip, please install this first. For Ubuntu/Debian this would be:
sudo apt-get install python-pip
So here we go:
sudo pip install cmislib
python
Ernesto Revillahttp://www.blogger.com/profile/00275386312174630515noreply@blogger.com0tag:blogger.com,1999:blog-1608902407339198287.post-31226098225593090552012-12-07T00:54:00.001+01:002012-12-07T00:54:09.164+01:00Memory and CPU hotplug on Ubuntu Guests and VMWare ESXi hosts (including vCloud)Introduction
With some cloud projects in mind and some virtual hardware estimations I was curious to see if it's possible to hot plug virtual memory and CPU to Ubuntu guests. Here is what I discovered.
Infrastructure: vCloud Director on Acens.com (VMWare ESXi)
Guest: Ubuntu server 10.04 (kernel 2.6.32-45-server #100-Ubuntu SMP Wed Nov 14 11:02:27 UTC 2012 x86_64 GNU/Linux)
virtual HW Ernesto Revillahttp://www.blogger.com/profile/00275386312174630515noreply@blogger.com0tag:blogger.com,1999:blog-1608902407339198287.post-22463476634018598822012-11-30T16:09:00.002+01:002012-11-30T16:26:10.619+01:00Compile Nginx with custom OpenSSL in Ubuntu 10.04
The problem
We need Server Name Indication (SNI) for nginx, but the OpenSSL version included in Ubuntu 10.04 does not support it.
Edit: I just noticed that I was wrong. SNI *IS* supported by the version of openssl provided with Ubuntu 10.04: libssl0.9.8-7ubuntu8.13
The solution
Download, build and install a recent version of OpenSSL
Compile nginx against this version of Ernesto Revillahttp://www.blogger.com/profile/00275386312174630515noreply@blogger.com0tag:blogger.com,1999:blog-1608902407339198287.post-39332519495142543192012-10-10T01:21:00.001+02:002012-10-10T01:24:34.551+02:00Restoring iPhone under Ubuntu 12.04 / VirtualBox / WinXP / iTunesToday, I bricked my iPhone and here goes my experience.
My plataform: Ubuntu 12.04/amd64, Oracle VirtualBox 4.2.0 / WinXP SP 2, iTunes 10.x
Some block posts reported permission problems of USB device files and adviced starting VirtualBox as root. And so I did. But the restoration / update process stuck.
Problem 1: VirtualBox does not recognize when a new USB device is plugged in. This may be Ernesto Revillahttp://www.blogger.com/profile/00275386312174630515noreply@blogger.com0tag:blogger.com,1999:blog-1608902407339198287.post-63840612529226264782011-03-27T17:08:00.015+02:002011-03-28T12:29:12.811+02:00No uses variables globalesEste post explica por qué mejor no usar variables globales en entornos Web y está dirigido a personas que aún no lo ven tan claro. Para este ejemplo emplearé Apache, mod_python/mod_wsgi, Django y Memcached pero cualquier otro entorno Web también sirve.ApacheApache tiene 2 modos de funcionamiento: 1. Prefork: Mediante procesos 2. Worker: Mediante hebras y procesosMás frecuentemente se suele usar Ernesto Revillahttp://www.blogger.com/profile/00275386312174630515noreply@blogger.com0tag:blogger.com,1999:blog-1608902407339198287.post-37206709281780644622011-03-18T10:17:00.003+01:002011-03-18T12:28:09.102+01:00Alfresco Export ToolI recently found the problem that Alfresco doesn't provide a shell script to export repository contents anymore. So I rewrote one of them found on Alfresco forums. One of the problems that I encountered is that it tries to start the VTI server module (if installed), colliding with the running Alfresco instance. Setting port to 0 disabled it.See my post to Alfresco forums.Ernesto Revillahttp://www.blogger.com/profile/00275386312174630515noreply@blogger.com0tag:blogger.com,1999:blog-1608902407339198287.post-34437302518684431512011-02-16T02:51:00.006+01:002011-02-16T03:24:08.242+01:00oodiff reloadedAlthough there exists alread oodiff, it's a bit limited. What's about any format or image changes not reflected in the diff?I had a oodiff before, but some day it stopped working. Now I renamed it to ooodiff.Thanks to some notes from here I corrected it. This version should work well with subversion. Here's the code (PEP8/Pyflakes compatible):#!/usr/bin/python# Requires python-uno# Code Ernesto Revillahttp://www.blogger.com/profile/00275386312174630515noreply@blogger.com0tag:blogger.com,1999:blog-1608902407339198287.post-42188144675442191622010-09-21T10:07:00.005+02:002010-09-21T12:00:55.064+02:00Tomcat 6: Session replication for failoverSummary: there is a bug in tomcat 6.0.20 which inhibits tomcat to send multicasts between instances, failing to form the cluster and hence not replicate sessions.For the current project, I have to cluster Alfresco 3.2r Enterprise. We have a mini 2-node cluster. Although hibernate L2 cache replication works correctly (you have to rename ehcache-custom.xml.sample.cluster, which was not totally Ernesto Revillahttp://www.blogger.com/profile/00275386312174630515noreply@blogger.com2tag:blogger.com,1999:blog-1608902407339198287.post-58982170917750322202009-12-13T23:34:00.004+01:002009-12-14T10:52:00.497+01:00Install Oracle PDO PHP (php_oci) driver in Ubuntu Hardy (8.04)Ubuntu Hardy comes with some PHP PDO driver like mysql, postgresql and sqlite. Trying to install Oracle driver with:sudo pecl install php_ocifails in my Ubuntu with the following error:pear/PDO_OCI requires PHP extension "pdo" (version >= 1.0)Isn't "pdo" installed already? It is part of php5-common, but PEAR/PECL doesn't know about it. So let's go ahead with ignoring dependency checks:sudo pecl Ernesto Revillahttp://www.blogger.com/profile/00275386312174630515noreply@blogger.com5tag:blogger.com,1999:blog-1608902407339198287.post-28636692914372807022009-10-30T07:58:00.009+01:002009-10-30T09:17:38.485+01:00OIOSAML and Blackboard / WebCT Vista/CE 8.0SummaryWhen installing OIOSAML, incompatibility issues arise. This blog entry provides detailed information about how to fix this problem and may be applicable to other applications that need to run with Sun Java 1.5 and updated versions of JAXP 1.3.IntroductionBlackboard Vista / CE 8.0, formerly known as WebCT, uses Bea Weblogic 9.2 application server, including Sun Java 1.5. OIOSAML requires Ernesto Revillahttp://www.blogger.com/profile/00275386312174630515noreply@blogger.com0tag:blogger.com,1999:blog-1608902407339198287.post-23376463162310666602007-11-20T16:51:00.000+01:002007-11-20T17:22:35.084+01:00Problems launching VirtualBox in headless mode with sshI recently installed a VirtualBox image to run remotely using ssh. My command was:VBoxVRDP -startvm "GuestOS" >~/VBoxVRDP.log 2>&1 &inside the ssh session.Whenever closed the ssh session, the virtual machine was killed. I thought it was a problem of the terminal, so I tried out screen and dtach. But the problem was remaining. Googling around, I finally found:http://www.virtualbox.de/Ernesto Revillahttp://www.blogger.com/profile/00275386312174630515noreply@blogger.com0tag:blogger.com,1999:blog-1608902407339198287.post-36646307966628554052007-11-14T13:27:00.000+01:002007-11-20T17:20:43.829+01:00NTLM Authentication in DjangoRecently I had to integrate NTLM Intranet authentication into a Django application. The first problem was to get mod_ntlm [1] to work in Ubuntu Feisty [2]. After this was done I had to configure my Samba as a Primary Domain Controller (PDC) and add my vmplayer WinXP instance to that domain [3] [4].After that was done, I wrote a Django authentication backend based on [5].What I did:Add a link to Ernesto Revillahttp://www.blogger.com/profile/00275386312174630515noreply@blogger.com4tag:blogger.com,1999:blog-1608902407339198287.post-41915662880265681902007-11-13T18:32:00.000+01:002007-11-14T13:26:15.672+01:00Compiling mod_ntlm for Apache2 in Ubuntu FeistyDo a checkoutsvn co https://modntlm.svn.sourceforge.net/svnroot/modntlm/trunk/mod_ntlm2install apache-developer files:sudo aptitude install apache2-prefork-devel cd into mod_ntlm2 and edit Makefile:APXS=apxs2APACHECTL=apache2ctledit mod_ntlm.c:replaceapr_pool_sub_make(&sp,p,NULL);withapr_pool_create_ex(&sp,p,NULL,NULL);As of this post, apr_pool_sub_make is deprecated and was removed. UseErnesto Revillahttp://www.blogger.com/profile/00275386312174630515noreply@blogger.com0tag:blogger.com,1999:blog-1608902407339198287.post-5457253378308520102007-11-04T20:06:00.000+01:002007-11-04T21:07:27.102+01:00Hibernate with Ubuntu FeistyHibernate never worked for me using Ubuntu. Now, I'm using Dell Inspiron 8600 and upgraded recently to Ubuntu Feisty. What I did for hibernate to work: Make sure swap device works correctly. Now there isn't /dev/hd[x] anymore. This has been renamed to /dev/sd[x]. I recreated my swap partition: $ sudo swapoff -a # disable swap devices$ sudo mkswap /dev/sda3 # recreate my swap Ernesto Revillahttp://www.blogger.com/profile/00275386312174630515noreply@blogger.com0