Posted in 9 January, 2010 ¬ 14:42h.chmouel
Since I haven’t see much script like this around the web here is a quick script to suck bunch of albums from facebooks (your own) nothing fancy just something to get you started with pyfacebook.
#!/usr/bin/python
import os
import urllib
from facebook import Facebook
# see http://developers.facebook.com/get_started.php
# Your API key
API_KEY="YOUR_API_KEY"
# Application secret key
SECRET_KEY="YOUR_SECRET_KEY"
cnx = Facebook(API_KEY, SECRET_KEY)
cnx.auth.createToken()
cnx.login()
cnx.auth.getSession()
def choose_albums(cnx):
[...]
Read the rest of this entry »
Posted in 7 January, 2010 ¬ 14:40h.chmouel
I don’t check very often my twitter to know when someone replies and I find it hard to figure out what’s going on when i check a couple of days after even using a client showing only the reply (my client of choice lately is the Emacs twittering mode client)
I have made a script who’s [...]
Read the rest of this entry »
Posted in 20 December, 2009 ¬ 15:41h.chmouel
Like a lot of people I have my irssi on a server in a screen. This has
been working great so far but my only concerns are the notifications
on the desktop when something happening.
Over the time I have found some different solution with mitigated
results for me :
- Use fanotify script with the libnotify-bin and SSH like [...]
Read the rest of this entry »
Posted in 20 October, 2009 ¬ 19:47h.chmouel
Last week I have posted an article explaining how to connect to Rackspace Cloud Files via Rackspace ServiceNET but I actually got it wrong as pointed by my great colleague exlt so I had to take it down until figured out how to fix it.
I have add that feature properly to the PHP [...]
Read the rest of this entry »
Posted in 14 October, 2009 ¬ 01:47h.chmouel
If you are a Rackspace customer and you are are planning to use Rackspace Cloud Files via it’s internal network (ServiceNet) so you don’t get billed for the bandwidth going over Cloud Files this is how you can do.
The first thing is to make sure with your support team if your servers are connected to ServiceNet and if you [...]
Read the rest of this entry »
Posted in 31 August, 2009 ¬ 06:04h.chmouel
One of the best feature to have with Emacs when doing python development is to have a real time syntax error/warning check highlighted in your code to avoid many errors or superfluous code.
This code is taken from the brillant Emacswiki python page.
You need to install pyflakes first which should be available on your linux distro [...]
Read the rest of this entry »
Posted in 20 March, 2008 ¬ 03:36h.chmouel
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” [...]
Read the rest of this entry »
Posted in 17 August, 2007 ¬ 01:11h.chmouel
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 :
[code lang="bash"]
echo "encryptedpassword"|openssl passwd -1 -stdin
[/code]
If you want to generate in pure python you can do it like that :
[code lang="python"]
def md5crypt(password, salt, magic='$1$'):
[...]
Read the rest of this entry »
Posted in 31 July, 2006 ¬ 17:35h.chmouel
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_\\)+\\)" [...]
Read the rest of this entry »
Posted in 31 July, 2006 ¬ 00:54h.chmouel
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 [...]
Read the rest of this entry »