Yum Force Exclude List

While talking with my fellow colleague Darren Birkett about what seems a design limitation
of yum to not be able to force listing the excludes from yum. I had a
shoot to make a yum plugin to force listing the excludes.
Here is how it works :
root@centos5:~> grep exclude /etc/yum.conf
exclude=rpm*
root@centos5:~> yum install rpm-devel
Loading “installonlyn” plugin
Loading “changelog” plugin
Loading “chmouel” [...]

Generating md5 encrypted password for chpasswd

If you want to generate properly encrypted password to feed to chpasswd, the most easier and proper way is to do that from command line :

echo "encryptedpassword"|openssl passwd -1 -stdin

If you want to generate in pure python you can do it like that :

def md5crypt(password, salt, magic='$1$'):
[...]

Cheetah Mode for Emacs

Here is a simple html derived mode for Cheetah templates files. The font-locking regexp can be improved thought but that’s a start.

(define-derived-mode cheetah-mode html-mode "Cheetah"
(make-face ‘cheetah-variable-face)
(font-lock-add-keywords
nil
‘(
("\\(#\\(from\\|else\\|include\\|set\\|import\\|for\\|if\\|end\\)+\\)\\>" 1 font-lock-type-face)
("\\(#\\(from\\|for\\|end\\)\\).*\\<\\(for\\|import\\|if\\|in\\)\\>" 3 font-lock-type-face)
("\\(\\$\\(?:\\sw\\|}\\|{\\|\\s_\\)+\\)" [...]

Assignement in Python with list.extend()

This is weird for me :

d = [’foo’, ‘bar’, ‘ba’, ‘c’]
print d
f = d
f.extend(d)
print d

give me the result
-*- mode: compilation; default-directory: “/tmp/” -*-
Compilation started at Mon Jul 31 16:49:41
python “/tmp/a.py”
['foo', 'bar', 'ba', 'c']
['foo', 'bar', 'ba', 'c', 'foo', 'bar', 'ba', 'c']
Compilation finished at Mon Jul 31 16:49:4
It seems that extend assign as well the non extended [...]

Jabber/Asterisk and Gajim notification

At work we are using Asterisk and Jabber and i am using Gajim as my client. I did a quick patch to have a notification on my desktop when someone call me and i get my big headphones (not that i like the phone very much but well), here is the patch for people who [...]

Python 2.5 Beta

I have been looking at the What’s new of Python 2.5. There is some cool features inside it :
Conditional Expressions:
This stuff basically allow to do standard C idiom (that we found in every kind of derivative language) like
a = condition ? “true” : “false”
the weird part is that Guido Van-Rossum implemented this syntax :
x = [...]