Debian clock problems: solution to permanent time shifts problems in the clock

Debian clock problems: solution to permanent time shifts problems in the clock

For french people: ce post décrit une solution au problème d'horloge sous debian (squeeze) quand l'horloge de gnome est décalée en permanence d'une ou deux heures.Solution:sudo vim /etc/default/rcSIn this file, change the UTC line as follows: UTC=no#UTC=yesReboot, and the clock should display your local...
Share:
Read More
Mounting shares permanently in debian
, ,

Mounting shares permanently in debian

Have you ever wondered how to mount shares permanently in Debian? That's a question I see often on forums. In fact it's simple once you have understood the role and syntax of the famous "/etc/fstab" file.First, get an idea of your disks and partitions:  root@myDebian:/home/toto# df -h -TThis command...
Share:
Read More
Debian, what to do if the numerical keypad does not work?

Debian, what to do if the numerical keypad does not work?

In Debian, what do you do if the numerical keypad does not work? In fact it's a very common problem! To solve it, you just need to know this killer tip: try pressing shift + numlock instead of just numlock.It works in most cases. Otherwise, your keyboard might be miss-configured and you should...
Share:
Read More
Privacy: how to delete all old e-mails from gmail
,

Privacy: how to delete all old e-mails from gmail

The amount of personal and sensitive information stored in e-mails is huge, and the risk that someone compromises this information increases with time. So, here is the method to delete old emails from gmail. I also advise you to use a strong password on your emails to prevent identity theft and spying...
Share:
Read More
How to use html tidy with python to validate HTML content?
,

How to use html tidy with python to validate HTML content?

Html-source-code (Photo credit: Wikipedia)Ttidy is a famous toolset for validating HTML and XML content. It identifies mistakes, and corrects them auto-magically. To use it from python, you can use pytidylib:sudo apt-get install tidypip install pytidylib Or alternativelyeasy_install pytidylib Or...
Share:
Read More
Manual profiling of python code (especially if you use celery)

Manual profiling of python code (especially if you use celery)

English: Official logo of the Université libre de Bruxelles (Photo credit: Wikipedia)Profiling tools like cprofile provide hardly understandable output for my celery based app. So I used a tool called manual profiling by Pierre de Buyl from University of Toronto - Université Libre de Bruxelles (many...
Share:
Read More
Profiling python code with celery

Profiling python code with celery

In this article I explain how you can profile python code with celery, and why I find this solution disappointing. I propose a better solution in the conclusion. Have fun !Head of celery, sold as a vegetable. Usually only the stalks are eaten. (Photo credit: Wikipedia)If you are in a hurry, you can...
Share:
Read More
Setting proxy for bash in debian

Setting proxy for bash in debian

English: Xfce Terminal. on Debian Lenny. 日本語: Xfce Terminal。Debian Lennyで。 (Photo credit: Wikipedia)In this post, I will explain you how to configure the default proxy for bash in Debian. I often see questions about this in forums, so I hope it will help. If so, I would love to see links pointing to...
Share:
Read More
How to replicate / export a virtualenv from a machine to another ?
,

How to replicate / export a virtualenv from a machine to another ?

Sudo (Photo credit: Scelus' Comix)If you code in Python, you probably use virtualenv to maintain a clean setup and avoid problems with different versions of pythons. But sometimes, you need to replicate / export a virtualenv from a machine to another. This post will explain you exactly how to do this.First,...
Share:
Read More
How to install brother HL 227DW driver on debian x64?

How to install brother HL 227DW driver on debian x64?

First, a big up to Brother: their printers are excellent, and they provide drivers for Linux! In only hate it that they display a warning before the toner is actually empty... But that's another story. So in this post, I will explain you how to install brother HL 227DW driver on debian x64.To install...
Share:
Read More
What to do if you accidently delete the admin user in a django project?

What to do if you accidently delete the admin user in a django project?

Django logo (Photo credit: Wikipedia)Have you ever wondered what to do if you accidently delete the admin user in a django project? That's a nasty problem in appearance, but not too serious in practice: Django provides a command line utility to solve that kind of problems:manage.py createsuperuser --username=joe...
Share:
Read More
Playing with django-invitation module

Playing with django-invitation module

Invitation to the Dance (film) (Photo credit: Wikipedia)Django logo (Photo credit: Wikipedia)In this post, I will explain you how to use the great Playing  django-invitation module, which as its name indicates permits to invite people to the beta of a web app, for example.The documentation...
Share:
Read More
NoReverseMatch error in python django... The solution
,

NoReverseMatch error in python django... The solution

More accurate representation of relationship between URIs, URNs, and URLs. Revised version of File:URI Venn Diagram.svg, per Talk:Uniform Resource Identifier#Misleading Venn Diagram in a different way. (Photo credit: Wikipedia)NoReverseMatch error is nasty with python Django. It happens often when you...
Share:
Read More
Playing with user registration in django
, ,

Playing with user registration in django

English: Gmail registration screenshots فارسی: عکس‌های برگه ثبت‌نام جی‌میل (Photo credit: Wikipedia)Django registration module is quite handy whenever you need some users to, well, registrate to your website... In this post, I will explain you how to install and configure it for your web app.To install...
Share:
Read More
How to install keepass2 in debian squeeze

How to install keepass2 in debian squeeze

If you want to install Keepass2 under Debian Squeeze, you will have a problem: keepass2 is not in the official repositories. Only keepassX is available.In this blog post I explain how to install Keepass2 nevertheless.At first glance, I see two potential solutions: We can find the keepass2 package on...
Share:
Read More
Django hosting: experience with webfaction

Django hosting: experience with webfaction

Webfaction payment history (Photo credit: yashh)I hesitated a lot among several options for hosting a django based web app. After reading a lot of posts, I decided to go with webfaction, because there was a lot of positive feedback from existing customers and they have a two month cost free cancellation...
Share:
Read More
How to configure Django with PostgreSQL?
,

How to configure Django with PostgreSQL?

In this post, I will explain you how to configure Django with PostgreSQL instead of MySQL.I did several changes locally before deploying my app to heroku and Amazon S3.I changed my configuration to use postgreSQL instead of mySQL. I did not have any data stored in MySQL, so I reinitiated a brand new...
Share:
Read More
Which server for deploying a scalable django powered web app? How to install nginx and gunicorn for django.
, ,

Which server for deploying a scalable django powered web app? How to install nginx and gunicorn for django.

Debian OpenLogo (Photo credit: Wikipedia)English: Nginx Logo Español: Logo de Nginx (Photo credit: Wikipedia)This post explains how to install nginx and gunicorn for django under linux Debian.From my readings, nginx should be used to serve static files. Nginx should proxy all other requests to gunicorn.These...
Share:
Read More
How to know the size (number of row/records) of a mysql database?
,

How to know the size (number of row/records) of a mysql database?

In this post, I will show you how to know the size (number of row/records) of a MySql database.I wanted to host an app on heroku. They offer free database for up to 10000 rows. So, I needed to know if my database fits into that limit...$ mysql -u root -p mysql> use my_site_dbmysql> SELECT SUM(TABLE_ROWS)...
Share:
Read More
Celery and warning messages (print) to stdout
,

Celery and warning messages (print) to stdout

In this post, I will explain you how to use Celery and print warning messages to stdout.Cross section of celery stalk, showing vascular bundles, which include both phloem and xylem. (Photo credit: Wikipedia)If you use celery, you might be frustrated by the absence of the 'print' assertions that you...
Share:
Read More
How to install lxml (how to force easy_install to use a given version)?

How to install lxml (how to force easy_install to use a given version)?

Synaptic Package Manager 0.61 on ubuntu (Photo credit: Wikipedia)To install lxml in your virtualenv, do:sudo apt-get install libxml2-dev libxslt-deveasy_install lxml==2....
Share:
Read More
why "from toto Import *" is a bad idea in Python programs.

why "from toto Import *" is a bad idea in Python programs.

In this post, I will explain you why the good practice in Python programs is to carefully import only what is necessary to run your program. Let's start with an example. Sometimes, I feel lazy and use:from toto import *This is a bad idea, as sometimes the name of the things that you import will conflict...
Share:
Read More
A simple DeTeX function in python - LaTeX to text
,

A simple DeTeX function in python - LaTeX to text

The LaTeX logo, typeset with LaTeX (Photo credit: Wikipedia)I have implemented a simple DeTeX function in Python. I provide this function below, as is and without any guarantee. If you run it, and it should change the example LaTeX text into "simple" text thanks the detex() function defined in the code....
Share:
Read More