!
!
!
!
!
!
!
!

Préambule
Ceci est un dépotoir d’informations surtout pour moi (je ne connais pas bien Linux (et en particulier RedHat)
System
Le commentaire pour /etc/fstab est bien le caractère #.
HD
Formater une partition
mkfs -t ext3 /dev/hdc5
mkfs -t /dev/hdc1      dos
mkfs -t swap    /dev/hdc2
mkfs -t ext2 -j /dev/hdc3
HD - jaguar
J’ai un nouveau disque avec une nouvelle distrib RH.
/dev/hda1 /boot
/dev/hda2 /
/dev/hda3 – swap
/dev/hda4 – extended
J’ai ajouté dans la /hda4
Mkfs –t ext3 /dev/hda5
Mkswap –c /dev/hda6
Mkfs –t ext3 /dev/hda7
Mkfs –t ext3 /dev/hda8
Mkfs –t ext3 /dev/hda9
Mkfs –t ext3 /dev/hda10
Mkswap –c /dev/hda11
Label
Je vois dans /etc/fstab des champs de type LABEL=/repertoire
man fstab:
       Instead of giving the device explicitly, one may  indicate
       the (ext2) filesystem that is to be mounted by its UUID or
       volume label (cf.  e2label(8)), writing  LABEL=
Pour moi nommer les partitions permet de déplacer les disques sans modifier /etc/fstab. Je définis les labels avec e2label car de cette façon, e2fsck (aka fsck.ext2) les affiche à la place des /dev/hdxx, ce qui me permet de suivre plus facilement les incidents disque et les taux de fragmentation.
Apache




(Voir aussi Apache Documentation)
Perl
Perl –MCPAN –e shell
install Bundle ::CPAN
reload cpan
Samba
Immédiatement après une installation fraîche de Linux, je désire avoir un directory WIN2K partagé par les deux machines  Linux (ZEBRA et JAGUAR):
# mkdir /winpub - c'est tout dont il a besoin step 0
C’est dans ce directory qu’on va coller un disque WIN2K
export USER=oracle
export PASSWD=xxxx
smbmount //fatboy/w$  /winpub uid=oracle rw  
Ou xxxx est le password de connexion de l’utilisateur oracle WIN2K.
Modification dans /etc/samba/smb.conf, et redemarrer: /sbin/service smb.
[global]
netbios name  = zebra  
smb, nmb
VNC
Download (je prends su RPM), installer.
Pour avoir un vrai bureau X, modifier les paramètres dans .VNC dans les divers homes.
NTP
redhat-config-date
Machine
Find /etc –exec grep –l “zebra” {} \;
Le nom de la machine figure (pour moi) dans:
/etc/sysconfig/network, /etc/samba/smb.conf,
Shell
Modifier le texte OFS2 en OFS3 dans les fichiers (*.trc) présents dans le répertoire.
$ find . -depth -iname *.trc -print | while read name ; do   
   cp -v $name $name.bak;   sed s'/OFS2/OFS3/g' $name.bak > $name; 
done
aliases
(in /etc/profile or $HOME/.bash_profile)
alias rm="rm -iv" alias cp="cp -iv" alias mv="mv -iv" alias chown="chown -v" alias chgrp="chgrp -v"
shortcuts
alias hid="ls -a1 | grep \"^\\.\""alias startx="startx -- -bpp 16"alias vcd="xreadvcd | mtv - &"
Fichiers

Partitionnement
Pour partitionner un disque en fonction d’un partitionnement existent (cloner) :
1) Sauvegarder la configuration :
[root@zebra root]# sfdisk -d /dev/hdb > /tmp/partition.diskb
[root@zebra root]# cat /tmp/partition.diskb
# partition table of /dev/hdb
unit: sectors
/dev/hdb1 : start=       63, size=   208782, Id=83, bootable
/dev/hdb2 : start=   208845, size= 20482875, Id=83
/dev/hdb3 : start= 20691720, size=  4080510, Id=82
/dev/hdb4 : start=        0, size=        0, Id= 0
[root@zebra root]#
2) La reprendre sur une autre machine:
Utiliser l’excellent script (clone.sh) (http://lists.progeny.com/archive/progeny-debian/200105/msg00124.html)
Etapes post-installation RH8
Pendant l’install
  • Diskette de demarrage
Oui, j’en fais une, vu que j’ai trois disques et que je ne sais pas ce que peut arriver.
  • Ecran
Pour un EIZO FlexScan L565 : Eizo Analog: H: 24.8 – 80 kHz, V: 50 – 75 Hz kHz
Color Depth : High Color (16 Bit), 1280x1024 (Test Setting)
  • Enregistrement RedHat
Faites-le, au moins pour une configuration ;-)
Jettez un coup d’œil au /etc/fstab
Automatisation du lancement au lancement

/sysop/postinstalllinux.sh

#!/bin/sh -f
# 755
# 
# Rendre un rep Windows visible immediatement apres 
#                                   l'install linux 
# A faire sous root
# Radu Caulea, TAFORA
#
mkdir /sysop
mkdir /admin                 # rep de montage
adduser    administrateur    # utilisateur windows
passwd     administrateur
smbpasswd  -a administrateur
adduser    oracle
passwd     oracle
smbpasswd  -a oracle
export USER=oracle
export PASSWD=oracle
smbmount //fatboy/linux  /admin uid=oracle rw  
/etc/rc.d/init.d/smb start # pour que le poste NT voie /home/administrateur

/sysop/scr/bootsysop

#!/bin/sh 
# Startup automatique du (des) script(s) initial(ux)
# -------------------------------------------------
# Copyright 2002 TAFORA 
# Source function library.
if [ -f /etc/init.d/functions ] ; then
 . /etc/init.d/functions
elif [ -f /etc/rc.d/init.d/functions ] ; then
 . /etc/rc.d/init.d/functions
else
 exit 0
fi
 export ORACLE_BASE=/taf/oracle 
 export ORACLE_HOME=/taf/oracle/920 
 export ORACLE_OWNER=oracle
 export ORACLE_TERM=xterm 
 export TNS_ADMIN=$ORACLE_HOME/network/admin
 export NLS_LANG=french_france.WE8ISO8859P15 
 export ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data 
 LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib 
 LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib export LD_LIBRARY_PATH 
 case "$1" in
 "start") # start div
 echo "Demarrage des divers choses"
 /sysop/scr/sysopboot.sh
 ;;
 "stop") # Stop div
 echo "Arret des divers choses"
 /sysop/scr/sysopreboot.sh
 ;;
esac

/sysop/scr/sysopboot.sh

#!/bin/sh -f
#
# start everything
#
cd /sysop/scr
#./serveurvnc.sh
./sambastart.sh
./sambawin.sh

/sysop/scr/sysopreboot.sh

#!/bin/sh -f
#
# start everything
#
cd /sysop/scr
./sambastop.sh
./sambawinstop.sh

/sysop/scr/sambastrart.sh

#!/bin/sh -f
echo "== ------------------------ =="
echo "   Demarrer les services samba"
/etc/rc.d/init.d/smb start

/sysop/scr/sambastop.sh

#!/bin/sh -f
echo "== ------------------------ =="
echo "   Demarrer les services samba"
/etc/rc.d/init.d/smb stop

/sysop/scr/sambawin.sh

#!/bin/sh -f
# 755
# 
echo "== ------------------------ =="
echo "   Demarrer le contact winpub "
export USER=oracle
export PASSWD=oracle
smbmount //fatboy/linux  /admin uid=oracle rw  

/sysop/scr/sambawinstop.sh

#!/bin/sh -f
# 755
# 
echo "== ------------------------ =="
echo "   Briser le contact winpub "
smbumount /admin

Automatisation du lancement au lancement

C’est l’automatisation effective. Lancer mksysoplinks.sh apres avoir copié bootsysop.sh dans /etc/rc.d/init.d
#!/bin/sh
# -------------------------------------------------
# Copyright 2002 TAFORA
cd /etc/rc.d/rc0.d
rm K10bootsysop
ln -s ../init.d/bootsysop K10bootsysop
cd /etc/rc.d/rc1.d
rm K10bootsysop
ln -s ../init.d/bootsysop K10bootsysop
cd /etc/rc.d/rc2.d
rm K10bootsysop
rm S99bootsysop
ln -s ../init.d/bootsysop K10bootsysop
ln -s ../init.d/bootsysop S99bootsysop
cd /etc/rc.d/rc3.d
rm K10bootsysop
rm S99bootsysop
ln -s ../init.d/bootsysop K10bootsysop
ln -s ../init.d/bootsysop S99bootsysop
cd /etc/rc.d/rc4.d
rm K10bootsysop
rm S99bootsysop
ln -s ../init.d/bootsysop K10bootsysop
ln -s ../init.d/bootsysop S99bootsysop
cd /etc/rc.d/rc5.d
rm K10bootsysop
rm S99bootsysop
ln -s ../init.d/bootsysop K10bootsysop
ln -s ../init.d/bootsysop S99bootsysop
cd /etc/rc.d/rc6.d
rm K10bootsysop
ln -s ../init.d/bootsysop K10bootsysop
Diskette de boot
$ uname –r
et
mkbootdisk 2.4.18-4
Telnet
Pour l’avoir, l’allumer ;-) (services, etc)
Afficher ailleurs
Si vous avez quelque part un display X, envoyez le toutim ailleurs ;-)
xterm -display 192.168.0.3:0.0 &
cat /usr/share/config/kdm/kdmrc
[Xdmcp]
# Whether KDM should listen to XDMCP requests. Default is true.
Enable=true
cat /etc/X11/gdm/gdm.conf
[xdmcp]
# Distributions: Ship with this off.  It is never a safe thing to leave
# out on the net.  Alternatively you can set up /etc/hosts.allow and
# /etc/hosts.deny to only allow say local access.
Enable=true
Up2date
Le certificat SSL de RedHat a expiré en fin août. Prendre chez eux
(https://rhn.redhat.com/help/latest-up2date.pxt)
  • up2date-3.0.7.2-1.i386.rpm
  • up2date-gnome-3.0.7.2-1.i386.pxt
Et ensuite:
rpm -Uvh up2date-*.rpm 
Redirection
Commande Que faire Httpd kill -TERM `cat /usr/local/apache/logs/httpd.pid` /etc/rc.d/init.d/httpd restart This command finds all the files and removes them. The slash is to escape the semicolon. we don't want the semicolon to be taken as a command seperator. (it's a command delimitor for the parameter -exec). This command finds and removes all files and executes ls. Find only regular files (not directories, sockets, etc). Find patterns 'foo' in all files starting from the current directory(.). List full pathnames of files in directory dirname.
Job control
Command Explanation Example Explanation Redirect stdout to file ls > myfiles Send stdout from the ls command to the file "myfiles" Redirect stdin to file cat < myfiles Use the contents of the file "myfiles" as stdin Append stdout to file echo "My file list" >> myfiles Append the line "My file list", which is stdout from the echo command, to the file "myfiles" Pipe stdout from one command to stdin for the next command ls | grep my Use stdout from the ls command as stdin for the grep command Redirect stderr to /dev/null grep My ./* 2>/dev/null Send stderr from the grep command to /dev/null Redirect stderr to stdout grep My ./* >outfile 2>&1 Send stderr from the grep command to stdout, send stdout to the file "outfile" stdin stdout stderr
Command Meaning Explanation Stop job Freeze job. Don't kill it. Job kan be put in forground or background afterwards. Break Break/kill running command Logout/exit Exit current shell, or finish typing interactive command
Configurer le réseau redhat-config-network
Stats
Command Syntax Example Explanation jobs jobs Displays job number and current state of jobs bg %jobnumber bg %1 Put job with the given number in the background fg %jobnumber fg %3 Put job with the given number in the foreground command & emacs & Start the job (here emacs) in the background
Compteur

Copyright © 1998-2002 Radu Caulea, TAFORA MAJ 06/11/2006 !
Commentaires et suggestions radu[CHEZ]tafora.fr