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/rcS
In this file, change the UTC line as follows: 
UTC=no
#UTC=yes

Reboot, and the clock should display your local time.


Share:
Read More
, ,

Mounting shares permanently in debian

English: Debian OpenLogo Italiano: Logo 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 -T

This command provides the list of your partitions and their size, for instance
 
/dev/sdb2     ext4     38G   18G   18G  50% /
tmpfs tmpfs 5,9G 0 5,9G 0% /lib/init/rw
udev tmpfs 5,9G 252K 5,9G 1% /dev
tmpfs tmpfs 5,9G 0 5,9G 0% /dev/shm
/dev/sdc4 fuseblk 924G 770G 155G 84% /media/DATA
/dev/sde1 vfat 7,7G 23M 7,7G 1% /media/NIKON D90
/dev/sdb1 fuseblk 71G 59G 13G 83% /media/SSD

IF you want to mount a partition permanently, you have to edit the /etc/fstab file. The following tutorial will help you a lot.

In my case, I added:
 
/dev/sdc4       /media/DATA     auto    auto,user,noexec,rw     0       0 
 
 
Share:
Read More

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

my new microsoft wireless mouse and keyboard set!
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 have a look to the /etc/X11/xorg.conf .

I hope it helps...
Share:
Read More
,

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 for instance.
  1. First create a filter: you have to go to gmail's configuration, click on filter, 
  2. then click on create a filter, 
  3. in the "has the words" field, put the filter for the emails you want to delete, for instance "before:2011/12/30" (without the quotes)
  4. Click on create a filter from this search
  5. Choose the action "delete"
  6. Click on the box "also apply to the corresponding XXX discussions"
  7. Validate
  8. Now go to gmail's trashbin
  9. Click on empty thrashbin
That's it, you have just deleted all your oldest emails! 
Do you feel more confident about your emails' privacy? You can, but nevertheless be aware that most of the emails you just deleted are still in the box of the other recipients and of the sender.

NB: It takes a few seconds / minutes to gmail to perform the deletion if you have many mails.

Share:
Read More
,

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

Html-source-code
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 tidy
pip install pytidylib
 
Or alternatively

easy_install pytidylib
 
Or if you are behind a proxy:
pip install pytidylib --proxy "prxy:port"






Then in the python source code:

from tidylib import tidy_document, tidy_fragment
htmlFragment = """
<h1>An HTML example</h1>
<a href="http://www.blogger.com/blogger.g?blogID=4882386696817687861#">my link</a>
"""
htmlFragment, errors = tidy_fragment(htmlFragment,tidyoptions)

You can pass some options to control more finely tidylib:

tidyoptions={
"indent": "auto",
"indent-spaces": 2,
"wrap": 72,
"markup": True,
"output-xml": False,
"input-xml": False,
"show-warnings": True,
"numeric-entities": True,
"quote-marks": True,
"quote-nbsp": True,
"quote-ampersand": False,
"break-before-br": False,
"uppercase-tags": False,
'uppercase-attributes': False
}
 
 
Share:
Read More