27 de septiembre de 2011

How to install GTK and PyGTK in Mac OS X Lion

I run into some problems trying to install GTK and PyGTK, but I found a workaround, so here's the trick:

You'll need to have brew installed in your system. If you don't have brew installed, you can installed just by running this command:

$ /usr/bin/ruby -e "$(curl -fsSL https://raw.github.com/gist/323731)"
 Now you are ready to go!

Install GTK: just run this command:
$ brew install gtk
Install PyGTK:
  • Download this: link.
  • It is a Mac installer package. Install it.
That's it!

You  can test your installation from a Python console this way:
$ python
>>> import pygtk

26 de septiembre de 2011

How to change blogger's default language?

Weird hidden option, you can set Blogger's / Blogspot's default language from this link:
http://www.blogger.com/language.g
 Short post :)

Salud!

Delete all "Thumbs.db" files


I haven't used windows for about 5 years now. Lucky me! I now see the world with better eyes and my hair health has certainly improved jeje.

Anyway, some trash always remains and have to be taken care of. Like the hideous "Thumbs.db" files that windows creates everywhere.

How to get rid of them?

First, find out how many of them you have, by running this command:
find . -iname "Thumbs.db"
And just run the following command in the base folder from where to erase them:
find . -iname "Thumbs.db" -delete

You can do just the same for the "desktop.ini" files.

Saludos!

24 de septiembre de 2011

Procrastinando una atrocidad, inspirado por @ralsina :P


Acá en PyConAr Junín 2011, inspirado por unos comentarios que hizo @ralsina en una charla, surgiéronme estas atrocidades, que tenía que compartir:




:)

15 de septiembre de 2011

Después de haber laburado más de 10 horas hoy....

.... llegar al final del día logrando esto, es.... en un modo muy particular, maravilloso! jeje

Acá la cosa en cuestión que me hizo feliz ver:


----------------------------------------------------------------------
Ran 414 tests in 232.764s

OK
Destroying test database for alias 'default' ('test_cpi_mrp3')...


Sí señor! Sí señor! Ahora sí puedo hacer un push a origin e irme a dormir :)

13 de septiembre de 2011

How to install meld in Mac OS X Lion


Missing the nice and sweet meld program for your SVN or GIT diffs in Lion?

Try this:

  1. Get and install pygtk:
  2. Get meld
  3. Extract the tar.bz2, go to the extracted directory and then run:
    1. Note: This assumes you have brew installed. If not, see here.
      • $ brew install intltool
      • $ brew install gettext
      • $ export PATH=/usr/local/Cellar/gettext/0.18.1.1/bin/:$PATH
      • $ make prefix=/usr/local/ install 
  4. Now you should now have the 'meld' command available.

Some useful links I went through to figure the above mentioned steps:
  • http://meld.sourceforge.net/
  • http://meld.sourceforge.net/install.html
  • http://www.mail-archive.com/pygtk@daa.com.au/msg20559.html

Piloteando un día complicado, en el día del programador

Bueno, no todos los días son lindos, simpáticos, brillantes y afortunados. Hasta hay veces en que escribo en mi blog en castellano y sólo porque sí, y no para acordarme y compartir algún tip técnico.

Por ejemplo, hoy empecé mi día pornográficamente temprano, con todos los tests y mi instancia local(sí, soy programador, hoy es el día del programador, y nótese no puse eso entre mis desgracias del día jeje), se me rompió el cosito que hace que salga el agua del inodoro, me golpeé la rodilla con una silla y me cayó perfume en un ojo.

Pero podría ser peor. Por ejemplo, me podría haber caído perfume en el otro ojo también. O en vez de la rodilla me podría haber golpeado la ingle.

Pero toda esta racionalización en la vastísima mayoría de los casos no sirve de nada: uno simplemente se pega unas encabronadas tremendas. El punto de este post es, por si acaso les sirviera, compartirles algo que de vez en cuando me mejora un poquito el humor en estos días parcialmente nublados.

¿Qué hago para desencabronarme un poquito en días como hoy?

Bueno, suelo tomarme un té de boldo y leer el Desiderata. ¿Qué es el té de boldo? Bueno, eso no es tan importante. Tomen la infusión que prefieran, estimo que va a funcionar de cualquier modo.
¿Qué es el Desiderata? Les transcribo un poquito de Wikipedia, para poner contexto a la cuestión:

Desiderata (del latín desiderata "cosas deseadas", plural de desideratum) es un poema muy conocido sobre la búsqueda de la felicidad en la vida. Sus derechos de autor son del año 1927 y pertenecen a Max Ehrmann. Desiderata fue publicado en 1948 (después de la muerte de su autor) en una colección de poemas titulada Desiderata of Happiness, recopilados por la esposa de Ehrmann.
En la década del 60 circuló sin la atribución a Ehrmann, a veces con la afirmación de que había sido encontrado en la iglesia St. Paul de Baltimore, en Maryland, Estados Unidos. También se decía que había sido escrito en 1692 (año de la fundación de la iglesia). Sin embargo, esta poesía ha mantenido el sello de Ehrmann en algunas de sus ediciones.
Fuente: http://es.wikipedia.org/wiki/Desiderata

Bueno, ya que estamos en esto, el Desiderata en sí, es este:


“Camina plácidamente entre el ruido y las prisas,

y recuerda que la paz puede encontrarse en el silencio.

Mantén buenas relaciones con todos en tanto te sea posible, pero sin transigir.

Di tu verdad tranquila y claramente;

Y escucha a los demás,

incluso al torpe y al ignorante.

Ellos también tienen su historia.

Evita las personas ruidosas y agresivas,

pues son vejaciones para el espíritu.

Si te comparas con los demás,

puedes volverte vanidoso y amargado

porque siempre habrá personas más grandes o más pequeñas que tú.

Disfruta de tus logros, así como de tus planes.

Interésate en tu propia carrera,

por muy humilde que sea;

es un verdadero tesoro en las cambiantes visicitudes del tiempo.

Sé cauto en tus negocios,

porque el mundo está lleno de engaños.

Pero no por esto te ciegues a la virtud que puedas encontrar;

mucha gente lucha por altos ideales

y en todas partes la vida está llena de heroísmo.

Sé tu mismo.

Especialmente no finjas afectos.

Tampoco seas cínico respecto al amor,

porque frente a toda aridez y desencanto,

el amor es tan perenne como la hierba.

Acepta con cariño el consejo de los años,

renunciando con elegancia a las cosas de juventud.

Nutre la fuerza de tu espíritu para que te proteja en la inesperada desgracia,

pero no te angusties con fantasías.

Muchos temores nacen de la fatiga y la soledad.

Más allá de una sana disciplina,

sé amable contigo mismo.

Eres una criatura del universo,

al igual que los árboles y las estrellas;

tienes derecho a estar aquí.

Y, te resulte o no evidente,

sin duda el universo se desenvuelve como debe.

Por lo tanto, mantente en paz con Dios,

de cualquier modo que Le concibas,

y cualesquiera sean tus trabajos y aspiraciones,

mantente en paz con tu alma

en la ruidosa confusión de la vida.

Aún con todas sus farsas, cargas y sueños rotos,

éste sigue siendo un hermoso mundo.

Ten cuidado y esfuérzate en ser feliz”.

How to fix Brew Update Error ( mxcl / homebrew, Mac OS X Lion)


Did you, like myself, get something like this while running a brew update?

[matias@MacBookPro]:~ $ sudo brew update
Password:
remote: Counting objects: 588, done.
remote: Compressing objects: 100% (253/253), done.
remote: Total 455 (delta 348), reused 298 (delta 193)
Receiving objects: 100% (455/455), 52.32 KiB, done.
Resolving deltas: 100% (348/348), completed with 124 local objects.
From http://github.com/mxcl/homebrew
 * branch            master     -> FETCH_HEAD
error: The following untracked working tree files would be overwritten by merge:
        .gitignore
        Library/Aliases/0mq
        Library/Aliases/4store
(.... lots of lines ....)
        Library/Formula/android-sdk.rb
        Library/Formula/angband.rb
        Library/Formula/ansifilter.rb
        Library/Formula/antiword.rb
        Library/Formula/antlr.rb
        Library/Formula
Aborting
Error: Failed while executing git pull origin master
The fix is easy. Luckily. Goes like this:
$ sudo chown -R `whoami` /usr/local
$ cd /usr/local
$ git reset --hard origin/master
$ cd

Now you can try again:
[matias@MacBookPro]:local (git: master ?) $ brew update
From http://github.com/mxcl/homebrew
   3dc7fe2..09ebe32  master     -> origin/master
Updated Homebrew from 3dc7fe29 to 09ebe32c.
==> New formulae
aespipe       fuse4x        fuse4x-kext   ntfs-3g       parmetis      s3fs          scotch        sshfs
==> Removed formulae
unix2dos
==> Updated formulae
(.... lots of stuff here ....)

9 de septiembre de 2011

Cómo Instalar NINJA IDE en Mac OS X Lion

Hace poquito actualicé mi compu a Lion y reinstalé NINJA. Con Diego Sarmentero hicimos luego una mini-sprint para dejar NINJA andando aceitadamente y bien nativo en Mac.

Acá les dejo las instrucciones para instalar NINJA desde el repositorio en desarrollo:

  1. Instalar XCode desde el App Store:
    • http://itunes.apple.com/us/app/xcode/id448457090?mt=12
  2. Instalar HomeBrew:
    • https://github.com/mxcl/homebrew/wiki/Installation
  3. Instalar Qt y PyQt:
    • $ brew install qt
    • $ brew install pyqt
    • Agregar esta línea en el archivo ~/.profile:
      • export PYTHONPATH=/usr/local/lib/python:$PYTHONPATH
  4. Hacer un checkout del repositorio de NINJA:
    • Hace falta tener instalado Mercurial para hacer el clone del repositorio. Si no lo tenés instalado, lo podés instalar así:
      • sudo easy_install mercurial
  5. Ejecutar NINJA:
    • Vamos a la carpeta del checkout:
      • $ cd ~/NINJA_IDE/ninja-ide/
      •  $ python ninja-ide.py

Y ahora, a disfrutar de NINJA-IDE!

Disable autocorrection in Mac OS X Lion

I found that Mac OS X Lion came by default with an autocorrection functionality. This can be useful... or a big annoyance!

For instance, it annoyed me when I typed "TRAC" and replaced it with "trace" in one of my daily SCRUM meetings.


Then, how to disable it?

Go to System Preferences -> Language and Text -> Text tab, and disable the check:





Done!

7 de septiembre de 2011

Mac OS X Lion, Python, Django and how I'm happier now with my computer


I recently upgraded my MacBook Pro from Snow Leopard to Lion.

The idea of the upgrade unsettled me quite a bit since I use my computer to work and having it off due to OS or setup issues was not an option. Basically I was worried about having problems to install Python packages(I work mostly as a Django/Python developer, and I use a bunch of stuff from PyPi and quite a few Django pluggables) and I've already had some nasty problems installing, for instance, the MySQL connector in the past in Snow Leopard.

After some hesitation, I finally got myself to the task of upgrading.

After I upgraded, I did all the setup of the Python stuff: all the virtualenvs, Python/Django packages, the requirements for NINJA-IDE, everything WORKED PERFECT. I did not have a single issue. Nor even a single one. I'm happy this of not having to write a long, strange and tricky post saying something like "yes, it is a huge pain in the... patience", because it is just not. Everything work perfect.

I believe that the root cause of the difference relies in Mac OS Lion to came bundled with 64-bit versions of Python pre-installed:

It has, pre-installed:

  • 32-bit Python 2.5
  • 64-bit Python 2.6 (I use this one for work)
  • 64-bit Python 2.7 (I use this for NINJA-IDE, both for running it and to develop the code I write for it)

That's good new that Apple got its OS with more Python magic :)

Tip of the day: how to add a Firefox Persona to favorites?

I didn't find how to do that rightaway, I had to do a little googling.

Here's how if you find yourself wondering around the same question:

- go to getpersonas.com
- create an account(if you don't already have one)
- login
- then, on the details page for any persona, in the top-right, just above the image will be a button that says "Add to favorites" (if you are signed in).
- If you have the "Personas addon" installed, you'll be able to see the Personas you add to favorites listed, which is usefull if you, for instance, reinstall Firefox and want to keep its appearance the same: