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

dimanche 31 mai 2009

Ouvrir plusieurs terminaux en même temps : Screen

Côté utilisateur, il n'y a pas vraiment grand intérêt à savoir ouvrir plusieurs terminaux sur son ordinateur personnel, à moins que l'on veuille expérimenter le côté serveur de notre OS :)

Justement, cet article est bien tombé puisqu'il vient juste après mes recherchers sur l'utilisation d'un navigateur internet sans interface graphique : lynx. Cela peut être très utile dans le cas d'un disfonctionnement du serveur graphique, qui m'arrive tout le temps à chaque fois que j'essaie d'installer le pilote de ma carte ATI :( .

Et donc, il faut avant tout installer screen

sudo apt-get install screen

Une fois l'application screen installé, il faut copier le fichier .screenrc dans le répertoire home :

cp .screenrc ~/

Le fichier .screenrc est le suivant :
#shell /bin/zsh
# config de screen par bennyben
# raccourcis avec Ctrl-x puis une touche
# ou alors Ctrl-meta-une touche, voire Shirt-Ctrl-Meta

# $Id: screenrc,v 1.8 2002/03/20 22:20:21 laz Exp $
#
# /etc/screenrc
#
# This is the system wide screenrc.
#
# You can use this file to change the default behavior of screen system wide
# or copy it to ~/.screenrc and use it as a starting point for your own
# settings.
#
# Commands in this file are used to set options, bind screen functions to
# keys, redefine terminal capabilities, and to automatically establish one or
# more windows at the beginning of your screen session.
#
# This is not a comprehensive list of options, look at the screen manual for
# details on everything that you can put in this file.
#

# ------------------------------------------------------------------------------
# SCREEN SETTINGS
# ------------------------------------------------------------------------------

startup_message off
#nethack on

#defflow on # will force screen to process ^S/^Q
deflogin on
autodetach on

# turn visual bell on
vbell on
vbell_msg " Wuff ---- Wuff!! "

# define a bigger scrollback, default is 100 lines
defscrollback 1024

# ------------------------------------------------------------------------------
# SCREEN KEYBINDINGS
# ------------------------------------------------------------------------------

# Remove some stupid / dangerous key bindings
#bind '^k'
#bind 'L'
#bind '^\'
# Make them better
#bind '\\' quit
#bind 'K' kill
#bind 'I' login on
#bind 'O' login off
#bind '}' history

#bind 'R' colon "screen -ln rlogin faui -8^b^b^b"
#bind 'P' colon "^p"

# escape ""
#escape "^xx"
#bindkey \033^b break
#
#
# ctrl-meta-insert
#
#bindkey \033^V digraph
#bindkey \033^. dumptermcap
#bindkey \033^F fit
#bindkey \033^f flow
#bindkey \033^I focus
#bindkey \033^h hardcopy

#bindkey \033^{ history
#bindkey \033^i info
#bindkey \033^m lastmsg
#bindkey \033^, license
#bindkey \033^H log
#bindkey \033^L login
#bindkey \033^M monitor
#bindkey \033^n next

#bindkey \033^N number
#bindkey \033^Q only
#bindkey \033^X other
#bindkey \033^B pow_break
#bindkey \033^D pow_detach
#bindkey \033^\ quit
#bindkey \033^<> writebuf
#bindkey \033^s xoff
#bindkey \033^q xon

#bindkey \033^x next
#bindkey \033^w prev
#bindkey \033^n next
#bindkey \033^p prev
#bindkey \033^c screen
#bindkey \033^d detach
#bindkey \033: colon
#bindkey \033? help
#bindkey \033^l clear
#bindkey \033� displays
#bindkey \033^P hardcopy
#bindkey \033^k kill
#bindkey \033^L log
#bindkey \033^m monitor
#bindkey \033� silence
#bindkey \033^t title
#bindkey \033^S split
#bindkey \033^f fit
#bindkey \033^q xon
#bindkey \033^s xoff
#bindkey \033\033[2\^ copy
#bindkey \033^k digraph
#bindkey \033^a focus up
#bindkey \033^z focus down
#bindkey \033* lockscreen

# An example of a "screen scraper" which will launch urlview on the current
# screen window
#
#bind ^B eval "hardcopy_append off" "hardcopy -h $HOME/.screen-urlview" "screen urlview $HOME/.screen-urlview"

# on Debian backspace should send char `\177':
bindkey -k kb stuff "\177"

# ------------------------------------------------------------------------------
# TERMINAL SETTINGS
# ------------------------------------------------------------------------------

# The vt100 description does not mention "dl". *sigh*
termcapinfo vt100 dl=5\E[M

# turn sending of screen messages to hardstatus off
#hardstatus off
hardstatus on
# Set the hardstatus prop on gui terms to set the titlebar/icon title
termcapinfo xterm*|rxvt*|kterm*|Eterm* hs:ts=\E]0;:fs=\007:ds=\E]0;\007
# use this for the hard status string
#hardstatus string "%h%? users: %u%?"

# An alternative hardstatus to display a bar at the bottom listing the
# windownames and highlighting the current windowname in blue. (This is only
# enabled if there is no hardstatus setting for your terminal)
#
#hardstatus alwayslastline "%-Lw%{= BW}%50>%n%f* %t%{-}%+Lw%<" # version d'avant, all�g�e avec seulement les window en cours et celle courante en jaune # et fond bleu #hardstatus alwayslastline "%{= BY}%-Lw%{= YB}%50>%n%f* %t%{= BY}%+Lw%<" # nouvelle version : # heure (avec secondes), nom de la machine en rouge, load de la machine # puis fenetres avec celle courante en jaune, le tout en fond bleu hardstatus alwayslastline "%{b kB}%{s gB}%c:%s%{b kB} %{b kR}%H %{b kB}%{s yB}%l%{b kB} %{b kB}%{rs Y}%-Lw%{BY}%50>%n%{R}%f%{B} %t%{YB}%+Lw%<" # set these terminals up to be 'optimal' instead of vt100 termcapinfo xterm*|linux*|rxvt*|Eterm* OP # Change the xterm initialization string from is2=\E[!p\E[?3;4l\E[4l\E>
# (This fixes the "Aborted because of window size change" konsole symptoms found
# in bug #134198)
termcapinfo xterm 'is=\E[r\E[m\E[2J\E[H\E[?7h\E[?1;4;6l'

termcapinfo xterm*|linux*|rxvt*|Eterm* ti@:te@

# Do not use xterms alternate window buffer (won't add lines to scrollback bfr)
#termcapinfo xterm|xterms|xs ti=\E7\E[?47l

# ------------------------------------------------------------------------------
# STARTUP SCREENS
# ------------------------------------------------------------------------------

# Example of automatically running some programs in windows on screen startup.
#
# The following will open top in the first window, an ssh session to monkey
# in the next window, and then open mutt and tail in windows 8 and 9
# respectively.
#
# screen top
# screen -t monkey ssh monkey
# screen -t mail 8 mutt
# screen -t daemon 9 tail -f /var/log/daemon.log

sorendition =s WB
msgwait 3
bell "^GBell in window %"

Pour utiliser screen, il suffit de rentrer dans une console la commande : screen.


Sur cette copie d'écran, je me suis connecté au site du zéro grâce à l'outil lynx. Pourquoi vous dites ? C'est pour avoir le cours de M@teo21 dans la même fenêtre que la console puisque je suis en train d'apprendre à utiliser linux en ce moment. C'est assez pratique, mais avec quelques inconvénient :)
Avant d'aller plus loin, je tiens à préciser ma convention d'écriture :
^a-S signifie qu'il faut appuyer sur CTRL+a puis de lâcher ces touches et d'appuyer ensuite sur S, qui est un S en Majuscule.

Et donc, comme je voulais deux écrans séparés dans la même console, il suffit de faire ^a-S.


Pour accéder au deuxième moitiée de la console, il suffit de faire ^a-TAB . Mais ce n'est pas tout, pour pouvoir rentrer des commandes dans cette partie de la console, il faut appuyer sur ^a-c, c'est la combinaison de touche qui permet de créer une console émulée.

Pour quitter screen, il faut taper ^a-d. Puis si on veut revenir à nouveau dans screen, avec les dernières informations avant de l'avoir quittée, il suffit de rentrer dans la console la commande :

screen -r

Une fois dans screen, on peut choisir la console qu'on veut utiliser, si on en a ouvert plus d'une avant d'avoir fermé l'application screen. Pour ce faire, il faut taper ^a-" puis de choisir le numéro de la console.

Une fois screen installé, j'ai installé l'application htop qui me serait utile pour connaître le numéro des processus en cours, etc. L'application htop est une version amélioré de l'application top.
J'ai aussi par la même occasion installé itop, par curiosité :)


Dans la première partie du tableau, c'est l'application htop, et dans le deuxième, l'application iftop.

Sources :
http://doc.ubuntu-fr.org/screen
site du zéro
Tutoriel video

mercredi 20 mai 2009

Navigateur en mode console : Lynx

Deux raisons m'ont poussé ou chercher un navigateur internet en mode texte:

- j'ai une très mauvaise connection internet, et je rame pour ouvrir une page, surtout que l'utilisation d'internet que je fais chez moi est juste pour aller lire les news, sans me soucier des photos, etc.
- j'ai eu des problèmes en mode graphique une fois que j'ai installé Jaunty - j'ai pas envie d'en faire un commentaire dessus - et je suis revenu à l'utilisation d'Intrepid (comme on le dit toujours, il ne faut pas se précipiter sur tout ce qui est nouveau :) )

Pour l'installation, il suffit de récupérer et d'installer le paquet lynx-cur à l'adresse suivante :

http://packages.ubuntu.com/intrepid/lynx-cur

Une fois l'installation effectuée, pour avoir les caractères accentués, il suffit juste de modifier le fichier /etc/lynx-cur/lynx.cfg,de se placer à la ligne

# Lynx (case insensitive).
# Find RFC 1345 at http://www.ics.uci.edu/pub/ietf/uri/rfc1345.txt .
#
CHARACTER_SET:iso-8859-1

Puis de remplacer iso-8859-1 par utf-8, et voila. Vous pouvez naviger tranquillement sur les pages francophones en ayant tous les accents affiché comme il le faut.

Je tiens à préciser que pour aller sur la page google, il suffit de taper dans une console : lynx Lien_internet_de_la_page





Sources :
- Package: lynx-cur (2.8.7dev9-1ubuntu1) [universe]
- Lynx : problème avec les caractères accentués
- Lynx et les accents ?