mercredi 25 novembre 2009

Vimtutor : un tutoriel pour apprendre à utiliser Vim

Vimtutor est sensé être pré-installé avec votre distributeur linux, mais au moment où je l'ai lancé, voici le message d'erreur

malagasy@malagasy-laptop:~$ vimtutor
The program 'vimtutor' is currently not installed. You can install it by typing:
sudo apt-get install vim-runtime
bash: vimtutor: command not found

Evidement, le premier réflexe est d'installer ce qu'on me demande, c'est à dire vim-runtime. Manque de bol, le tutoriel ne veut toujours pas se lancer. J'ai ensuite essayé d'installer vim-common, mais ce paquet était déjà installé à la base.
malagasy@malagasy-laptop:~$ sudo apt-get install vim-common
Reading package lists... Done
Building dependency tree
Reading state information... Done
vim-common is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
malagasy@malagasy-laptop:~$ vimtutor
bash: /usr/bin/vimtutor: No such file or directory

Du coup, je me suis demandé s'il ne fallait pas supprimer ces deux paquets, puis de n'installer que vim-common.
malagasy@malagasy-laptop:~$ sudo apt-get remove vim-runtime
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
vim-runtime
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
After this operation, 23.4MB disk space will be freed.
Do you want to continue [Y/n]? Y
(Reading database ... 130108 files and directories currently installed.)
Removing vim-runtime ...
Removing `diversion of /usr/share/vim/vim71/doc/help.txt to /usr/share/vim/vim71/doc/help.txt.vim-tiny by vim-runtime'
Removing `diversion of /usr/share/vim/vim71/doc/tags to /usr/share/vim/vim71/doc/tags.vim-tiny by vim-runtime'
Processing triggers for man-db ...
malagasy@malagasy-laptop:~$ sudo apt-get remove vim-common
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
ubuntu-minimal vim-common vim-tiny
0 upgraded, 0 newly installed, 3 to remove and 0 not upgraded.
After this operation, 1343kB disk space will be freed.
Do you want to continue [Y/n]? Y
(Reading database ... 128681 files and directories currently installed.)
Removing ubuntu-minimal ...
Removing vim-tiny ...
Removing vim-common ...
Processing triggers for man-db ...
malagasy@malagasy-laptop:~$ vimtutor
bash: /usr/bin/vimtutor: No such file or directory
malagasy@malagasy-laptop:~$ sudo apt-get install vim-common
Reading package lists... Done
Building dependency tree
Reading state information... Done

The following extra packages will be installed:
vim vim-runtime

Suggested packages:
ctags vim-doc vim-scripts

The following NEW packages will be installed:
vim vim-common vim-runtime

0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
Need to get 1046kB/6463kB of archives.
After this operation, 25.6MB of additional disk space will be used.
Do you want to continue [Y/n]? Y
Get:1 http://fr.archive.ubuntu.com intrepid-security/main vim-common 1:7.1.314-3ubuntu3.1 [201kB]
Get:2 http://fr.archive.ubuntu.com intrepid-security/main vim 1:7.1.314-3ubuntu3.1 [845kB]
Fetched 1046kB in 14s (70.5kB/s)
Selecting previously deselected package vim-common.
(Reading database ... 128584 files and directories currently installed.)
Unpacking vim-common (from .../vim-common_1%3a7.1.314-3ubuntu3.1_i386.deb) ...
Selecting previously deselected package vim-runtime.
Unpacking vim-runtime (from .../vim-runtime_1%3a7.1.314-3ubuntu3.1_all.deb) ...
Adding `diversion of /usr/share/vim/vim71/doc/help.txt to /usr/share/vim/vim71/doc/help.txt.vim-tiny by vim-runtime'
Adding `diversion of /usr/share/vim/vim71/doc/tags to /usr/share/vim/vim71/doc/tags.vim-tiny by vim-runtime'
Selecting previously deselected package vim.
Unpacking vim (from .../vim_1%3a7.1.314-3ubuntu3.1_i386.deb) ...
Processing triggers for man-db ...
Setting up vim-common (1:7.1.314-3ubuntu3.1) ...

Setting up vim-runtime (1:7.1.314-3ubuntu3.1) ...
Processing /usr/share/vim/addons/doc

Setting up vim (1:7.1.314-3ubuntu3.1) ...


En réinstallant le paquet vim-common, vim et vim-runtime ont été ré-installé automatiquement. Et maintenant, tout va bien.
malagasy@malagasy-laptop:~$ vimtutor



Source :
- Vim l'éditeur de texte du programmeur

Copier-coller - simulation du bouton de milieu sur un pavé tactile

Une petite astuce qui nous simplifie la vie sur une console, si on décide de s'en passer de la souris :

Shift + Ctrl + C : copier
Shift + Ctrl + V : coller

double click sur un mot : sélectionne le mot
triple click sur une ligne : sélectionne la ligne

Vous pouvez aussi déplacer la ligne ou le texte sélectionnée sans lacher la souris vers la console directement.

Par contre, pour copier les données d'une console vers un éditeur de texte, après avoir sélectionné le texte à copier :

click sur le bouton droit et gauche en même temps : pour copier dans l'éditeur de texte


J'espère que cette astuce vous serait utile

Sources :
- http://forum.ubuntu-fr.org/viewtopic.php?id=332429

mardi 24 novembre 2009

Lecture de DVD protégé

Pour la lecture de DVD protégé, il suffit :

- d'activer l'accès au dépot Medibuntu, c'est à dire d'ajouter la ligne suivante dans /etc/apt/sources.list

## medibuntu
deb http://packages.medibuntu.org/ intrepid free non-free

- d'installer les paquets suivants :

libdvdcss2
libdvdread3

- d'utiliser VLC pour lire les DVD


Source :
- http://doc.ubuntu-fr.org/lire_un_dvd

Connection avec une clé 3G

Et oui, quand on est à l'étranger, on s'attend à avoir accès au net. Et encore mieux, avec son portable. En effet, j'ai eu la surprise de voir qu'en branchant une clé 3G, j'aurai accès directement au net avec mon OS actuel qui est linux.

Tellement je suis heureux de voir que c'est possible, que je vous partage mon installation.






Comme vous avez du vous en appercevoir que j'ai acheté ma clé chez 3, je vais en profiter pour leur faire un peu de pub, si jamais un linuxien passe par l'irlande. Il y a/aura peut être meilleur tarif, mais bon!



Sources:
- Internet key 3G E160G
- Broadband from 3
- Top 5 things you need to know

lundi 17 août 2009

Erreur de lecture de fichier AVI : BadAlloc (insufficient resources for operation)

J'ai eu la petite surprise de ne pas pouvoir lire mes fichiers AVI, même en installant tout ce qu'il faut. Et oui, je ne regarde pas souvent des fichiers AVI sur mon pc :)

Voici le message que j'ai à partir d'une console :

[????????] x11 video output error: X11 request 140.19 failed with error code 11:
BadAlloc (insufficient resources for operation)
X Error of failed request: BadAlloc (insufficient resources for operation)
Major opcode of failed request: 140 (XVideo)
Minor opcode of failed request: 19 ()
Serial number of failed request: 83
Current serial number in output stream: 84
Première solution : lecteur MPlayer

Pour résoudre ce problème, il faut ajouter le fichier mplay.sh dans le dossier ~/.gnome2/nautilus-scripts. Voici ce que doit contenir ce fichier :
#!/bin/bash

INP_FILE=$1

if [ -f "$INP_FILE" ] ;then
echo NOW PLAYING .... $INP_FILE
else
if [ -d "$INP_FILE" ] ;then
echo $INP_FILE SEEMS TO BE A DIRCTORY, I NEED A FILE TO PLAY
else echo NO INPUT FILE, GIVE ME THE ABSOLUTE PATH OF FILE TO PLAY
fi
echo Exiting ... && sleep 5
exit 1
fi

mplayer -vo x11 -loop 0 -zoom -framedrop "$INP_FILE"
Il ne faut pas oublier d'ajouter les droits suivant sur ce fichier pour rendre le scrip exécutable :

chmod 755 mplay.sh

Le choix de l'emplacement du fichier est dans le but d'avoir un racourci en faisant un click droit sur le film.

Une autre solution : lecteur VLC

Ouvrez les paramètre de l'application VLC, puis de modifier les paramètres vidéo en choisissant X11 video output, sinon de choisir XVideo extension video output



Sources :
- paramètre du lecteur MPlayer
- paramètre du lecteur VLC

dimanche 19 juillet 2009

X MultiMedia System : XMMS installation sur Intrepid

Juste pour un petit rappel, que XMMS ne fait plus parti des dépots Ubuntu (et de pas mal de distribution GNU/Linux de même, mais comme toujours il y a des irréductibles :) ). Voici la procédure à suivre pour une installation simple sur Intrepid.

Dans le fichier /etc/apt/sources.list, ajouter la ligne suivante :

deb http://www.pvv.ntnu.no/~knuta/xmms/intrepid ./

Puis lancer la mise à jour suivit de l'installation de xmms:

sudo apt-get update
sudo apt-get install xmms

Vous pouvez remarquer que XMMS n'est pas dans le menu Applications>Son et Vidéo. Pour l'ajouter, je vous renvoie à mon précédent article :

Création du lanceur XMMS dans le menu audio et vidéo de GNOME

L'icône pour le menu Applications>Son que j'ai utilisé est celui de :

http://www.vipnox.net/slike/icons/players/xmms.png


Pour installer les présélections WINAMP pour l'égaliseur, il suffit d'ajouter ce fichier :
gedit ~/.xmms/eq.preset &

;
; WinAmp EQ presets for XMMS. converted by Urpo Lankinen
; Do whatever you want with these. I don't care. No warranty
; expressed or implied. (And if you blast your speakers with these.
; It's Nullsoft's fault anyway =)
;

[Presets]
Preset0=(WinAmp) Classical
Preset1=(WinAmp) Club
Preset2=(WinAmp) Dance
Preset3=(WinAmp) Full Bass
Preset4=(WinAmp) Full Bass & Treble
Preset5=(WinAmp) Full Treble
Preset6=(WinAmp) Laptop Speakers / Headphones
Preset7=(WinAmp) Large Hall
Preset8=(WinAmp) Live
Preset9=(WinAmp) Party
Preset10=(WinAmp) Pop
Preset11=(WinAmp) Reggae
Preset12=(WinAmp) Rock
Preset13=(WinAmp) Ska
Preset14=(WinAmp) Soft
Preset15=(WinAmp) Soft rock
Preset16=(WinAmp) Techno

[(WinAmp) Classical]
Preamp=-1.11022e-15
Band0=-1.11022e-15
Band1=-1.11022e-15
Band2=-1.11022e-15
Band3=-1.11022e-15
Band4=-1.11022e-15
Band5=-1.11022e-15
Band6=-7.2
Band7=-7.2
Band8=-7.2
Band9=-9.6

[(WinAmp) Club]
Preamp=-1.11022e-15
Band0=-1.11022e-15
Band1=-1.11022e-15
Band2=8
Band3=5.6
Band4=5.6
Band5=5.6
Band6=3.2
Band7=-1.11022e-15
Band8=-1.11022e-15
Band9=-1.11022e-15

[(WinAmp) Dance]
Preamp=-1.11022e-15
Band0=9.6
Band1=7.2
Band2=2.4
Band3=-1.11022e-15
Band4=-1.11022e-15
Band5=-5.6
Band6=-7.2
Band7=-7.2
Band8=-1.11022e-15
Band9=-1.11022e-15

[(WinAmp) Full Bass]
Preamp=-1.11022e-15
Band0=-8
Band1=9.6
Band2=9.6
Band3=5.6
Band4=1.6
Band5=-4
Band6=-8
Band7=-10.4
Band8=-11.2
Band9=-11.2

[(WinAmp) Full Bass & Treble]
Preamp=-1.11022e-15
Band0=7.2
Band1=5.6
Band2=-1.11022e-15
Band3=-7.2
Band4=-4.8
Band5=1.6
Band6=8
Band7=11.2
Band8=12
Band9=12

[(WinAmp) Full Treble]
Preamp=-1.11022e-15
Band0=-9.6
Band1=-9.6
Band2=-9.6
Band3=-4
Band4=2.4
Band5=11.2
Band6=16
Band7=16
Band8=16
Band9=16.8

[(WinAmp) Laptop Speakers / Headphones]
Preamp=-1.11022e-15
Band0=4.8
Band1=11.2
Band2=5.6
Band3=-3.2
Band4=-2.4
Band5=1.6
Band6=4.8
Band7=9.6
Band8=12.8
Band9=14.4

[(WinAmp) Large Hall]
Preamp=-1.11022e-15
Band0=10.4
Band1=10.4
Band2=5.6
Band3=5.6
Band4=-1.11022e-15
Band5=-4.8
Band6=-4.8
Band7=-4.8
Band8=-1.11022e-15
Band9=-1.11022e-15

[(WinAmp) Live]
Preamp=-1.11022e-15
Band0=-4.8
Band1=-1.11022e-15
Band2=4
Band3=5.6
Band4=5.6
Band5=5.6
Band6=4
Band7=2.4
Band8=2.4
Band9=2.4

[(WinAmp) Party]
Preamp=-1.11022e-15
Band0=7.2
Band1=7.2
Band2=-1.11022e-15
Band3=-1.11022e-15
Band4=-1.11022e-15
Band5=-1.11022e-15
Band6=-1.11022e-15
Band7=-1.11022e-15
Band8=7.2
Band9=7.2

[(WinAmp) Pop]
Preamp=-1.11022e-15
Band0=-1.6
Band1=4.8
Band2=7.2
Band3=8
Band4=5.6
Band5=-1.11022e-15
Band6=-2.4
Band7=-2.4
Band8=-1.6
Band9=-1.6

[(WinAmp) Reggae]
Preamp=-1.11022e-15
Band0=-1.11022e-15
Band1=-1.11022e-15
Band2=-1.11022e-15
Band3=-5.6
Band4=-1.11022e-15
Band5=6.4
Band6=6.4
Band7=-1.11022e-15
Band8=-1.11022e-15
Band9=-1.11022e-15

[(WinAmp) Rock]
Preamp=-1.11022e-15
Band0=8
Band1=4.8
Band2=-5.6
Band3=-8
Band4=-3.2
Band5=4
Band6=8.8
Band7=11.2
Band8=11.2
Band9=11.2

[(WinAmp) Ska]
Preamp=-1.11022e-15
Band0=-2.4
Band1=-4.8
Band2=-4
Band3=-1.11022e-15
Band4=4
Band5=5.6
Band6=8.8
Band7=9.6
Band8=11.2
Band9=9.6

[(WinAmp) Soft]
Preamp=-1.11022e-15
Band0=4.8
Band1=1.6
Band2=-1.11022e-15
Band3=-2.4
Band4=-1.11022e-15
Band5=4
Band6=8
Band7=9.6
Band8=11.2
Band9=12

[(WinAmp) Soft rock]
Preamp=-1.11022e-15
Band0=4
Band1=4
Band2=2.4
Band3=-1.11022e-15
Band4=-4
Band5=-5.6
Band6=-3.2
Band7=-1.11022e-15
Band8=2.4
Band9=8.8

[(WinAmp) Techno]
Preamp=-1.11022e-15
Band0=8
Band1=5.6
Band2=-1.11022e-15
Band3=-5.6
Band4=-4.8
Band5=-1.11022e-15
Band6=8
Band7=9.6
Band8=9.6
Band9=8.8

Sources :
http://salamanteri.homelinux.net/wordpress/2009/03/getting-xmms-back-to-debian/
http://www.pvv.ntnu.no/~knuta/xmms/

dimanche 5 juillet 2009

Installation de la version 3.5 de Firefox

La méthode d'installation de la version 3.5 de Firefox, après avoir téléchargé le fichier firefox-3.5.tar.bz2 sur le site officiel de Firefox, est la suivante :

cp -Rv ~/.mozilla ~/.mozilla.backup
sudo tar -jxvf firefox-3.5.tar.bz2 -C /opt
sudo mv /opt/firefox/plugins /opt/firefox/plugins.backup
sudo ln -s /usr/lib/xulrunner-addons/plugins /opt/firefox/plugins
sudo dpkg-divert --divert /usr/bin/firefox.ubuntu --rename /usr/bin/firefo
malagasy@malagasy-laptop:~$ sudo dpkg-divert --divert /usr/bin/firefox.ubuntu --rename /usr/bin/firefox
Adding `local diversion of /usr/bin/firefox to /usr/bin/firefox.ubuntu'

sudo ln -s /opt/firefox/firefox /usr/bin/firefox
Au prochain redémarrage de votre session, vous pouvez vérifier que vous avez bien la version 3.5 de Firefox.




Vous pouvez aussi installer les versions expérimentales suivantes de Firefox, au nom de Minefield pour la version 3.6, et Shiretoko pour la version 3.5.


Pour les installer, rien de plus simple :

- ajouter la ligne suivante dans le fichier /etc/apt/sources.list
deb http://ppa.launchpad.net/ubuntu-mozilla-daily/ppa/ubuntu intrepid main #pour la version 8.10 d'ubuntu
deb http://ppa.launchpad.net/ubuntu-mozilla-daily/ppa/ubuntu jaunty main #pour la version 9.04 d'ubuntu

- de rentrer la commande suivante dans une console pour avoir une clé PPA GPG de Launchpage :
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 247510BE
malagasy@malagasy-laptop:~$ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 247510BE
Executing: gpg --ignore-time-conflict --no-options --no-default-keyring --secret-keyring /etc/apt/secring.gpg --trustdb-name /etc/apt/trustdb.gpg --keyring /etc/apt/trusted.gpg --keyserver keyserver.ubuntu.com --recv-keys 247510BE
gpg: requesting key 247510BE from hkp server keyserver.ubuntu.com
gpg: key 247510BE: public key "Launchpad PPA for Ubuntu Mozilla Daily Build Team" imported
gpg: Total number processed: 1
gpg: imported: 1 (RSA: 1)

- puis de lancer l'installation de Firefox 3.5
sudo apt-get update
sudo apt-get install firefox-3.5
Pour la version 3.6
sudo apt-get update
sudo apt-get install firefox-3.6



Sources :
- site officiel de Firefox
- installation de Firefox 3.5
- installation de Firefox Shiretoko ou de Minefield