24 octobre 2006

conversion ext2 vers ext3

Converting the / directory
First, think long and hard before deciding to convert the root directory. Ext3's primary purpose is shorter recovery from disaster rather than data loss prevention. Converting the root directory from Ext2 to Ext3 isn't difficult, but converting it back from Ext3 to Ext2 is a treacherous process fraught with problems. But, if you really must perform the Ext2 to Ext3 conversion on the root directory, here's how, assuming /dev/hda2 is mounted as the root directory and /dev/hda1 is mounted as /boot:

* Log in as root
* Edit /etc/fstab and change ext2 to ext3 on the line referencing the root directory.
* tune2fs -j /dev/hda2
* cd /boot
* mv initrd-2.4.18-26.8.0.img initrd-2.4.18-26.8.0.img.ext2
* mkinitrd initrd-2.4.18-26.8.0.img 2.4.18-26.8.0
* reboot

In the preceding, you MUST perform all the steps, including the mkinitrd, before rebooting. Failing to perform all the steps before rebooting produces a "buried shovel" where if only you could boot the machine, you could run the mkinitrd command, and if only you could run the mkinitrd command, you could boot the machine.

23 octobre 2006

changer la configuration du clavier

Changement non persistant à la volée:

terminal: loadkeys be-latin1|us|uk|...

serveur X: setxkbmap

Persistant distribution spécifique:

RHEL : system-config-keyboard
Debian: dpkg-reconfigure console-data

20 octobre 2006

Wine basics

Wine Quickstart Guide

This Quickstart Guide will help you to get Wine running. Make sure you have Wine installed. If you don't check this page on installing Wine: http://winehq.org/site/docs/wineusr-guide/getting-wine

Installing an application

In this guide I will show you how to install MS Office 97.
In order to install an application you must know the name of the file to run and the location of the file.
In this example I must run setup.exe which is loacted in /media/cdrom.
To install Office I must run the following command:

$ wine /media/cdrom/setup.exe

The application will now be installed.




Running an application

The application will be installed in a directory called .wine in your HOME directory. If your file manager doesn't show this directory make sure that it shows hidden files/directories (.wine is a hidden directory).

Office is installed in ~/.wine/drive_c/Program Files/Microsoft Office/Office
If I want to run Word I must type the following lines:

$ cd ~/.wine/drive_c/Program Files/Microsoft\ Office/Office
$ wine winword.exe




It might be a good idea to create a file that launches Word. It could look like this:

#/bin/sh
cd ~/.wine/drive_c/Program Files/Microsoft\ Office/Office
wine winword.exe

Save this as word.sh in ~/bin and make it executable by typing chmod +x word.sh
You can now start Word by typing word.sh

04 octobre 2006

wpa supplicant

Authentification wi-fi sécurisée en Linux
- apt-get install wpasupplicant et wpagui

- créer fichier de config : par exemple : /etc/wpa_supplicant.conf
(voir plus bas en fonction de la méthode utilisée)

- mettre les certificats adéquat, par exemple dans : /etc/cert/*.*
client.p12 root.pem client.pem root.der

- lancer la commande :
wpa_supplicant -d -c/etc/wpa_supplicant.conf -ieth1 -Dwext

--> se lance en mode debugg
--> pour lancer en background : -B au lieu de -d
--> -Dwext dépend du driver utilisé faire un man de wpasupplicant

- lancer la commande :
wpa_gui

--> interface pour vérifier état de connexion et donner des paramètres complémentaires


--> il peut être nécessaire de faire un dhclient eth1 pour obtenir une adresse ip

--> il peut être nécessaire de définir l'interface par défaut (eth1 au lieu de eth0)

Exemples de configuration
---------------------------------------------------------
# WPA-PSK

ctrl_interface=/var/run/wpa_supplicant

network={
ssid="MULTITELWIFI"
key_mgmt=WPA-PSK
psk="*****************"
}
---------------------------------------------------------
--> OK
---------------------------------------------------------
# WPA-EAP/TLS

ctrl_interface=/var/run/wpa_supplicant

network={
ssid="MULTITELWIFI"
key_mgmt=WPA-EAP
eap=TLS
ca_cert="/etc/cert/root.pem"
private_key="/etc/cert/client.p12"
private_key_passwd="***************"
}
---------------------------------------------------------
--> promp pour le paramètre identity
sinon, on peut mettre en dur identity="username"
---------------------------------------------------------
# WPA-EAP/TTLS

ctrl_interface=/var/run/wpa_supplicant

network={
ssid="MULTITELWIFI"
key_mgmt=WPA-EAP
eap=TTLS
ca_cert="/etc/cert/root.pem"
}
---------------------------------------------------------
--> prompt pour les paramètre identity et password
sinon, mettre en dur :
---------------------------------------------------------
# WPA-EAP/TTLS avec paramètres dans le fichier pour éviter #prompt

ctrl_interface=/var/run/wpa_supplicant

network={
ssid="MULTITELWIFI"
key_mgmt=WPA-EAP
eap=TTLS
identity="******"
password="***********"
ca_cert="/etc/cert/root.pem"
}
---------------------------------------------------------
--> OK
---------------------------------------------------------
# WPA-EAP/PEAP

ctrl_interface=/var/run/wpa_supplicant

network={
ssid="MULTITELWIFI"
key_mgmt=WPA-EAP
eap=PEAP
ca_cert="/etc/cert/root.pem"
}
---------------------------------------------------------
--> OK
---------------------------------------------------------