Alexandre Bourget

geek joy

Archives for January 2010

'"Friends with benefits", after the Pylons presentation at MP11'

January 29, 2010 at 03:38 PM

So this is the short story of my presentation at the Montreal Python user groups on january 25th 2010.

I'm preparing to give a talk on "Pylons, web development done right" (or something alike), at the Confoo conference in March. I wanted to test-drive my presentation, so I decided to jump in after seeing a couple of presentation over there - some of which were pretty so-so, thus pushing me to risk myself.

I wanted the presentation to be a performance (since this is my primary training, as a pianist), a lightning bolt filled with impressive demonstrations, speedy typing, cool technologies using a sweet programming language. I wanted to show off Pylons (http://www.pylonshq.com) and a bunch of WSGI sweetnesses (memento, WPHP, CleverCSS, Beaker, Routes, Mako, SQLAlchemy, SqlSoup, etc.)

So I packed my Karmic system with a Squid3 proxy server, to fake having an Internet connection (while everyone in the room was struggling with the bad/non-existant Wi-Fi connection). I wrote some Python scripts that would do all sorts of background mangling to accelerate the live demos* and organised the presentation in modules, so that I could dynamically add or remove pieces of the demonstration based on interests I sized in the audience.

Finally, the presentation was greatly appreciated if I believe the comments I have received. It was a very good experience for me and I received a gift, which is in fact the subject/object of this post: the book "Friends with benefits".

When I ended the presentation, I was still a bit on a high when Yannick, the lead organiser of Montreal Python handed me the book where everybody could read "Friends with benefits" on the cover. I had no idea this had a double meaning, until my wife told me later in the evening (let it be said, I'm disgusted by the concept). But at that moment, I was happy to receive it, and probably seemed a little too interested in the subject.

Anyway, the book is about Social Media Marketing, and I've been reading it every few minutes I had since then. It gave me a boost to start communicating, on this blog, and elsewhere on the Internet, to start tying those virtual relationships. I guess there's a part of me wanting that my name be known. I also thought it would be great for my company (or should I say, the company I work for), if I started talking about stuff we do around, things I'm enthusiastic about.

It might seem outdated already, but I opened a Google Reader account and started to use more and more those social services, except Facebook which I find is pretty much a waste of time (at least with my friends! :).

The book talks about the shift from traditional medias, press and PR to this new era of social media, conversational dialog between marketers and customers, the role of bloggers in the online community and the influence they have nowadays on people's behavior and decisions. It talks about the importance of having a clean web presence. The part I like the most is the call for truthfulness, transparency, authenticity. It's awesome that this paradigm shift encourages those great social values, more than ruthless marketing and PR.

Now I hope I got the book right: I packed all the keywords I could in this posts' title. Maybe I'll be a little more refined next time.

This book inspired me a lot, and I'm going to do something about it on this blog very soon. Stay tuned.

* These manglings were mostly workarounds for a lacking Internet connection. For those present, there is nothing I did that you could not do (with a little training ?)

Read and Post Comments

Using memento with Pylons

January 20, 2010 at 04:57 PM

Tired of using paster serve --reload development.ini and waiting for your code to reload ?

memento allows you to dynamically reload your code -- without restarting your whole server -- or parts of your code.

Install it:

$ easy_install memento

To integrate with Pylons, follow these steps:

Go to your config/middleware.py, and add:

import memento

Then, a bit lower, replace:

def make_app(...):
    ...
    # The Pylons WSGI app
    app = PylonsApp()
    ...

by:

def make_app(...):
    ...
    # The Pylons WSGI app
    #app = PylonsApp()
    app = memento.Assassin('pylons.wsgiapp:PylonsApp()', ['yourpackage'])
    ...

The second parameter to Assassin() is a list of packages you want reloaded on each request. You probably want your whole package to be reloaded, or you can be more granular.

NOTE: don't forget the () after the PylonsApp, because it has to call the object to get a WSGI app. You'll get errors otherwise

The neat thing is I think you can disable that in real-time also, by changing the value of app.mode ('on' = 'on and 'off' = 'off, as you've guessed), so I guess you'd like to keep a copy of that 'app' before you lose it's reference lower in middleware.py.

Read and Post Comments

VirtualBox and importing OVF problems

January 02, 2010 at 07:18 PM

I've struggled with a WinXP machine not being able to be imported from OVF + VMDK.

At first, I tried to create a new machine, and attach it the .vmdk file directly. When booting Windows XP, it stalled with some UNMOUNTABLE_BOOT_VOLUME and some STOP 0x000000ED errors. I checked the knowledgebases, and surfed the web, only to find nothing.

I tried converting the .vmdk file to a .vdi file with VBoxManage convertfromraw old.bin new.vdi --format VDI (after running qemu-img convert file.vmdk old.bin, as suggested on some sites) without success - in fact, the .VDI file wasn't usable at all, and appeared as data, while other VDI files I had appeared as innotek VirtualBox Disk Image.

When trying to run VBoxManage import myfile.ovf, I kept getting errors like:

VirtualBox Command Line Management Interface Version 3.1.2
(C) 2005-2009 Sun Microsystems, Inc.
All rights reserved.

0%...
ERROR: <NULL>
Details: code NS_OK (0x0), component <NULL>, interface <NULL>, callee <NULL>
Context: "ImportAppliance" at line 261 of file VBoxManageImport.cpp

and sometimes the line with 0%... went up to 90%..., only to stall on the same error.

Just to find out that OVF files must be writable! I had my .ovf file copied from a DVD, so it was only -r--r--r--. Running chmod +rw * made the import feature work.

Still, VirtualBox, if it wants to be able to "write" in the .ovf it's going to import, should just state so, or check it before it runs the importation, or even better: remove the need or the bug that stops you from importing a machine that is read-only!

Btw, I'm using VirtualBox 3.1.2 on Ubuntu Karmic.

Hope this helps.

Read and Post Comments