mercredi 5 mai 2010

SQLite to rule those silly AddressBook, Gmail contacts or Nokia for Exchange

I keep my contacts sync'd between my laptop, GMail and mobile phone via ... GMail.

On my laptop(s), I use iSync on MacOSX and conduit on Linux. They both provide two way sync.

On my phone, I use "Nokia for Exchange" since Google is nice enough to provide an Exchange compatible interface. NFE is configured to sync calendars and contacts.

Unfortunately, for some reasons, NFE or GMail won't sync contacts phone number if the phone label is set to "Other" or maybe just something else than "Mobile", "Home" or "Work" ... So one day, all you have left on your phone is an email for your contacts !@#

Of course, AddressBook and GMail don't provide any convenient way to modify all entries except that AddressBook database is an SQLite3 file.

$ sqlite3 $HOME/Library/Application\ Support/AddressBook/AddressBook-v22.abcddb
sqlite> UPDATE ZABCDPHONENUMBER SET ZLABEL='_$!!$_' WHERE ZLABEL='_$!!$_';
sqlite> .quit

You're done, all your "Other" entries should have been updated to "Mobile" (_$!!$_). Good night.

vendredi 26 mars 2010

Better Google Docs outline with a simple CSS


This is a stupid "productivity suite" post. ERK.

No matter how Google Docs or OpenOffice may be easy to use, open, blabla, I always find myself frustrated with the default style, the non-existent outlining capabilities or the lack of semantic meaning in documents ... Go HTML5, GO !@#

Anyway, if you find the different heading levels barely distinguishable, the custom CSS feature comes in handy.

Go to "Edit" > "Edit CSS" and paste this :

h2 {
  text-indent: 10pt;
}
h3 {
  text-indent: 20pt;
  font-size: small;
}
h4 {
  text-indent: 40pt;
  font-size: smaller;
}

I'm pretty sure you can find some better CSS out there, Google or community provided. I couldn't find any repository for styles nor any kind of "global" CSS option for all my documents.


mercredi 24 mars 2010

Vim : from snippets-emu to snipmate, with love.

Being both lazy and a vim user, as I wrote a while ago, I like using
snippets and completion :
http://blog.jardinmagique.info/2009/09/vim-tips-of-day-snippets-autocomplete.html
I've been using Felix Ingram's snippets-emu vim plugin for quite a while
now :
http://www.vim.org/scripts/script.php?script_id=1318
Feature wise, this is an very nice plugin, however the implementation
and snippets obsolescence have slowly been making it less usable despite
my frequent hacking into Django and python snippets.
As of yesterday, I'm now using Michael Sanders's snipmate plugin :
http://www.vim.org/scripts/script.php?script_id=2540
and the additional django specific snippet set from Rob Hudson and Jason
Peddle :
http://github.com/robhudson/snipmate_for_django
While being iso-functional, snipmate provides some nice improvements
over snippets-emu :
- a better user-experience : snippet expansion just works (tm)
- cleaner code expansion : as shown in the screenshot, snippets-emu
snippet expansion outputs some annoying mark tags on error. Snipmate
output is much cleaner, and leave valid, non-blocking code even if you
leave the snippet as-is
- cleaner snippet definition syntax, as shown in the screenshot
- the project is still active
- there are some nice "community" provided sets of snippets
- snipmate is meant to be almost compatible with textmate sets

Thanks again to the authors of these remarkable plugins !

dimanche 21 mars 2010

Fixed width is the path to the dark side. Fixed width leads to GMail, GMail leads Chromium updates, Chromium updates leads the Virtualbox updates.

The Force is strong with GMail and while I use it from Mutt / offlineimap most of the time, I still miss the fixed width font in the Web interface (not to mention a portable GPG support ...). Google provided a "Fixed width font" Labs feature and then withdrew it in Feb 2009, as if millions of voices suddenly cried out in terror and were suddenly silenced. There are many ways to improve GMail when you are using Firefox through GreaseMonkey scripts and/or user custom CSS : fixed width font, layout and even GPG support. However, if you like using Chrome/Chromium, you're out of luck. No GreaseMonkey, no user custom CSS, nothing, until yesterday.


Yesterday was released the latest "dev channel" Chromium/Chrome update :
http://dev.chromium.org/getting-involved/dev-channel
As stated in the Chromium google code issue tracker
(http://code.google.com/p/chromium/issues/detail?id=2393), the user
stylesheet support is enabled via the "--enable-user-stylesheet" switch
in the "5.0.356.X" releases.
Just create a "User Stylesheets" folder in your Google Chrome profile
datadir (depending on your OS) and create a "Custom.css" file there
containing :

/* GMail fied width font*/
.gs .ii, textarea.Ak {
font-family: MonoSpace !important;   
font-size: 10pt !important;
}
Then, start Google Chrome with the additional "--enable-user-stylesheet"
command line option. To make this permanent on MacOSX (why does it
always have to be more difficult on OSX ?) :
- go to "/Applications/Google Chrome.app/Contents/MacOS"
- move "Google Chrome" to "Google Chrome.r"
- edit "Google Chrome" to :

#!/bin/sh
exec /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome.r \
--enable-user-stylesheet \
--any-other-switch \
$@
Now, while waiting for the Chrome update to finish I was reminded of a
nice Virtualbox update, 3.1.2 featuring live migrations (teleportation)
and a fix for raw partition images bug on 3.1.0. Great.
:wq

Of course, you can also check this recent Chrome extension

vendredi 19 mars 2010

Le trésor de la langue française informatisé

Ça faisait un bout de temps que je cherchais sans vraiment forcer un
moyen d'accéder vite fait au fameux dictionnaire en ligne TLFI.
http://atilf.atilf.fr/tlf.htm
(Oui, c'est le trésor qui est informatisé)

Les navigateurs récents permettent de rajouter des moteurs de recherche
via une interface conviviale, un fichier de config, etc. (Chercher
'opensearch' sur wikipedia). Le soucis du TLFI, c'est que c'est un poil
vieillot et donc des gens sympas du CNRS (CNRTL précisément) ont
travaillé à monter une interface un peu plus pratique.

Pour le TLFI, utilisez donc l'adresse suivante :
http://www.cnrtl.fr/definition/%s

A l'occasion, jetez aussi un coup d'oeil au project mycroft de la
fondation Mozilla qui recense pas mal de moteurs opensearch :
http://mycroft.mozdev.org/search-engines.html?category=21

Bonne recherche.

vendredi 5 mars 2010

Oranges et lutins perdus

Chez moi, à la campagne, j'ai un abonnement ADSL Orange "réseau étendu", ce qui veut dire 512k, jusque  dans les champs ravitaillés par les corbeaux.

J'ai aussi une LiveBoite Moisie (Orange LiveBox Mini Sagem), qui potentiellement fait modem, routeur avec 2 ethernet et un AP Wifi. Rien de magique, mais c'est censé marcher facilement et efficacement.
Évidemment, ça marche mal et donc j'ai viré tous les services de la LiveBoite et installé un routeur qui à la bon goût de fournir également un proxy cache HTTP, un cache DNS, etc.
La Liveboite ne fournit pas de mode "bridge" permettant au routeur placé derrière elle d'obtenir directement une IP publique, donc le routeur est placé dans la "DMZ" de la Liveboite, avec une adresse genre 192.168.x.x ...

Comme décidément, chez Orange, ya plein de choses qui marchent mal, j'évite aussi d'utiliser leur service DNS, qui est bien plus lent qu'OpenDNS ou Google.
Malheureusement, je remarqué dernièrement que mon routeur ne voulait plus envoyer de mails via le SMTP Orange (smtp.orange.fr) avec ça dans les logs :

2010-03-05 09:04:14 1NnSW6-0005uw-Kx <= votre.adresse@email.com U=vous P=local S=1880 id=20100305080414.GH17876@email.com
2010-03-05 09:04:16 1NnSW6-0005uw-Kx ** votre.destinataire@email.com R=smarthost T=remote_smtp_smarthost: SMTP error from remote mail server after RCPT TO:: host smtp.orange.fr [193.252.22.84]: 554 5.7.1 : Recipient address rejected: Missing Authentication

Bon, il dit "Missing authentication" alors vous regardez vos logs Exim4/Postfix/whatever et bon, tout a l'air OK.
En fait, l'erreur vient de la résolution de nom ...

Avec les DNS OpenDNS / Google ou autres :

$ host smtp.orange.fr
smtp.orange.fr has address 193.252.22.84
smtp.orange.fr has address 193.252.22.86

Avec les DNS Orange :

$ host smtp.orange.fr
smtp.orange.fr has address 80.12.242.16
smtp.orange.fr has address 80.12.242.52
smtp.orange.fr has address 80.12.242.61
smtp.orange.fr has address 80.12.242.86
smtp.orange.fr has address 80.12.242.141
smtp.orange.fr has address 193.252.22.64
smtp.orange.fr has address 193.252.22.91
smtp.orange.fr has address 193.252.23.66
smtp.orange.fr has address 80.12.242.10

Il semblerait que ces adresses changent de temps en temps, donc la solution la plus simple reste de laisser le DNS Orange (celui de la LiveBoite, 192.168.1.1 par défaut) dans la config de votre routeur.
Ho, et toutes les adresses ne sont pas valides non plus, donc ça ne sert à rien d'en garder une seule.
Il faudra aussi recharger votre MTA et votre firewall pour que tout remarche correctement.

jeudi 18 février 2010

Digging out some photographies and cameras.

As I was reading about the latest Leica M9 and browsing through Leica fans pages on Flickr (check moaan for instance), I felt the need to dig through shelves and boxes for my cameras and pictures.
Here are some of them, pour le panache. "Oh! Hey! Ooooh."

Agfamatic 100 (Point&shoot)

This is the model I used and broke, as a kid. I found this model some while ago. I do not use it anymore as film is not being sold anymore. The disposable flash bulb was called the "magicube" : a little cube capable of 4 shots. Very cute. I am a bit astounded by the sharpness of my old prints. Surprisingly, in good light conditions, results were good !

Canon AE-1 P (SLR)

A friend of mine lent me this camera 10 or 15 years ago and I rarely lent it back to him over the years ! This is a fantastic, robust and dead-simple camera, for which you can easily find cheap used lenses (here 24mm, 50mm, 135mm, 50-200mm). I use it mostly for black and white portrait shooting (135mm <3).

Ricoh GRD (Point&shoot)

I bought this small, (wide angle) 24mm prime lens camera to live in my pocket. While I don't like the term "serious compact" or "expert point&shoot", it still remains a very capable and nice camera. I love how it provides easy exposure compensation, bracketing, macro ... I use it very often for close macro, landscapes, city and in-building shooting.

Nikon D90 (DSLR)

My first DSLR. Not too cheap, not professional, I love it. I bought a couple lens and now have great pleasure using it. You can't technically miss a picture with such gear : always on-focus, fast, sensitive, ...


PS : looks like Picasa is really killing the pictures with way too much compression :-/