Linux

Des pages sur le sujet… et

qq trucs en vrac

debian install sans cd

Il faut juste avoir un grub qui marche déjà, récupérer l'initrd.gz et le vmlinuz nécéssaire au 1er boot (par exemple sur http://debian.osuosl.org/debian/dists/etch/main/installer-i386/current/images/netboot/debian-installer/i386/), et ajouter dans le menu du grub qui marche (remplacer (hd0,0)/boot/newinstall/ par le bon chemin).

title  Debian Install
kernel (hd0,0)/boot/newinstall/vmlinuz root=/dev/ram0 ramdisk_size=12000
initrd (hd0,0)/boot/newinstall/initrd.gz

cf http://www.us.debian.org/releases/stable/i386/ch05s01.html.fr#boot-initrd

package pinning

Ou comment mélanger les debian stable/testing/unstable de debian en limitant les risques

  • mettre les sources etch et unstable dans le sources.list
  • créer un fichier /etc/apt/preferences qui contient
Package: *
Pin: release a=testing
Pin-Priority: 990
 
Package: *
Pin: release a=unstable
Pin-Priority: 99

d'après http://www.bxlug.be/articles/194 (vu ailleurs aussi)

⇒ et sun-java5-jdk s'installe tout seul ;-) .

Un autre lien (http://www.andesi.org/index.php?node=130) et un article intéressant sur apt-build (http://www.andesi.org/index.php?node=108).

Le apt howto http://www.debian.org/doc/manuals/apt-howto/ch-apt-get.en.html

Rmq : un attribut intéressant, le o=Debian pour préciser l'origine debian des paquets (pour les distinguer par exemple de o=dotdeb), et une commande pour voir les attributs des différentes sources :
for f in /var/lib/apt/lists/*Release; do echo "$f :"; cat $f; echo; done;

Création de paquet debian

transfert de clés gpg

Pour exporter ses clés : gpg --export -o fichier
et on récupère avec gpg --import fichier

récupérer la liste des paquets pour réinstall à l'identique

# on récupère la liste aptitude -F "%p" search ~i\!~M > liste

et sur l'autre machine on installe tous ces paquets aptitude install $(<liste) (de Gilles Mocellin via debian-user-french _ad_ lists.debian.org)

  • -F "%p" ⇒ formatage de sortie, on ne veut que les noms de paquets
  • ~i ⇒ les paquets installés
  •  !~M ⇒ mais pas les paquets automatiquement installés

(on peut mettre '~i!~M' au lieu de ~i\!~M, mais attention de ne pas quoter avec " sinon bash va interprêter le !). Cf http://doc.ubuntu-fr.org/aptitude#motifs_de_recherche_utilisation_avancee pour la syntaxe de recherche.

modif image iso

SysRq

cf http://aplawrence.com/Words2005/2005_04_13.html

The "Magic Sysrequest key" is Alt (left or right Alt key) and Sysrq (up there under Print Screen, next to F12 on most keyboards). To use it, you need to have it enabled in your kernel (CONFIG_MAGIC_SYSRQ). It usually is; if you have a file called '/proc/sys/kernel/sysrq' you have this. To ENABLE the magic functions, you need a "1" in that file. If it has 0, Alt-SysRq just returns you to the previous console you were using.

  • 'r' - Turns off keyboard raw mode and sets it to XLATE.
  • 'k' - Secure Access Key (SAK) Kills all programs on the current virtual console. NOTE: See important comments below in SAK section.
  • 'b' - Will immediately reboot the system without syncing or unmounting your disks.
  • 'o' - Will shut your system off (if configured and supported).
  • 's' - Will attempt to sync all mounted filesystems.
  • 'u' - Will attempt to remount all mounted filesystems read-only.
  • 'p' - Will dump the current registers and flags to your console.
  • 't' - Will dump a list of current tasks and their information to your console.
  • 'm' - Will dump current memory info to your console.
  • '0'-'9' - Sets the console log level, controlling which kernel messages will be printed to your console. ('0', for example would make it so that only emergency messages like PANICs or OOPSes would make it to your console.)
  • 'e' - Send a SIGTERM to all processes, except for init.
  • 'i' - Send a SIGKILL to all processes, except for init.
  • 'l' - Send a SIGKILL to all processes, INCLUDING init. (Your system will be non-functional after this.)
  • 'h' - Will display help (actually any other key than those listed above will display help. but 'h' is easy to remember :-)

If you have this enabled, it can be useful in the case where the system has escaped your control and nothing else is working. The following sequence may be better than just hitting the power button:

  • Alt+SysRq+s - sync the disk
  • Alt+SysRq+e - try to nicely kill processes (wait a little bit here)
  • Alt+SysRq+i - no more mister nice guy
  • Alt+SysRq+u - unmount disks (wait a bit here, too)
  • Alt+SysRq+b - reboot

I can remember that with "So Everything Is Unusual - Boot!"

Un billet sur le mirroring de dépots (ubuntu, mais idem pour debian), pour une install ailleurs sans adsl : http://blog.racoon97.net/index.php?2007/04/07/90-installer-ubuntu-sans-connexion-internet-a-partir-des-depots-sur-un-disque-dur-externe

Raccourcis clavier

Mac OS X

  • | → shift + alt + L
  • { → alt + (
  • [ → alt + shift + (
  • \ → alt + shift + :

Le reste sur http://www.prendreuncafe.com/blog/post/2007/05/19/Petit-pense-bete-des-raccourcis-Mac-OS-X

screen

iptables

tunnel ssh

ssh -f -N -L $localPort:$destServer:$destPort $user@$sshServer (souvent, $sshServer et $destServer sont identiques, mais c'est pas obligé, et c'est même pratique pour rerouter un port vers une machine sur laquelle on a pas de compte ssh)

Pour garder la connexion active, même sans traffic, ssh -o ServerAliveInterval=300 -f -N -L $localPort:$destServer:$destPort $user@$sshServer (envoie un ~ping toutes les 5min).

label disques

  • donner un label à une partition : tune2fs -L monlabel /dev/hda1
  • monter d'après le label dans fstab : LABEL=monlabel (à la place de /dev/… ou UUID=…)

nb montages avant check disque

  • check tous les 90 mounts ou 3 mois (le 1er qui arrive) tune2fs -c 90 -i 3m /dev/hda1.
 
linux/start.txt · Dernière modification: 06/12/2008 10:39 par daniel