Factoryboy: Creating data for unit tests in an easy way

I recently prepared a presentation about Factoryboy, a Python library that automates lot of the work when a developer needs to create some data for unit testing.

I’ve been using this library since a couple of months, both in the company where I work and on a personal open source project I’m working on. I will give a presentation about this library in an internal workshop in my company and I’m available to give it in any Python/Django related event around London, if anyone is interested.

The slides are already available:

How to fix encfs installation on OSX 10.9 (Mavericks) and brew

After upgrading from OSX 10.8.x to 10.9 (Mavericks), encfs recipe is broken. First of all you have to fix a problem with a library header:

then you can install encfs using this remote brew recipe:

It’s also possible that you have to fix fuse4x installation before being able to use encfs (I had to do it):

That’s it! Please note that this is just a workaround (thanks to Giovanni Bajo for suggesting me the symlink fix). Please also note that this recipe uses fuse4x library and not the most updated osxfuse (but it works, anyway). Some other users reported me that there is a fix for the original brew recipe, and this one uses osxfuse. You can find it here https://gist.github.com/defunctzombie/7324625 but I haven’t tested it yet.

Update: to fully integrate encfs with OSX, I also suggest to follow this nice guide http://www.maketecheasier.com/install-encfs-mac/

How to make subwoofer work in Ubuntu

Using the same computer with Windows 8 and Ubuntu I noticed that the sound was worse in Ubuntu and I discovered why soon: subwoofer doesn’t work out of the box!

How to fix it

The fix is quite easy to apply (but it was not easy to find the right one!). First of all edit /etc/pulse/default.pa and add this line at the end:

then edit /etc/pulse/daemon.conf, modify the line “enable-lfe-remixing: no” to “enable-lfe-remixing: yes“, then uncomment it (remove the semicolon in front of it). Reboot your PC and enjoy the subwoofer!

References

How to fix a WordPress website hacked by “zend_framework” malware

I admit. This website, like thousands of others, has been hacked! I still have to identify the precise source of the attack, but I’ve found out that is very common. I was able to discover about the attack just because the dashboard of WordPress stopped working. I decided to investigate and I found this strind on top of every .php file http://pastebin.com/k0iQymRy

Just googling I discovered that I was not alone http://stackoverflow.com/questions/16963818/server-hacked-on-wordpress-files

How to fix this?

The best solution would be to restore the files with a valid backup, but sometimes this is not possible. Here comes an handy bash solution (note: you need to be able to access your hosting with a SSH shell to execute this command): http://pastebin.com/V3nFwwtZ

How to fix pip under Debian 6.0 (squeeze): ImportError: cannot import name parser

The pip utility distributed with Debian 6.0 has a bug once you upgrade it with pip install -U pip. You will easily get this error when you try to install a new package with it:

Luckly there is a very easy workaround:

Reference: http://blog.102web.ru/tag/virtualenvs/