pabluk's blog... IPv6 ready!
Linux
Running Scrapy on Amazon EC2
Mar 26th
Sometimes can be useful to crawl sites with Scrapy using temporary resources on the cloud, and Amazon EC2 is perfect for this task. You can launch an Ubuntu OS instance and schedule your spiders using the Scrapyd API.
With boto, a python interface to Amazon Web Services, you can launch instances and install the scrapy daemon using the user data feature to run a script on boot.
First, you need an AWS account with your access keys, a EC2 security group accepting TCP connections on port 6800 and a key pair for the selected region. After that you must choose an Ubuntu EC2 image, here you can find a list of Ubuntu AMIs.
We need to create an user data script with the following content
#!/bin/bash # filename: user_data-scrapyd.sh # Add Scrapy repositories and key echo "deb http://archive.scrapy.org/ubuntu precise main" > /etc/apt/sources.list.d/scrapy.list curl -s http://archive.scrapy.org/ubuntu/archive.key | apt-key add - # Install debian package apt-get update && apt-get -y install scrapyd-0.16 # Restart scrapyd service scrapyd restart
finally we can launch an instance using boto on the python console
$ python
>>> with open('user_data-scrapyd.sh') as f:
... user_data = f.read()
...
>>>
>>> import boto.ec2
>>> conn = boto.ec2.connect_to_region("us-east-1",
... aws_access_key_id='my_aws_access_key',
... aws_secret_access_key='my_aws_secret_key')
>>> conn.run_instances('ami-da0d9eb3', user_data=user_data, key_name='main', instance_type='t1.micro', security_groups=['default'])
Reservation:r-89a2aef3
>>> reservations = conn.get_all_instances()
>>> reservations
[Reservation:r-89a2aef3]
>>> instances = reservations[0].instances
>>> instances
[Instance:i-d4a2c1b8]
>>> i = instances[0]
>>> i.state
u'pending'
>>> i.update()
u'running'
>>> u'http://%s:6800/' % i.public_dns_name
u'http://ec2-54-224-86-173.compute-1.amazonaws.com:6800/'
and pointing your browser to this URL you must see the Scrapyd monitoring page.
Now you can schedule a spider run just by using
$ curl http://ec2-54-224-86-173.compute-1.amazonaws.com:6800/schedule.json -d project=myproject -d spider=spider1
{"status": "ok", "jobid": "70d1b1a6d6f111e0be5c001e648c5a52"}
You can find a copy of these scripts on Github ec2-scrapyd.
Ubatar and the Ubuntu App Showdown
Jul 8th
The last 3 weeks I was working on developing an application to participate in a contest called Ubuntu App Showdown.
My application is called Ubatar and its main objective is to provide a solution to this idea. Here you can see some videos of the latest version of Ubatar fulfilling its purpose.
During these 3 weeks I learned many things, reading a lot of source code, looking for examples and discussing with other developers.
I can only say that I really enjoyed and was an incredible experience.
Thanks to all the Ubuntu development team and the community at large.
And this is not the end of the project, there are still many things to improve, if you want to help please contact me via this form. Also any questions or suggestions can be sent to Questions for Ubatar in Launchpad.
Installing Solr on Debian 6.0
Feb 22nd
Recently I’ve been working on a Django project that uses the Haystack search API and the Solr search engine to perform full text searching on indexed data.
This project was initially deployed on a Debian 5.0 (Lenny) server with some issues with Tomcat, but using the latest stable release of Debian (code named Squeeze) install Tomcat 6 and Solr is very easy.
Just run the following
apt-get install tomcat6 tomcat6-admin
download and install the latest version of Solr
wget http://apache.cict.fr//lucene/solr/1.4.1/apache-solr-1.4.1.tgz tar xvfz apache-solr-1.4.1.tgz cd apache-solr-1.4.1 cp dist/apache-solr-1.4.1.war /var/lib/tomcat6/webapps/solr.war cp -fr example/solr /var/lib/tomcat6/ chown -R tomcat6:tomcat6 /var/lib/tomcat6/solr
after install Solr you need to restart the tomcat6 service
/etc/init.d/tomcat6 restart
And voilà, Solr is running. Point your browser to http://localhost:8080/solr/admin this should show the Solr Admin interface.
Metacity Window Buttons
Mar 10th
Una simple herramienta para configurar los botones de Metacity (el window manager del escritorio GNOME).
Si estas usando Ubuntu Karmic Koala y querés configurar los botones para que se vean como en la nueva versión Lucid Lynx. O si usas Lucid Lynx y querés volver la configuración al estilo de Karmic Koala, lo podés hacer sin tener que usar el editor de configuraciones de GNOME (gconf-editor).
Me parece muy bueno el cambio en los botones de las ventanas para la nueva versión de Ubuntu, para hacerlo diferente, único. Costará un poco adaptarse pero es como todo, por eso yo ya cambié el estilo de los botones en mi Karmic
. De todas formas si a alguien no le gusta lo puede cambiar a su gusto, incluso si lo preferís, podés sacar todos los botones de las ventanas
Este es el enlace a la página de descarga.
Y estos son los pasos para descargarlo y ejectuarlo desde una terminal
wget http://launchpad.net/mwbuttons/trunk/v0.2/+download/mwbuttons chmod +x ./mwbuttons
La aplicación esta hosteada en Launchpad y la idea inicial fue solo para probar el módulo gconf de Python y el plugin de Launchpad para Bazaar.
Pimp your GNOME Desktop
Jan 19th
The real title of this post should have been Pimp your Metacity, but not everyone knows that Metacity is the official window manager of GNOME.
This is just a modified version of the default theme in Ubuntu Karmic Koala. The main difference is that the minimize, maximize and close window bottons has been removed. They are only activated by mouseover.
It is useful for users who already know the position of the window buttons in GNOME and all the time use keyboard shortcuts to manage the windows. And especially useful on small screens like netbooks where there is not enough space avaliable to display redundant things.
The Human Simple theme can be downloaded from GNOME-Look http://gnome-look.org/content/show.php?content=118052
ext4 support in Ubuntu Intrepid 8.10
Jul 1st
This is just a simple tip to use ext4 filesystems in Ubuntu Intrepid Ibex 8.10.
In Ubuntu Jaunty ext4 filesystems is fully supported but in Intrepid was in developing.
To use it we must load the module ext4dev
sudo modprobe ext4dev
to check the filesystems supported by the kernel we can do
cat /proc/filesystems
there should be a line with ext4dev.
Now, if we try to mount a formatted partition as ext4, will see that we can not do
sudo dmesg | tail
shows a line that says
EXT4-fs: sda2: not marked OK to use with test code.
to solve it we need to enable test_fs, an extended option for ext4 partitions
sudo tune2fs -E test_fs /dev/sda1
Now, we can mount it without problems
sudo mount -t ext4dev /dev/sda1 /mnt/disk
That’s all folks!
Note 1: replace sda1 by the appropiate device
Note 2: sorry for my english
Y ahora… cuál es la excusa?
May 30th
Después de ver este video y escuchar lo que dice la gente, (dejando de lado que la elección de las personas que se muestran es arbitraria) creería que mucha gente que conozco que usa Windows diría lo mismo.
Entonces me sigo preguntando por que la gente usa Windows?.
Fuente: http://www.zdnet.com.au/insight/software/soa/Is-it-Windows-7-or-KDE-4-/0,139023769,339294810,00.htm
Bluetoothificando mi música!
May 27th

Este es un post rápido de como poner un headset Bluetooh en un equipo de sonido para escuchar la música de mi laptop en forma inalámbrica.
Lo que necesité fue el headset Bluetooth que consiguio mi chica por €4, un capacitor de 220µF y un pedazo de cable con un conector USB macho. En Linux este no es mas que otro dispositivo de audio al que se le puede redireccionar cualquier fuente de sonido.
La ventaja de este headset es que tiene una salida para los auriculares, que se puede utilizar para alimentar la entrada auxiliar de mi equipo de sonido. Pero no todo es tan bueno, el problema es que el conector donde se conecta la salida de audio es el mismo donde se conecta el cargador para la batería interna, el dispositivo contiene una batería recargable que dura aproximadamente 4 horas de reproducción continua, y como usa el mismo conector no se puede escuchar música mientras se está cargando. Así que había que modificarlo para que quedara embebido en mi equipo de sonido.
Las imágenes hablan por si solas
More >
Listo para la Expo2009!
May 20th
Como muchos sabrán el 23 y 24 de mayo de 9 a 18hs se realiza la Expo2009, organizada por el LUGMen en la UTN de Mendoza.
Mirando el cronograma, ya estoy viendo las charlas a las que asistiré con seguridad, como la de Boris sobre el proyecto Xen, la de almacenamiento masivo con software libre, la de procesamiento distribuido, y la de iSCSI entre otras.
Y de paso, para promocionar la Expo2009 acá les dejo un wallpaper para sus desktops de esta semana. Creado a partir de http://twitpic.com/508mm
Expo2009.jpg – Size: 305Kb Resolution:1024×600 (la de mi EeePC)
GNOME Do: lo más cercano a que te lean la mente
Apr 24th
Como dice su homepage
En otras palabras, permite ejecutar acciones de cualquier tipo dentro de GNOME con solo escribir algunos caracteres de la primera palabra que se nos viene a la mente sobre lo que queremos hacer.
Se puede reproducir música, abrir documentos, twittear, suspender, etc, etc… todo sin quitar las manos del teclado.
Lo más útil de GNOME últimamente!










Hi! this is my personal web site and weblog about my projects, news related to free and open source software, internet and sometimes about real life ;)