tag:blogger.com,1999:blog-5959677280530478742024-03-05T16:27:49.556+01:00hmontoliu~<br>
~<br>
:wqAnonymoushttp://www.blogger.com/profile/12100681780765926058noreply@blogger.comBlogger28125tag:blogger.com,1999:blog-595967728053047874.post-21913808273443398312015-06-27T18:05:00.001+02:002015-06-27T19:27:15.541+02:00Passing STDIN or positional arguments to python code enbedded in bash script (here-documents)
spanish version - all english posts
This is a short post about bash's here-documents and python embedded scripts. Very useful to write quick and dirty scripts.
The issue here is to demonstrate how to pass either positional arguments or stdin input (pipe) to python code inside a bash's here-document block of code
Proposal, write a bash script or function that accepts either pipe input or Anonymoushttp://www.blogger.com/profile/12100681780765926058noreply@blogger.com0tag:blogger.com,1999:blog-595967728053047874.post-63855995825780363472015-06-26T16:00:00.000+02:002015-06-27T18:54:59.331+02:00Pasar argumentos posicionales (o STDIN) del script bash a un bloque python en un here-document english version - all spanish posts
Aquí va un post corto sobre scripts en bash con código incrustado de python en "here-documents". Muy útil para scriping rápido.
El asunto aquí es demostrar cómo pasar tanto argumentos posicionales como desde la entrada estandar a un bloque de código python incrustado en un here-document dentro de un script de bash
Propuesta: escribir un script o una Anonymoushttp://www.blogger.com/profile/12100681780765926058noreply@blogger.com0tag:blogger.com,1999:blog-595967728053047874.post-6031660635744796452013-12-24T18:17:00.001+01:002013-12-24T18:22:38.155+01:00Force reinstall of configuration files Some times things go wrong and you want to restore default configuration files.
This quick tip is devoted to debian based distributions
One may think that the apt-get flag - -reinstall will do the trick, however that's not enough. You'll need to provide some not-so-obvious arguments:
apt-get -o Dpkg::Options::="--force-confmiss" install --reinstall package-name
With that command the missing Anonymoushttp://www.blogger.com/profile/12100681780765926058noreply@blogger.com0tag:blogger.com,1999:blog-595967728053047874.post-63580789334381131882012-02-01T17:34:00.003+01:002012-02-01T18:00:36.600+01:00Touchpad freezes sometimes in Ubuntu 11.10. Workaround
Randomly and fortunately not too often (maybe two or three times in the last 5 months) the mouse cursor freezes on my laptop (Ubuntu 11.10 64Bits). This usually happens when using thunderbird, however I don't have a test-case to report to launchpad yet.
This is quite annoying and what I did in the previous occasions was to hit CTRL-ALT-F1 and restart lightdm.
However It has just happened once Anonymoushttp://www.blogger.com/profile/12100681780765926058noreply@blogger.com0tag:blogger.com,1999:blog-595967728053047874.post-65432392009422329342012-01-05T13:35:00.001+01:002012-01-05T13:38:06.722+01:00Quick check of services status
This is just quick and dirty post.
A oneliner to check if all your server services have started rightly after a reboot. This first attempt is aimed for Debian and derivatives:
checkservices () { for service in /etc/rc2.d/S*; do STATUS=$(/etc/init.d/$(ls -l $service | awk '{print $NF}') status 2>/dev/null); [ "$STATUS" != "" ] && printf "Status of ${service#Anonymoushttp://www.blogger.com/profile/12100681780765926058noreply@blogger.com0tag:blogger.com,1999:blog-595967728053047874.post-887346614138039272011-11-06T11:04:00.008+01:002011-11-06T12:20:39.855+01:00Unity's "about:config" doesn't work in Ubuntu 11.10 Oneirc OcelotCustumization of Unity in Ubuntu 11.10; about:config doesn't work
spanish version - all english posts
Unity probably due to a misguided Ubuntu's "zero-config" policy cannot be customized by the end user. At least by default.
Theroetically by pressing alt-F2 and typing in the laucher "about:config" the configuration/personalization utility of Unity should appear... but Anonymoushttp://www.blogger.com/profile/12100681780765926058noreply@blogger.com0tag:blogger.com,1999:blog-595967728053047874.post-80708447889529158542011-11-06T09:52:00.006+01:002011-11-06T12:23:23.097+01:00Unity "about:config" no funciona en Ubuntu 11.10 Oneiric OcelotPersonalización de Unity en Ubuntu 11.10; about:config no funciona
english version - all spanish posts
Unity debido probablemente a la política mal entendida de "zero-config" de Ubuntu no se puede modificar y personalizar por defecto.
Teóricamente pulsando alt-F2 y escribiendo en el lanzador "about:config" debería lanzarse la utilidad de configuración de Unity... pero Anonymoushttp://www.blogger.com/profile/12100681780765926058noreply@blogger.com0tag:blogger.com,1999:blog-595967728053047874.post-46516970310262968672011-10-17T17:30:00.006+02:002011-11-06T12:24:21.764+01:00Deshabilitar la cuenta de invitado en Ubuntu 11.10 (Oneiric Ocelot) english version - all spanish posts
¿cómo quitar el acceso de invitado en ubuntu 11.10?
Ubuntu a partir de la versión 11.10 (Oneiric Ocelot) usa como display manager por defecto lightDM. Es bastante más atractivo que el viejo GDM pero incorpora "de serie" una sesión de invitado sin ningún tipo de restricción por contraseña. Es una decisión de los desarrolladores de Ubuntu cuanto menos Anonymoushttp://www.blogger.com/profile/12100681780765926058noreply@blogger.com4tag:blogger.com,1999:blog-595967728053047874.post-63853790574021430922011-10-16T15:17:00.003+02:002011-11-06T12:24:40.659+01:00Disable guest session in Ubuntu 11.10 (oneiric ocelot) spanish version - all english posts
How to disable the guest account in Ubuntu 11.10?
Ubuntu 11.10 uses lightDM as the default display manager. Certainly it looks cooler than the old GDM, but by default it comes (in the ubuntu package) with a guest session enabled which is at least an arguable decision from many points of view (utility, security, etc).
To disable that guest login account Anonymoushttp://www.blogger.com/profile/12100681780765926058noreply@blogger.com2tag:blogger.com,1999:blog-595967728053047874.post-1122385513235627882011-10-12T19:45:00.003+02:002011-10-12T19:47:34.072+02:00I sign it too!X11 - No words :-)
This applies to almost every aspect of GNU/Linux nowadaysAnonymoushttp://www.blogger.com/profile/12100681780765926058noreply@blogger.com0tag:blogger.com,1999:blog-595967728053047874.post-59916504725759475572011-04-17T14:08:00.012+02:002011-11-06T12:47:08.221+01:00Set UUID on reiserfs partitions (fun with bash) spanish version - all english posts
I've just realized that the reiserfs partitions of an old PC are not associated with their corresponding UUID in /etc/fstab. I usually use UUIDs in fstab to avoid problems when adding/removing disks.
This particular PC has several partitions with reiserfs filesystem. Many years ago I preferentially used reiserfs instead of ext2 for obvious reasons. With theAnonymoushttp://www.blogger.com/profile/12100681780765926058noreply@blogger.com2tag:blogger.com,1999:blog-595967728053047874.post-7186389787130546032011-04-17T14:04:00.014+02:002011-11-06T12:48:11.688+01:00Establecer el UUID a particiones reiserfs. Jugando con bash english version - all spanish posts
Acabo de darme cuenta que en un viejo PC las particiones en el fstab no están asociadas al correspondiente UUID. Normalmente suelo asociarlas ya que así evito cualquier problema al añadir/quitar discos.
Este PC en concreto tiene la mayoría de las particiones de los usuarios (distintos /home/XXXX) con reiserfs. Hace muchos años usaba reiserfs de manera Anonymoushttp://www.blogger.com/profile/12100681780765926058noreply@blogger.com0tag:blogger.com,1999:blog-595967728053047874.post-79664663752178800742010-12-12T16:29:00.005+01:002011-11-06T12:51:31.038+01:00gPXE boot from Grub2 spanish version - all english posts
The problem that I'm facing is that I need to boot a PC in a LTSP's environment to do some debugging and testing. Unfortunately, the PXE's BIOS functionality of that PC seems to be broken.
In case you need to boot a thinclient via PXE but its firmware doesn't support that function, you can solve the problem with gPXE as long as the network card is Anonymoushttp://www.blogger.com/profile/12100681780765926058noreply@blogger.com7tag:blogger.com,1999:blog-595967728053047874.post-14659904404571278992010-12-12T16:04:00.009+01:002011-11-06T12:52:36.383+01:00Configurar en Grub2 un arranque vía gPXE english version - all spanish posts
El problema es que necesito arrancar un PC en un entorno de LTSP. Desgraciadamente la funcionalidad de PXE propia de su BIOS no parece funcionar.
Si necesitamos un thinclient que arranque vía PXE pero el firmware no soporta dicha función podemos solventar el problema con gPXE siempre y cuando la tarjeta de red sea reconocida como PCI (no valen las PCMCIAAnonymoushttp://www.blogger.com/profile/12100681780765926058noreply@blogger.com0tag:blogger.com,1999:blog-595967728053047874.post-41385774077250486402010-04-17T16:21:00.016+02:002011-11-06T12:53:41.974+01:00Installing vmware-server-2.0.2 in Ubuntu Lucid Lynx 10.04 LTS spanish version - all english posts
Howto make work wmware-server-2.0.2 in Ubuntu 10.04 LTS lucid lynx
I'm using lucid's beta for a month. Today I remembered that I had not yet tested vmware-server on 10.04 lucid; so we will see how to solve the problems that may appear.
Basically we will do the same we did for karmic:
install vmware-server
apply the ubuntugeek's patch
But since the Anonymoushttp://www.blogger.com/profile/12100681780765926058noreply@blogger.com54tag:blogger.com,1999:blog-595967728053047874.post-55718271314526848112010-04-17T15:45:00.017+02:002011-11-06T12:54:12.093+01:00Hacer que funcione vmware-server-2.0.2 en ubuntu 10.04 LTS lucid lynx english version - all spanish posts
Pasos para la instalación de wmware-server-2.0.2 en Ubuntu 10.04 LTS lucid lynx
Hace ya un mes que uso la beta de lucid. Hoy he recordado que todavía no había probado vmware-server en este servidor así que vamos a ver que problemas encontramos.
Básicamente vamos a hacer lo mismo que para karmic:
instalar vmware-server
aplicar el parche de ubuntugeek
Anonymoushttp://www.blogger.com/profile/12100681780765926058noreply@blogger.com17tag:blogger.com,1999:blog-595967728053047874.post-63682222441400216212010-03-13T22:24:00.012+01:002011-11-06T12:55:29.153+01:00Installing Asterisk and FreePBX on a vmware instance of Ubuntu 10.04 (Lucid) alpha3 spanish version - all english posts
I needed to test some PBX configurations but as I don't have a PBX at hand to use I thought that it would be interesting to test, at last, Asterisk. At the same time, it would be nice to test Ubuntu 10.04 just one month and a half before its release.
For the test I've created an instance of vmware-server 2.0 where I've installed a basic Ubuntu 10.04 LucidAnonymoushttp://www.blogger.com/profile/12100681780765926058noreply@blogger.com25tag:blogger.com,1999:blog-595967728053047874.post-86915183556418054882010-03-13T21:03:00.010+01:002011-11-06T12:56:02.911+01:00Instalación de Asterisk y FreePBX en una instancia vmware de Ubuntu 10.04 (Lucid) alpha3 english version - all spanish posts
Necesitaba probar unas configuraciones en una centralita y como no tengo ninguna a mano que mejor que probar de una vez por todas Asterisk y aprovechar para ver que tal va Ubuntu 10.04 a falta de poco mas de un mes para su lanzamiento.
Para la prueba creo una instancia de vmware-server 2.0 donde instalo Ubuntu 10.04 Lucid alpha3 con las actualizaciones Anonymoushttp://www.blogger.com/profile/12100681780765926058noreply@blogger.com6tag:blogger.com,1999:blog-595967728053047874.post-59598043657271406312010-02-21T12:15:00.004+01:002011-11-06T12:56:32.057+01:00Unicode and Python spanish version - all english posts
This weekend I had in mind posting a few notes about how to correctly use unicode when programming with python. But after reviewing my bookmarks and rereading the magnificent post All About Python and Unicode I have come to the conclusion that publishing anything related to unicode would be light years behind of that wonderful tutorial.
I recommend Anonymoushttp://www.blogger.com/profile/12100681780765926058noreply@blogger.com1tag:blogger.com,1999:blog-595967728053047874.post-90559457793730317312010-02-21T12:12:00.004+01:002011-11-06T12:57:01.071+01:00Unicode y python english version - all spanish posts
Este fin de semana tenía en mente publicar unas notas sobre cómo usar correctamente unicode al programar con python, pero tras repasar los enlaces que tengo guardados al respecto y releer el magnífico post All About Python and Unicode he llegado a la conclusión de que cualquier cosa que publique quedaría a años luz de ese estupendo tutorial.
Recomiendo a Anonymoushttp://www.blogger.com/profile/12100681780765926058noreply@blogger.com0tag:blogger.com,1999:blog-595967728053047874.post-20980799816602487292010-02-13T23:31:00.007+01:002011-11-06T12:57:36.911+01:00Fixing picture's date spanish version - all english posts
I have a couple of bash scripts that I created when I bought my first digital camera back in 2003 or 2004. Those scripts allow me to clasify photos by date. The scripts use the date from the exif metadata that is embedded on each photo file header. That metadata is extracted using the strings command. With that timestamp the script renames each photo as Anonymoushttp://www.blogger.com/profile/12100681780765926058noreply@blogger.com0tag:blogger.com,1999:blog-595967728053047874.post-77411764273239598802010-02-13T22:51:00.006+01:002011-11-06T12:59:08.605+01:00Rectificar la fecha en las fotografías english version - all spanish posts
Tengo una serie de scripts en bash que creé cuando me compré la primera cámara digital, en el 2003 o 2004, que me permiten clasificar las fotos por fechas. Extraen los metadatos del encabezamiento de las fotografías mediante el comando strings. A partir de la fecha que proporcionan los metadatos exif renombran cada fotografía como AAAMMDD_HHMMSS_#.jpg (el Anonymoushttp://www.blogger.com/profile/12100681780765926058noreply@blogger.com0tag:blogger.com,1999:blog-595967728053047874.post-80236966746923804602010-01-26T23:04:00.007+01:002011-11-06T13:00:02.832+01:00When did the system boot spanish version - all english posts
The most common way to find out when was the last start is using the command "uptime":
root@blogspot:~# uptime
22:28:20 up 22 days, 12:48, 1 user, load average: 0.11, 0.04, 0.00
However that command doesn't tell us WHEN but HOW LONG!
Hence, only for curiosity, here are a few recipes to get that WHEN:
With "who":
root@Anonymoushttp://www.blogger.com/profile/12100681780765926058noreply@blogger.com0tag:blogger.com,1999:blog-595967728053047874.post-25714710962390157772010-01-26T22:50:00.007+01:002011-11-06T13:00:31.831+01:00Cuándo se inició el sistema english version - all spanish posts
La forma mas habitual de averiguar cuando se produjo el último inicio del sistema es mediante el comando uptime:
root@blogspot:~# uptime
22:28:20 up 22 days, 12:48, 1 user, load average: 0.11, 0.04, 0.00
Pero ese comando no nos dice CUANDO sino HACE CUANTO.
Así que aunque solo sea por curiosidad aquí van unas cuantas recetas para obtener el CUANDOAnonymoushttp://www.blogger.com/profile/12100681780765926058noreply@blogger.com0tag:blogger.com,1999:blog-595967728053047874.post-24976727476096245782010-01-23T21:49:00.005+01:002011-11-06T13:01:34.622+01:00Counting pages spanish version - all english posts
We have an application that generates PDF reports from rst formated text files. One of the requirements that the applicaction should have is the numbering of pages in the format "Page X of Y". Unfortunaltely our application is an implemetation of rst2pdf 0.11 which doesn't have shuch feature (at least in the version we have). Although it Anonymoushttp://www.blogger.com/profile/12100681780765926058noreply@blogger.com0