Making iPython Virtualenv Aware

iPython is a great replacement for the standard Python shell, but, out of the box, it doesn’t play well with virtualenv.

This can be fixed with a couple of changes:

In the terminal generate an iPython default config file:

ipython profile create

Open the newly generated file:

vi ~/.ipython/profile_default/ipython_config.py

Add the following code at the end of the ipython_config.py file:

import site
from os import environ
from os.path import join
from sys import version_info

if 'VIRTUAL_ENV' in environ:
    virtual_env = join(environ.get('VIRTUAL_ENV'),
                       'lib',
                       'python%d.%d' % version_info[:2],
                       'site-packages')
    site.addsitedir(virtual_env)
    print 'VIRTUAL_ENV ->', virtual_env
    del virtual_env
del site, environ, join, version_info

And that’s it, iPython should now be virtualenv aware.

4 September, 2012 — 4 comments

MacIago for iPhone released

Finally, the long overdue version of MacIago for the iPhone has been released!

Get it here: MacIago iTunes link


16 March, 2011 — Comments Off on MacIago for iPhone released

Moving to Linode

Being on a shared host quickly becomes a pain, specially when you try to customize your shared environment, so I finally decided to upgrade to a VPS.

I’ve packed my bags from Bluehost.com and moved to the excellent Linode.com.

I chose the base 512MB plan, couldn’t be happier. The extra control you get over your installation and the performance are a dramatic improvement.

Well actually I could, if you click on this Linode.com link, which has my referral code, I’ll get some discount from them.

27 July, 2010 — one comment

iPhone Headphone Jack not Working

Well, some time ago my iPhone stopped recognizing the headphones, it really looked like some hardware failure, and I started to lose my hope, iPhone was 2+ years old, and a repair would be too costly for sure.

Well, after some googling around, it turns out that the solution was pretty simple, with an open paper clip just remove the accumulated lint inside the iphone’s headphone jack!

How to Fix your iPhone Headphones Mic If It’s Not Working

5 January, 2010 — 21 comments

Mockingbird

Interesting ajax based mockup application, it works better than Balsamiq Mockups although I do prefer Balsamiq’s sketchy looks.

Mockingbird.

5 November, 2009 — Comments Off on Mockingbird

Website Redesign

Finally after almost a year of inactivity, I’ve managed to spend some time to bring rodesia.org back from the stale state it was.

The main reason for this had to do with Mephisto yet again dropping dead. So I had enough of it and decided to eventually move to another blog system, of course a year went by until it happened.

Now I’m using WordPress and I couldn’t be happier with the choice.
Most of the posts have been migrated to WordPress, but all the existing comments have been lost.
The design is also completely new, simpler and richer in typographic effects.

24 July, 2009 — Comments Off on Website Redesign

Google App Engine

Google has just released what could be regarded as a bomb, the Google App Engine, basically a development environment and scallable web hosting, which even includes Google’s own database system.

It’s Python based, and even includes the Django web framework.

It looks like the popularity of Python based development is going to explode…

8 April, 2008 — Comments Off on Google App Engine

Installing PIL on the Mac

The Python Imaging Library, PIL, is a very useful addition to your Python installation if you need to manipulate pictures. Django uses it to validate upload images for example.

On a Mac you do need to install libjpeg beforehand.

Install libjpeg:

  • Get the source: http://www.ijg.org/files/jpegsrc.v6b.tar.gz

  • Extract the archive.

  • Move inside the source directory and execute the following commands:

    cp /usr/share/libtool/config.sub .
    cp /usr/share/libtool/config.guess .
    ./configure --enable-shared
    make
    sudo mkdir -p /usr/local/include
    sudo mkdir -p /usr/local/bin
    sudo mkdir -p /usr/local/lib
    sudo mkdir -p /usr/local/man/man1
    sudo make install
    

Install PIL:

  • Get PIL at: http://effbot.org/downloads/Imaging-1.1.6.tar.gz

  • Extract the archive.

  • Move inside the source directory

  • Change the following values in setup.py from the default None to:

    JPEG_ROOT = "/usr/local/include"
    ZLIB_ROOT = "/usr/local/include"
    
  • Check if everything is well configured:

    python setup.py build_ext -i
    python selftest.py
    
  • If no errors are found and the required libraries are installed (like JPEG support), install PIL:

    sudo python setup.py install
    

And that’s it, I’ve tried this on Mac OS Leopard, and it works fine, let me know how it went for you.

14 March, 2008 — 3 comments

MacIago 3.6.2

I’ve just released a new update to MacIago, it fixes a nasty crash on 10.4 systems that I wasn’t able to spot since I’m running 10.5, also the game should prove to be more challenging, with its improved artificial intelligence.

[MacIago Homepage](http://rodesia.org/maciago)

28 February, 2008 — Comments Off on MacIago 3.6.2

MacIago 3.6.1

Just a minor and long overdue release that adds French and Japanese localizations to the game.

The Japanese translation was done a long time ago by Christopher Li, who usually releases a Japanese version of Maciago within a day or so after every release.

The French version was done by Yann Ricquebourg.

Thanks a lot guys!

MacIago homepage

19 February, 2008 — Comments Off on MacIago 3.6.1


Older Posts