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” [...]
Filed under: Programming, Python, RedHat on March 20th, 2008 | 4 Comments »
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$'):
[...]
Filed under: Programming, Python, Scripts on August 17th, 2007 | 3 Comments »
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_\\)+\\)" [...]
Filed under: Emacs, Python on July 31st, 2006 | 1 Comment »
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 [...]
Filed under: Python on July 31st, 2006 | No Comments »
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 [...]
Filed under: Misc, Programming, Python on May 25th, 2006 | No Comments »
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 = [...]
Filed under: Python on April 9th, 2006 | 2 Comments »