Catégorie : Astuces

Un fauteuil pour deux, sous debian

Pour remplir certaines fonctions, il existe souvent plusieurs solutions, et côté logiciel c’est pareil !

Par exemple, pour la configuration du système, on a besoin d’un éditeur de texte. Sur les distributions récentes, on trouve souvent nano, d’autres utilisent vi (ou une variante comme nvi ou vim…). Sous debian, l’éditeur par défaut s’appelle editor tout simplement.

Voyons voir ce qu’il en est:

$ which editor
/usr/bin/editor
$ ls -la /usr/bin/editor
lrwxrwxrwx 1 root root 24 mar  4 09:01 /usr/bin/editor -> /etc/alternatives/editor

On se rend compte que editor n’est pas un programme mais un lien vers un fichier du même nom dans  /etc/alternatives et si nous allions voir ce fichier, c’est lui même un lien vers le programme utilisé comme éditeur par défaut.

Pour changer celui-ci on pourrait changer le lien, mais c’est un peu brutal vu que debian fournit une commande pour le faire : update-alternatives. Évidemment pour toucher à la configuration de système, il faut être root (utiliser su ou sudo selon votre méthode favorite).

# update-alternatives --config editor

Un petit menu en mode texte vous proposera de choisir une alternative.

Voila pour les généralités, le problème se pose en particulier pour le plugin flash de firefox (enfin iceweasel) car même après avoir installé le plugin provenant de debian-multimedia, firefox s’obstine toujours à utiliser swfdec, et ce dernier ne peut pas être désinstallé sans nuire à Gnome… La solution est juste au dessus ! En fait firefox utilise le plugin flash-mozilla.so qui est lui-même une alternative. Donc:

# update-alternatives --config flash-mozilla.so
Il y a 2 alternatives fournissant « flash-mozilla.so ».

Sélection    Alternative
-----------------------------------------------
*+        1    /usr/lib/swfdec-mozilla/libswfdecmozilla.so
          2    /usr/lib/flashplayer-mozilla/libflashplayer.so

Appuyez sur Entrée pour conserver la valeur par défaut[*] ou choisissez le numéro sélectionné :2
Utilisation de « /usr/lib/flashplayer-mozilla/libflashplayer.so » pour fournir « flash-mozilla.so ».

Et le tour est joué !

Voila même si flash n’est pas libre, ce n’est pas une raison pour ne pas expliquer aux nouveaux arrivants sous debian ou ubuntu que d’aller renommer, effacer ou remplacer libswfdecmozilla.so pour que firefox joue du flash n’est pas la meilleure méthode.

Correcteur orthographique sous Vim

J’utilisais le plugin vimspell pour la correction orthographique sous Vim. Depuis la version 7 ce n’est plus nécessaire, un correcteur est inclus dans vim, en revanche les dictionnaires français ne sont pas installés par défaut (en tout cas pas sur ma debian).

Pour les installer, suivre la procédure suivante:

mkdir -p /tmp/vimspell
cd /tmp/vimspell
wget http://ftp.vim.org/pub/vim/runtime/spell/fr.utf-8.sug
wget http://ftp.vim.org/pub/vim/runtime/spell/fr.utf-8.spl
wget http://ftp.vim.org/pub/vim/runtime/spell/fr.latin1.sug
wget http://ftp.vim.org/pub/vim/runtime/spell/fr.latin1.spl
sudo cp * /usr/share/vim/vim71/spell

et voila :setlocal spell spelllang=fr ça marche!

WordPress 2.7.1 !

Now that Lenny is out, testing is moving again !

So I could upgrade my wordpress debian package to the testing version and get the 2.7.1 !

Note that my system is still running lenny (stable), this is using basic apt pinning, the more basic you can do is :

  1. add

    APT::Default-Release "stable";
    

    in /etc/apt/apt.conf (or in one file in /etc/apt/apt.conf.d)

  2. then add the tesing distrib in your source.list !

  3. Finally

    sudo aptitude update
    

    and that’s it you can install some specific packages from testing.

However to use stable, testing and unstable you have to really do the pinning !

But for testing, unstable and experimental the above method with testing as default release will works. Just because experimental has NEVER automatic upgrade.

Signed Personal Debian Repository

Hi all,

That was long, but here is my signed debian repository !

Investigations:

  • Debian Repository HOWTO mostly describes trivial repository setup.
    After some trial it appeared to me that trivial repositories cannot be signed (well at least will not be verified by atp)

  • mini-dinstall does basically only trivial repository to.

  • This article about Unofficial Debian repository describe a setup with debarchiver however this has special user, cronjob… it seamed quite complex to me

  • Basically what I wanted was like a trivial repository but secured, and the solution was on the debian wiki, it first confirm that trivial repository are not compatible with apt-secure. And it give the solution:

    Even with an “official archive”, you can create a much simpler archive than the real official one. This is explained in Debian Reference (lenny) using apt-ftparchive in apt-utils and dupload. All uploaded packages are located in a directory and no database server is needed. This may be good enough for people hosting a few packages.

Well this was good enough for me, also I’m currently not using dupload but I put the commands suggested as postupload in a script.
The update script, apt-ftparchive configuration and pgp public keys are on the root of the repository.

to use it:

#add in source.list
deb http://silicone.homelinux.org/repository/ unstable main
deb-src http://silicone.homelinux.org/repository/ unstable main

#for gpg signature verification get siliconerepositorykey.asc
# sudo apt-key add siliconerepositorykey.asc

The actual content of the repository is currently just one program: a hacked xrootconsole with ANSI color support, but this will be the subject of a next post 😉