Followers gadget...
November 29th, 2009Have you noticed this?
The Google FriendConnect gadget has been added to the side bar!
Help yourself ![]()
![]()
Syncing Google contacts with Mutt aliases
August 9th, 2009As I, most of the time, access my emails by ssh-ing my server, and use Mutt (http://www.mutt.org), I was wondering how to get the same let say contact list when using Mutt than the one I have in my gmail account.
Hopefully Google as released APIs for tons of things, and one is available to access the contacts (http://code.google.com/apis/contacts/docs/1.0/developers_guide_python.html) using Python (http://www.python.org).
So it has been time for me to write my first ever python script…
The idea is to get a script that:
- download Google contacts emails addresses and create a Mutt local aliases file
- syncs Google contacts emails addresses to Mutt local aliases file
- can be bound to a Mutt macro so that email addresses can be added to Mutt local aliases file and to Google contacts while reading emails in Mutt.
1/ First thing first
Before doing anything harmful for your Google contacts data, please go to your Google account, and backup your contacts using the export feature.
2/ Getting the Google Data Python Library
I won’t do better than Google to document this, so just get a look at http://code.google.com/apis/gdata/articles/python_client_lib.html this and follow the steps…
![]()
3/ Where’s that script?
You can get the script from here: gContactsSync.py
Before running it, two lines (38 and 39) of the script must be edited:
gd_client.email = 'your_gmail_address_comes_here@gmail.com' gd_client.password = 'your_gmail_password_comes_here'
You just have to set your gmail email address and your gmail password in place of the two default values for the script to be operational ![]()
Note that you might also change the path to your local aliases file:
local_aliases_file_path = homedir + '/.mail_aliases'
4/ Wanna integrate the script to Mutt?
One interesting thing in this script is that it has a mode to allow creating an alias from an email within Mutt. It gets the email address of the sender of an email and create an alias in the local Mutt alias file and update your Google contacts.
In order to get this working, the ~/.muttrc file must be edited, and a macro added. Here is the macro that I’m using:
## ## Create a macro to add an alias ## macro index,generic \ea "<enter-command>set wait_key=no\n \ <pipe-message>grep '\^From: ' > /tmp/mutt-alias-to-create\n \ !/path/to/gContactsSync.py --from-file /tmp/mutt-alias-to-create\n \ <enter> !rm /tmp/mutt-alias-to-create\n<enter-command>set wait_key=yes\n"
Then just hit Esc a to create an alias from an email sender address
5/ Todos
Well, there are always plenty of improvement to be done to a script. The first one here should probably be a packaging to set the environment and install dependancies….
Get rid of fingerprint security check with ssh
June 23rd, 2009This can be used to avoid the fingerprint security check. Use this with caution in a trusted environment!!!
ssh -o StrictHostKeyChecking=no user@server
From timestamp to human readable date... using date command
May 29th, 2009
user@server:~$ timestamp = 1234479600; date -d @$timestamp "+%Y-%m-%d %T"
Migration of a XEN VM to HVM on Fedora Core 10
May 21st, 2009I’m used to run virtualized server on XEN (you’ll find a few posts about XEN on this blog), but time has come to rework some of the servers I’m working on. Upgrading a host to Fedora Core 10, I’ve been forced to notice that XEN was no longer part of the system.
RedHat indeedannounced KVM as a virtualization choice for the next release. So, let’s have fun with KVM and Fedora Core 10.
As described in this post the host is running two interfaces. This post will show how to create Bridge interface and will quickly get through the few roadblocks encountered.
VMWare Server 2.0.1 and Hotkeys
May 4th, 2009This post should be entitled “How to send CTRL-ALT-DEL to a Windows virtual machine running in VMWare Server 2.0, when running E17 on Debian GNU/Linux…“
Don’t know why, but after a Debian (and Nvidia driver) update, I was no longer to send CTRL-ALT-DEL to a Windows XP VM by simply hitting CTRL-ALT-DEL…
CTRL-ALT was capture by VMWare and ungrabbing the mouse from the VM console.
A couple of minutes later, I’ve found out CTRL-ALT-PRTSC to be an outstanding replacement to send CTRL-ALT-DEL to the Windows VM!
Hope this can help some of you ![]()
![]()