Site perso : Emmanuel Branlard

Subsections

24. Old notes on linux

24.1 Google Earth

sudo aptitude install googleearth-package
make-googleearth-package
sudo dpkg -i googleearth_4.2.205.5730+0.5.2-1_i386.deb

24.2 Matlab : Ajouter un repertoire dans la variable PATH

Unix Systems
On a Unix computer you can set the MATLABPATH environment variable by typing something like the following at the sytem prompt (not the MATLAB prompt). Si plusieurs paths, les concatener avec ":".
export MATLABPATH=/home/share/Config/matlab
 

It doesn't seem to work, so use Matlab directly : File / Set Path ...
If you don't have writing rights, then save pathdef.m and copy it to the bin directory of matlab

24.3 Configure skype sound

Son entrant : HDAINTEL
Le plus important :
Digital input source must be digital mic 1, instead of analog input

Plus clairement:
Avec xfce4-mixer :
Onglet Capture:
	Capture et digital en mode en registrement
Onglet Options:
	MicJacMode Mic In
	Playback Source: Analog mux 1

Peut-etre : virer pulseaudio

24.4 Hacker xterm - source code

http://www.davidsimmons.com/soft/xtermhacks/
Source code :
http://invisible-island.net/xterm/xterm.php

24.5 Configurer Geany

http://marcimat.magraine.net/Geany-SVN-et-plugins-sous-Ubuntu

Transformer les caractères accentués en un coup de crayon
    * sudo aptitude install recode
    * Clic droit dans geany > format > envoyer sélection > définir une commande personnalisée
    * ajouter recode ..php
    * Puis Editer > préférences > raccourcis > format > Envoyer vers la commande personnalisée 1. Sélectionner votre raccourci... pour moi, ce sera : control+&

24.6 Telecharger les jaquettes des pistes de la liste de lecture d'amarok dans leur dossier

for ((i=0;i<`dcop amarok playlist getTotalTrackCount`;i++)) ; do echo "Traitement de : `dcop amarok player nowPlaying`" ; cp -f "$(dcop amarok player coverImage)" "$(dirname "$(dcop amarok player path)")"/"$(dcop amarok player artist)"\ -\ "$(dcop amarok player album)".jpg"" ; dcop amarok player next ; done

for ((i=0;i<`dcop amarok playlist getTotalTrackCount`;i++)) \
do echo "Traitement de : `dcop amarok player nowPlaying`" ;\
cp "$(dcop amarok player path)" "$(dcop amarok player nowPlaying)"
dcop amarok player next ;\
done;

24.7 Config souris logitech lx8 left handed

http://tuxtweaks.com/2008/09/how-to-south-paw-logitech-lx8-in-linux/
# tout d'abord la config de base de xorg.conf

Section "InputDevice"
    Identifier     "Configured Mouse"
    Driver         "mouse"
    Option         "CorePointer"
    Option      "Device" "/dev/input/mice"
    Option "Protocol" "ExplorerPS/2"
    Option "ZAxisMapping" "4 5"
    Option "ButtonMapping" "1 2 3 8 9 6 7" #RH
    # Option "ButtonMapping" "3 2 1 9 8 6 7" #LH
EndSection

# Ensuite gere l'alternance avec xmodmap dans .bashrc
# aliases for left and right handed Logitech LX8 mice
alias lhm='xmodmap -e "pointer = 3 2 1 4 5 7 6 8 9"'
alias rhm='xmodmap -e "pointer = 1 2 3 4 5 6 7 8 9"'

## faire marcher le scoll horizontal
#http://tuxtweaks.com/2008/12/update-logitech-lx8-in-ubuntu/

24.8 Mise en veille et hibernation qui plante avec cartes Nvidia

Rajouter dans la section device de /etc/X11/xorg
	Option      "NvAGP" "1"
	Option	    "NoLogo" "true"

Peut etre Modifier /etc/acpi/sleep.sh
# Ajout sinon crash on resume. Copie ligne de hibernation.sh
# Unset video posting 
unset POST_VIDEO

Si la mise en veille sur ram (suspendre) ou sur disque (hiberner) ne fonctionne pas, il est possible d'utiliser une autre méthode utilisant le paquet apt://uswsusp. 

http://www.shallowsky.com/linux/x-screen-blanking.php

24.9 Equivalent win split revolution with wmctrl - raccourcis clavier xfce

SEE MY SECTION ON TILING!!!!!! USE PYWO

Les raccourcis clavier xfce sont stockes dans :
.config/xfce4/xfconf .... shortcurts.xml

Modifier le fichier xfce
.config/xfce4/xfconf .... shortcurts.xml

sudo aptitude install wmctrl

TopLeft: 
wmctrl -r :ACTIVE: -b remove,maximized_vert,maximized_horz;wmctrl -r :ACTIVE: -e 1,83,0,664,460

TopRight: 
wmctrl -r :ACTIVE: -b remove,maximized_vert,maximized_horz;wmctrl -r :ACTIVE: -e 0,745,0,664,460

Bottom Left: 
wmctrl -r :ACTIVE: -b remove,maximized_vert,maximized_horz;wmctrl -r :ACTIVE: -e 1,83,444,664,444

Bottom Right: 
wmctrl -r :ACTIVE: -b remove,maximized_vert,maximized_horz;wmctrl -r :ACTIVE: -e 0,745,445,664,444

bottom :
wmctrl -r :ACTIVE: -b remove,maximized_vert,maximized_horz;wmctrl -r :ACTIVE: -e 0,83,445,1322,444

top :
wmctrl -r :ACTIVE: -b remove,maximized_vert,maximized_horz;wmctrl -r :ACTIVE: -e 0,83,0,1322,460

left :
wmctrl -r :ACTIVE: -b remove,maximized_vert,maximized_horz;wmctrl -r :ACTIVE: -e 1,83,0,664,886

right :
wmctrl -r :ACTIVE: -b remove,maximized_vert,maximized_horz;wmctrl -r :ACTIVE: -e 0,745,0,664,886

Middle :
wmctrl -r :ACTIVE: -b remove,maximized_vert,maximized_horz;wmctrl -r :ACTIVE: -e 0,83,0,1322,898

Modifier le fichier xfce
.config/xfce4/xfconf .... shortcurts.xml

<channel name="xfce4-keyboard-shortcuts" version="1.0">
  <property name="commands" type="empty">
    <property name="default" type="empty">
      <property name="&lt;Alt&gt;F2" type="empty"/>
      <property name="&lt;Control&gt;&lt;Alt&gt;Delete" type="empty"/>
      <property name="XF86Display" type="empty"/>
      <property name="Print" type="empty"/>
      <property name="&lt;Alt&gt;Print" type="empty"/>
    </property>
    <property name="custom" type="empty">
      <property name="&lt;Alt&gt;F2" type="string" value="xfrun4"/>
      <property name="&lt;Control&gt;&lt;Alt&gt;Delete" type="string" value="xflock4"/>
      <property name="XF86Display" type="string" value="xrandr --auto"/>
      <property name="override" type="bool" value="true"/>
      <property name="XF86AudioMute" type="string" value="aumix -v0"/>
      <property name="XF86AudioRaiseVolume" type="string" value="aumix -v+10"/>
      <property name="&lt;Control&gt;Escape" type="string" value="xfce4-popup-menu"/>
      <property name="&lt;Meta&gt;F1" type="string" value="xfhelp4"/>
      <property name="&lt;Control&gt;&lt;Meta&gt;Delete" type="string" value="xflock4"/>
      <property name="&lt;Meta&gt;F2" type="string" value="xfrun4"/>
      <property name="&lt;Control&gt;&lt;Meta&gt;Escape" type="string" value="xkill"/>
      <property name="XF86AudioLowerVolume" type="string" value="aumix -v-10"/>
      <property name="&lt;Super&gt;r" type="string" value="xterm -fa Monospace -fs 11 -fg &quot;green&quot; -bg &quot;black&quot;"/>
      <property name="&lt;Super&gt;e" type="string" value="thunar"/>
      <property name="&lt;Control&gt;&lt;Alt&gt;KP_1" type="string" value="wmctrl -r :ACTIVE: -b remove,maximized_vert,maximized_horz;wmctrl -r :ACTIVE: -e 0,0,445,644,430"/>
      <property name="&lt;Control&gt;&lt;Alt&gt;KP_9" type="string" value="wmctrl -r :ACTIVE: -b remove,maximized_vert,maximized_horz;wmctrl -r :ACTIVE: -e 0,738,0,644,430"/>
      <property name="&lt;Control&gt;&lt;Alt&gt;KP_4" type="string" value="wmctrl -r :ACTIVE: -b remove,maximized_vert,maximized_horz;wmctrl -r :ACTIVE: -e 0,0,0,644,876"/>
      <property name="&lt;Control&gt;&lt;Alt&gt;KP_2" type="string" value="wmctrl -r :ACTIVE: -b remove,maximized_vert,maximized_horz;wmctrl -r :ACTIVE: -e 0,738,445,1298,430"/>
      <property name="&lt;Control&gt;&lt;Alt&gt;KP_3" type="string" value="wmctrl -r :ACTIVE: -b remove,maximized_vert,maximized_horz;wmctrl -r :ACTIVE: -e 0,738,445,644,430"/>
      <property name="&lt;Control&gt;&lt;Alt&gt;KP_8" type="string" value="wmctrl -r :ACTIVE: -b remove,maximized_vert,maximized_horz;wmctrl -r :ACTIVE: -e 1,0,0,1298,430"/>
      <property name="&lt;Control&gt;&lt;Alt&gt;KP_7" type="string" value="wmctrl -r :ACTIVE: -b remove,maximized_vert,maximized_horz;wmctrl -r :ACTIVE: -e 1,1,0,644,430"/>
      <property name="&lt;Control&gt;&lt;Alt&gt;KP_5" type="string" value="wmctrl -r :ACTIVE: -b add,maximized_vert,maximized_horz"/>
      <property name="&lt;Control&gt;&lt;Alt&gt;KP_6" type="string" value="wmctrl -r :ACTIVE: -b remove,maximized_vert,maximized_horz;wmctrl -r :ACTIVE: -e 0,738,0,644,876"/>
    </property>
  </property>

24.10 Tip XFCE : How to include all application while switching windows

There are some hidden option with Xfce that allows the panel as well as apps like Gkrellm to be included while you switch from one window to another with the Alt+Tab shortcut.

Just edit the file ~/.config/xfce4/xfwm4/xfwm4rc and add the line below

cycle_minimum=false

24.11 Migrate from Ext3 a Ext4

% References
Inspire de : 
http://www.webstrat.fr/blog/web-technology/migrer-ses-partitions-ext3-vers-ext4-sous-linux-ubuntu

Rescue CD utilise: (il faut un version recente pour avoir le support ext4)
http://www.sysresccd.org/Sysresccd-manual-en_How_to_install_SystemRescueCd_on_an_USB-stick

% Intro
Ci-dessous comment migrer la partition systeme du format ext3 a ext4.
Pour eviter toute perte de donnee, on va d'abord tester sur une partition intermediaire, puis ensuite recommencer la meme operation, de sorte qu'on a toujours une partition avec un system complet.
(si partition home separee, idem mais moins dur)
% Step 1
Partition systeme: sda3
Avec gparted, creer une partition ext 4 aussi grande que sda3 -> ici sda9

% Step 2
Booter sur un live CD avec support ext4 et grub(sur clef USB, c'est beaucoup plus rapide!)
- monter les deux partitions
mount -t ext3 /dev/sda3 /mnt/deb3
mount -t ext4 /dev/sda9 /mnt/deb4
- copier de l'un a l'autre (v pour versatile):
rsync -av /mnt/deb3/* /mnt/deb4/
(Perso, sous mon systeme (pas le live CD), j'ai fait la copie de tous les gros repertoires de "/" sauf /sys, /proc et /dev avec la commande
cp -a /bin /boot /var /etc/ /usr /opt /lib /media/PartitionExt4
Le "-a" est important pour les liens symboliques!
Puis, sous le live CD, j'ai finalisé avec un rsync. Ca permet de continuer a bosser sur son systeme normal pendant la copie de la plupart des fichiers systemes. )

% Step 3 (Sous le live CD toujours)
- on install le grub de sda9 dans le MBR 
grub-install --root-dir=/mnt/deb4 /dev/sda
- A ce stade, si on redemarre on aura toujours le systeme precedent, car les fichiers du boot de sda9 sont identiques a ceux de sda3 et donc referent au boot de sda3 (hd0,2). Du coup, il faut modifier le fichier /mnt/deb4/boot/menu.lst et remplacer les (hd0,2) par (hd0,8) et sda3 par sda9.

% Step 4 (Sous le live CD toujours)
on modifie le /etc/fstab pour que la partition / soit bien sda9

% Step 5
- on redemarre
- au menu grub, on verifie que c'est bien le grub de sda9
- on verifie que c'est bien le systeme de sda9 qui est lance est pas celui de sda3
- une fois le system en place, on fait un update-grub.

% Step 6
Si tout marche impeccable, on recommence tout. On formatte sda3, on copie de sda9 a sda3, installe grub et fstab, redemarrage, tests, update-grub et on supprime sda9.

24.12 Fluxbox et wifi

dans le .fluxbox de home,rajouter :
nm-applet &

btw networkmanager need hal and dbus to be started.
DAEMONS=(syslog-ng !network hal dhcdbd networkmanager netfs crond ipw3945d)

24.13 WIFI, et GESTIONNAIRE DE TROUSSEAU

Avoir sa connexion wifi mais a chaque fois être obligé de rentrer le mot de passe du trousseau pour pouvoir se connecter, c'est un peu lourd, surtout quand vous êtes tout seul sur votre machine, nous allons donc automatiser tout ça grace à PAM qui gère l'authentification automatique.

Il vous faut avant tout installer ceci =>

Code:
build-essential
libtool
libglib2.0-dev
libgnome-keyring-dev
libpam0g-dev

Ensuite installez ceci pam_keyring.

Maintenant vous avez juste à configurer le fichier gdm dans /etc/pam.d/.

ajoutez à la fin du document =>

Code:
auth optional pam_keyring.so try_first_pass
session optional pam_keyring.so

24.14 Probleme gnome barre verticale - liste de fenetres

https://bugs.launchpad.net/ubuntu/+source/gnome-panel/+bug/187540

I've created patches for gnome-panel and libwnck solving this bug. Applicable for gnome-panel 1:2.22.2-0ubuntu1 and libwnck22 2.22.1-0ubuntu1 as they are in Hardy.

Dans un premier temps on telecharge les outils necessaires, les sources et paquets d'install. On placera tout ca dans le repertoire gnomepatch
Depuis le repertoire perso :
mkdir gnomepatch
cd gnomepatch
sudo apt-get install fakeroot
sudo apt-get install devscript
sudo apt-get build-dep gnome-panel
sudo apt-get build-dep libwnck
apt-get source gnome-panel
apt-get source libwnck

Ensuite,recuperer les patchs de puis le site
https://bugs.launchpad.net/ubuntu/+source/gnome-panel/+bug/187540
(je les ai gardes sur mon disque)
Detarrer paskma-patch.tar en mettant tous les fichiers dans notre repertoire gnomepatch
Il faudra peutetre modifier les fichiers si les versions sont mauvaises. Pour moi, libwnck en etait a la version 3 et non 1. 
On patch :
patch -p0 < gnome-panel-paskma.patch
patch -p0 < gnome-panel-paskma-chagnelog.patch
patch -p0 < libwnck-paskma.patch
patch -p0 < libwnck-paskma-chagnelog.patch

cd gnome-panel-2.22.2
debuild -us -uc
cd ..

cd libwnck-2.22.1
debuild -us -uc
cd ..

On installe
sudo dpkg -i *.deb

24.15 Mot de passe mise en veille

gconf-editor
Se rendre dans la branche apps > gnome-power-manager > lock
Décocher la case hibernate pour désactiver le mot de passe lors de la sortie du mode hibernation.
Décocher la case suspend pour désactiver le mot de passe lors de la sortie du mode veille.
Décocher la case gnome_keyring_hibernate pour ne pas bloquer le mot de passe du trousseau lors de la sortie du mode veille (par exemple quand on est connecté au wifi).

24.16 NetworkManager - wifi au reveil apres mise en veille ou hibernation

gconf-editor
Se rendre dans la branche apps > gnome-power-manager > general / network_sleep

24.17 Histoire de memoire vive detectee

Compiler le Kernel avec CONFIG_HIGHMEM64G=y ????
car il seblreait que 4Gb ne suffisent pas.

24.18 Debian - conseil

N'oublie pas la ligne suivante dans ton /etc/apt/sources.list de Lenny pour le multimedia:
deb http://www.debian-multimedia.org/ lenny main

http://forum.ubuntu-fr.org/viewtopic.php?id=221929&p

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

http://forum.ubuntu-fr.org/viewtopic.php?pid=1008363

24.19 Optimisation

http://ubuntuforums.org/showthread.php?t=189192&highlight=improve+performance








Emmanuel Branlard