Autres
AideEnLigne
CahierDeBrouillon
Présentation
Administration

MesLectures
[Articles publiés]
[Blog Affordance]
[LibreOffice en ligne]
[Journal d'Ophelia]
[Kim Khal]

Informations
[Rue 89]

DNS etc
[Robtex]
Logins
Votre ID: 111
Nom:
Login utilisateur
Mot de passe éditeur

ComputingUnixLinux

+Btrfs Storage Pools management, Subvolumes And Snapshots on Linux
+clavier changer (fr us, ..) sous Linux
  • Si serveur X : setxkbmap fr
  • si pas de serveurs X : loadkeys fr

  • clavier console fr: Install de Wheezy ok, mais clavier qwerty. Arghh 2014-05-21 16:23:11
    • loadkeys fr ne fonctionne pas
    • dpkg-reconfigure keyboard-configuration : pas glop
    • apt-get install console-setup ; clavier fr OK
+click on Youtube and read on VLC
  1. Install VLC
  2. Install youtube-dl
  3. vlc $(youtube-dl -g $1) &
+divers liens Unix & Linux
How to reboot Linux the hard way in case of awry filesystem: echo b > /proc/sysreq-trigger
lots of Xwinows aplpicatin [games, calc emulators, etc] http://cyber.dabamos.de/unix/x11/
xtra Xwindows server for Windows and Linux. [x11 w/ tmux behaviour] https://github.com/Xpra-org/xpra/wiki/Download
vcxsrv Xwindows server for windows https://sourceforge.net/projects/vcxsrv/
xming Xwindows server for windows https://sourceforge.net/projects/xming/
Xwindows & Xming troubleshooting debugging http://www.straightrunning.com/XmingNotes/trouble.php
Cockpit: Linux administration thru Web browser https://cockpit-project.org/
Free books [computer, OSs, Network, Languages, ..] https://b-ok.cc/
Unix & Linux Free books http://freecomputerbooks.com/unixCategory.html
GNU/Linux? Free pdf books http://cfajohnson.com/computers/pdflinks.shtml
Linux Device Drivers [book] http://www.xml.com/ldd/chapter/book/index.html
YaoFeng?'s books http://octopus.cdut.edu.cn/~yf17/
Cgroups explained in 4 articles https://www.redhat.com/sysadmin/cgroups-part-one
How pipes are implemented: an article https://toroid.org/unix-pipe-implementation
Unix commands toolbox [html or pdf version] http://cb.vu/unixtoolbox.xhtml
Kolibrios tiny (27MB) Linux-like OS https://kolibrios.org/en/
Character by character TTY input in Unix https://utcc.utoronto.ca/~cks/space/blog/unix/
Install Linux applications in a snap https://flathub.org/home
How an Intel CPU boots https://binarydebt.wordpress.com/2018/10/06/how-does-an-x86-processor-boot/
inside booting in 6 episodes
https://github.com/0xAX/linux-insides/blob/master/Booting/linux-bootstrap-1.md
https://github.com/0xAX/linux-insides/blob/master/Booting/linux-bootstrap-2.md
https://github.com/0xAX/linux-insides/blob/master/Booting/linux-bootstrap-3.md
The kernel boot process (2009) https://manybutfinite.com/post/kernel-boot-process/
Memory translation and segmentation (2009) https://manybutfinite.com/post/memory-translation-and-segmentation/
Anatomy of a program in memory (2009) https://manybutfinite.com/post/anatomy-of-a-program-in-memory/
carte interactive du kernel avec liens vers le code source http://www.makelinux.net/kernel_map/
Linux AuFS? Union File System http://www.thegeekstuff.com/2013/05/linux-aufs/
Guix package manager https://www.gnu.org/software/guix/
Guix for Fedora, Debian, CentOS? https://matutine.gitlab.io/2016/09/26/gnu-guix-dans-un-environnement-de-supercalculateurs.html
CDE to package an aplication for any linux http://www.pgbovine.net/cde.html
Partition image for Linux http://www.partimage.org/
Encore un tutorial chroot http://karma-lab.net/magie-chroot
Kopia backup w/snapshots [widows, linux, ..] https://kopia.io/
incremental backup with tar https://ops.tips/blog/incremental-backup-linux/
zpaq backup for windows, Linux, etc. http://mattmahoney.net/dc/zpaq.html
bup a backup git based for Linux https://github.com/bup/bup
Bareos backup [network & clients] https://docs.bareos.org/
backup tools : rdiff-backup, rsync, rsnapshot, duplity etc. http://maniatux.fr/index.php?article486/sauvegarde-rsync-avec-roulement-de-3-jours
RAM-only PXE boot & the "smallest" diskless Linux box TFTP PXE http://eduardo-lago.blogspot.fr/2012/06/ram-only-pxe-boot-smallest-diskless.html
imaging solution with TFTP PXE: FOG project http://www.fogproject.org/?q=node/1
old Suse versions ftp://ftp5.gwdg.de/pub/linux/suse/discontinued/
gamin to monitor file and directories access https://people.gnome.org/~veillard/gamin/
Sysdig to debug/trace a process http://www.sysdig.org/ (see also Systemtap, Dtrace, Dprobes, strace, ..)
Care soft : to reproduce soft environment http://reproducible.io/
Docker articles (a lire)
The Unix Heritage Society [old version of Unix PDP11, ..] http://www.tuhs.org/
Cluster Debian avec DRBD et GFS2 http://www.unixgarden.com/index.php/gnu-linux-magazine/cluster-debian-avec-drbd-et-gfs2-2#1-ap%C3%A9ritif
Deprecated linux networkin commands [iproute2, ip command] https://dougvitale.wordpress.com/2011/12/21/deprecated-linux-networking-commands-and-their-replacements/
Boot EFI UEFI: voir ComputingWindows et boot EFI
GPT, UEFI, GUID Partition table http://fr.wikipedia.org/wiki/GUID_Partition_Table
undelete files under ext3 extgrep http://carlo17.home.xs4all.nl/howto/undelete_ext3.html
undelete files under ext3 & ext4 extundelete http://extundelete.sourceforge.net/
Gluster distributed file system http://www.gluster.org/
CEPH distributed file system http://ceph.com/
CEPH ; NFS over RBD http://www.sebastien-han.fr/blog/2012/07/06/nfs-over-rbd/
Small Linux PC overview http://raymii.org/cms/p_Small_Linux_PCs_overview
Trouble-Maker: a linux training tool http://trouble-maker.sourceforge.net/
Unix Rosetta stone for SysAdmin? http://bhami.com/rosetta.html
How to install Beowulf [bootp, replication, http://www.traduc.org/docs/HOWTO/vf/Beowulf-HOWTO.htm
Linux Kernel Virtual Machine KVM http://www.linux-kvm.org/page/Main_Page
FUSE http://fuse.sourceforge.net/
Linux on line applications http://www.linux.org/apps/index.html
Terminal Server Client http://www.gnomepro.com/tsclient/
Linux Virtual Server http://www.linuxvirtualserver.org/
Partition image http://www.partimage.org/
Virtual Linux (to be updated) http://prdownloads.sourceforge.net/virtual-linux
Trinux http://www.trinux.org/
Tommsrtbt http://www.toms.net/rb/
WuFTPD? FAQ http://www.wu-ftpd.org/wu-ftpd-faq.html
How much Linuw Swap ? http://www.linux.com/news/software/applications/8208-all-about-linux-swap-space
USB Video Class Linux device driver http://linux-uvc.berlios.de/
File system in user space http://fuse.sourceforge.net/
Linux Soft RAID hosto http://gmauleon.org/french/main.php?menuItem=Howtos&tabItem=Linux-SoftRaid
Undelete under Linux w/ fsdebug http://www.ibiblio.org/pub/Linux/docs/HOWTO/Ext2fs-Undeletion
UNIX Administration Hints & tips http://www.sap-basis-abap.com/unix/index.htm
Burn CDROM http://burn-cd.sourceforge.net/
Cours Linux. Applis Linux pour l'Enseignement http://www.ac-creteil.fr/reseaux/systemes/linux/
Kernel 2.4 internals http://www.traduc.org/docs/guides/lecture/lki/lki.html#id2498292
Linux Kernel Hacking http://lwn.net/
Linux Kernel internals http://www.science.unitn.it/~fiorella/guidelinux/tlk/node5.html
User Filesystem [virtual file system] http://fuse.sourceforge.net/
RPM repository http://rpmfind.net/linux/rpm2html/search.php?
Gzip recovery Toolkit http://www.urbanophile.com/arenn/hacking/gzrt/gzrt.html
Linux Foomatic [CUPS etc.] http://www.linuxprinting.org/foomatic.html
Linux Soft distribution http://www.linuxsoft.cz/en/
Webmin guide http://www.swelltech.com/support/webminguide/
SUSE Linux website http://portal.suse.com/sdb/en/2001/03/lmuelle_suselinux_internet.html
ACL
Linux extended attributes and ACLs http://acl.bestbits.at/
Mise en oEUvre et utilisation http://www.linuxfrench.net/gnu_linux/comment_fonctionnent_les_acl_posix_sous_linux..._article1463.html
Linux ACLs and inheritance http://www.suse.de/~agruen/acl/linux-acls/online/
Linux ACL article 1 http://lwn.net/1999/1007/kernel.php3
Linux ACL article 2 http://lwn.net/1999/0715/a/ext2ACL.html
RPM Bone net http://rpm.pbone.net/index.php3/stat/11/limit/18/dl/40/vendor/922/com/Freshrpms_net.html
How to configure LINUX + ADSL http://linux.gegeweb.net/adsl-pppoe_1.html#h1
G4U Harddisk image cloning http://www.feyrer.de/g4u/
Linux extended attributes and ACLs http://acl.bestbits.at/
Linux on line applications http://www.linux.org/apps/index.html
Linux Ipchains http://www.rustcorp.com/linux/ipchains/
Linux Kernel Hacking http://lwn.net/
Linux Router Project (dead) http://www.linuxrouter.org/
Terminal Server Client http://www.gnomepro.com/tsclient/
Linux Virtual Server http://www.linuxvirtualserver.org/
Partition image http://www.partimage.org/
Scyld Beowulf cluster http://www.scyld.com/
Virtual Linux (to be updated) http://prdownloads.sourceforge.net/virtual-linux
Trinux http://www.trinux.org/
Tommsrtbt http://www.toms.net/rb/
WuFTPD? FAQ http://www.wu-ftpd.org/wu-ftpd-faq.html
Apache How to chroot Apache under Linux & Solaris http://penguin.triumf.ca/chroot.html
Nginx security [hints] https://blog.jbriault.fr/security-nginx/
+Debian & Mint installations & docs
systemd docs
Writing daemons with systemd http://0pointer.de/public/systemd-man/daemon.html#New-Style%20Daemons
Writing systemd units article http://hokstadconsulting.com/devops/writing-systemd-units

 prompt> systemd-analyze time            # boot time total
 prompt> systemd-analyze blame           # services starting time
 prompt> systemd-analyze critical-chain  # where max boot time is
 prompt> journalctl -b -u NetworkManager?.service #analyze logs of a service

Debian Mise a jour sécurité

 #aptitude update
 #aptitude full-upgrade

Ou bien apt-get update suivi de apt-get dist-upgrade

avec nettoyage éventuel des paquets ...

 #aptitude clean

Mettre a jour un seul paquet (ex: wpasupplicant)

 #apt-get update
 ...
 #apt-get install --only-upgrade wpasupplicant


Debian recovering from forgetted root password

  • Boot into grub, select single user but do not press enter.
  • Press e to go into edit mode.
  • Scroll down to the kernel line you will boot from, it starts with "linux /boot/vmlinuz-……."
  • Scroll to the end of that line and press space key once and type init=/bin/bash.
  • Press Ctrl X to boot.
  • mount -o remount, rw /
  • passwd (and type new root passwd
  • sync
  • type ^D to reboot

Install minidlna sous systemd
Sous Debian 8 (Jessie), ajout du fichier pour systemd
 #cat /etc/systemd/system/minidlna.service
 [Unit]
        Description=Minidlna service
        Documentation=man:minidlnad(1)
 [Service]
        Type=forking
        ExecStart?=/usr/bin/minidlnad -f /etc/minidlna.conf -u minidlna
        PIDFile=/var/run/minidlna/minidlna.pid

Ensuite, démarrer minidlna (par defaut, minidlna.service) et stop pour arrêter :

 #systemctl start minidlna

2016-11-10 12:12:52


reconfigurer/voir la config d'un package debian

Ex: reconfigurer la locale :

 #dpkg-reconfigure locale

Ex: voir comment est configuré le package tzdata :

 #debconf-show tzdata

Voir aussi debconf(7)


Choisir xfce

  • A l'installation, taper sur Tab et ajouter a la fin de la ligne de commande desktop=xfce
ou bien choisir le menu "Advanced options" puis "Alternate desktop environments", et choisir Xfce

When prompted to select the task to install, make sure you click "Desktop Environment"

  • Sinon, en fonctionnement, supprimer Gnome et installer Xfce4

cf https://wiki.debian.org/Xfce#Run_Xfce

2014-02-26 14:17:53 -- Cmic


Debian WiFi?

Sur Wheezy, petit probleme d'install de la carte Interl 2100 FIXME : Il faut chargerle microcode (firmware), soit à l'install soit après : le Dell D600 réclame le microcode ipw2100-1.3.fw et tigon/tg3_tso5.bin (??)

Voir http://wiki.debian.org/fr/ipw2200 (pour le firmware Intel 2100/2200)
Voir http://wiki.debian.org/fr/WiFi/HowToUse (pour la config. wifi)
Minimalistic WiFi? Wireless Networking With systemd and wpa_supplicant https://chiraag.nataraj.us/wireless/

autres sources de packages
En principe plus rapide.. Remplacer http://ftp.us.debian.org/debian/ par http://mirrors.linode.com/debian/ dans le fichier /etc/apt/sources.list
Installation de Mint sur un portable ASUS P2 520LA-XO0456T (by Seb Sauvage)

upgrade debian

  • from jessie 8 to stretch 9 il faut aussi

 apt install debian-archive-keyring

  1. backup /etc, /var/lib/dpkg, /var/lib/apt/extended_states and the output of dpkg --get-selections "*" (the quotes are important). If you use aptitude /var/lib/aptitude/pkgstates.
  2. the upgrade process must not be done under X11 (or should fail...). Use no graphic screen instead
  3. make sure all packets are in upgradable state dpkg -audit

no packet is half-installed : aptitude -> g to install what is planned to be installed

+GPT vers MBR et inversement
Je profite d'un HD externe de 1 TB pour expérimenter quelques manips autour des tables de partition GPT et MBR.

Le disque original est en GPT et est lisible sous Windows7 mais pas lisible sous Windows XP, ce qui est normal. Sous Windows XP, je pourrais utiliser diskpart pour le convertir en partition MBR, mais je préfère utiliser des commandes UN*X

A chaque changement de type de partitionnement, je formate la partition en NTFS avec: "mkntfs -f /dev/sdb1", je monte le disque, je copie des fichiers sur ce disque, je le démonte et le teste sous Windows XP et sous Windows 7. Et je donne le résultat.

+verifier que le HD est en GPT

 root@zazou:/home/cmic# gdisk -l /dev/sdb
 GPT fdisk (gdisk) version 1.0.1

 Partition table scan:
   MBR: protective
   BSD: not present
   APM: not present
   GPT: present

 Found valid GPT with protective MBR; using GPT.
 Disk /dev/sdb: 1953458176 sectors, 931.5 GiB?
 Logical sector size: 512 bytes
 Disk identifier (GUID): FC728B84-0C4B-455F-9DC7-6DBBBC36327F
 Partition table holds up to 128 entries
 First usable sector is 34, last usable sector is 1953458142
 Partitions will be aligned on 2048-sector boundaries
 Total free space is 4029 sectors (2.0 MiB?)

 Number  Start (sector)    End (sector)  Size       Code  Name
   1            2048      1953456127   931.5 GiB?   0700  primary
 ...

NB la partion "MBR: protective" est placée là par sécurité, pour qu'un OS reconnaisse une MBR non effective !

+GPT -> MBR avec gdisk

Supprimer la partition GPT avec gdisk

 prompt# gdisk /dev/sdb
 GPT fdisk (gdisk) version 1.0.1

 Partition table scan:
  MBR: protective
  BSD: not present
  APM: not present
  GPT: present

 Found valid GPT with protective MBR; using GPT.

 Command (? for help): x

 Expert command (? for help): z
 About to wipe out GPT on /dev/sdb. Proceed? (Y/N): Y
 GPT data structures destroyed! You may now partition the disk using fdisk or
 other utilities.
 Blank out MBR? (Y/N): Y
 ...
 w
 quit
 prompt#partprobe /dev/sdb

NB: Il est important dans notre cas de "Blanker" la partition MBR pour qu'elle n'intervienne plus dans l'étape fdisk (ou cfdisk) ci-dessous

+création d'une partition avec fdisk

 root@zazou:/home/cmic# fdisk /dev/sdb

 Bienvenue dans fdisk (util-linux 2.29.2).
 ...
 Le périphérique ne contient pas de table de partitions reconnue.

 Commande (m pour l'aide) : p
 Disque /dev/sdb : 931,5 GiB?, 1000170586112テつ octets, 1953458176 secteurs
 Unité : secteur de 1 à 512 = 512 octets
 Taille de secteur (logique / physique): 512 octets / 512 octets
 taille d'E/S (minimale / optimale) : 512 octets / 512 octets
 Type d'étiquette de disque : dos
 Identifiant de disque : 0x7431b2ea

 Commande (m pour l'aide) : n
 ..
 primary
 1 
Prendre les valeurs par default, c'est a dire tout le disque..
 ..
 Une nouvelle partition 1 de type Linux et de taille 931,5 GiB? a ete cree.
 La partition #1 contient une signature ntfs.

 Voulez-vous supprimer la signature ? [O]ui/[N] : O
 The signature will be removed by a write command.

puis commande t

 t
 Type de partition (taper L pour afficher tous les types) : 7
 Type de partition Linux modifiee en NTFS volume set.
 ...
 Commande (m pour l'aide) : w
 ...

NB: Eviter les type 86 et 87 (qui sont parfois non visible sous Windows XP) qui sont des types d'ensemble de volume. C'est à dire prévus pour créer des volumes sur cette partition.

Resultat visible sous Windows 7, et visible sous Windows XP

+MBR -> GPT avec parted

Creation de partition GPT avec parted

 prompt#parted /dev/sdb
 (parted)mklabel gpt
  ..
 (parted)mkpart primary ntfs 2048s 100%
 (parted)align-check optimal 1
 1 ok
 (parted)quit
 prompt#partprobe /dev/sdb

Resultat visible sous Windows 7, pas visible sous Windows XP

+MBR -> GPT avec gdisk

On peut aussi creer une partion GPT avec gdisk..

 prompt#gdisk /dev/sdb
 ..
 d (delete partition)
 o (create GUID parttition)
 n (new partition)
 .. default 1, 2028 -- fin
 t 0700 (type microsoft basic data)
 w
 proceed ? Yes

Resultat visible sous Windows 7, pas visible sous Windows XP

+GPT -> MBR avec parted

Utilisation de parted pour supprimer GPT et creer parttion MBR

 prompt#parted /dev/sdb
 (parted)mklabel msdos
 ..
 (parted)mkpart primary ntfs 2048s 100%

 prompt#partprobe /dev/sdb

Ce que dit fdisk -l /dev/sdb: ..

 Type d'etiquette de disque : dos
 Identifiant de disque; : 0x8412bfcc

 Peripherique Amorcage Debut  Fin       Secteurs   Taille  Id Type
 /dev/sdb1              2048 1953458175 1953456128 931,5G  7  HPFS/NTFS/exFAT

Puis utilisation de fdisk (ou cfdisk) comme ci-dessus pour creer une partition primaire de type 87

NB: GPT "Code 0700 Microsoft basic data" est equivalent à fdisk "ID 7 Type HPFS/NTFS/exFAT"

Resultat visible sous Windows 7, et visible sous Windows XP

Quelques liens qui m'ont aidé :

How to align partitions for best performance using parted https://rainbow.chard.org/2013/01/30/how-to-align-partitions-for-best-performance-using-parted/

How to Make GPT Partition Table and Create Partitions with parted on Linux https://www.systutorials.com/46294/making-gpt-partition-table-and-creating-partitions-with-parted-on-linux/

Remove GPT - Default back to MBR https://unix.stackexchange.com/questions/61142/remove-gpt-default-back-to-mbr

2018-03-28 18:55:50 -- Cmic

+Hardware compatibility and free os
+Install 32 bits softwares on Linux 64bits
Probleme si on a installé une version 64 bits (et pas une version "32-Bit / 64-Bit Multiarch"). C'est le cas par exemple pour installer Teamviewer v9 (et 10 ?).

1-install gdebi:

 dpkg --add-architecture i386
 apt-get update
 apt-get install gdebi

2-utiliser debi (debi is a deb file installer with dependances !! )

 debi install teamviewer_linux.deb

+Linux new commands kernel 2.6
  • /sys sysfs nouveau avec Kernel 2.6 en gros idem à proc
  • lspci -vv lecture du repertoire /sys
  • lsb_release -a Show Linux version, code name, etc.
  • systemctl
  • --------------- net tools -------------------
program obsoleted by
arp ip neigh
ifconfig ip addr
ipmaddr ip maddr
iptunnel ip tunnel
route ip route
nameif ifrename
mii-tool ethtool
netstat ss (man ss)

ip examples:

  • dpkg-query -l 'package' /* list package content */
  • dpkg-query -S 'command' /* shows which package includes 'command' */
  • lsblk : list of devices blocks
  • blkid : block device ids
  • blockdev : physical and logical block size of hd
  • tune2fs and dumpe2fs : to know filesystem characteristics
  • hwinfo
  • sfdik & cfdisk
  • strace : traces functions calls of an exec
  • Simple server http to share current directory: python -m SimpleHTTPServer?:9988
  • partclone : clonage d'une partition
  • nmcli : network manager command line
  • Support de exFat (file system >4GB/file, etc: aptitude install exfat-fuse exfat-utils
  • dmidecode : acces to all DMI info
  • lshw utility : acces to all hardware info (constructor, serial, BIOS, vendor, etc.
  • hosnamectl : idem.
  • imvirt script : a Perl script to detect if we are on a VM
+Linux Full Circle Magazine
+Lufi partage de fichier
Code source et installation par Luc Didry https://git.framasoft.org/luc/lufi
+mdadm: RAID OK but OS cann't boot

Note: the original article is in french : https://wiki.debian-fr.xyz/Raid_logiciel_(mdadm)#Cas_2_:_panne_du_disque_syst.C3.A8me.2C_la_grappe_RAID_est_OK

Real case: your RAID config is OK but you can't boot on the boot disk, bc the boot disk is out of order or whatever. In the following example, you can't boot on /dev/sda (system hd), and /dev/sdb and /dev/sdc as a RAID 1 w/ mdadm. And your RAID 1 array is OK !

  • First of all change the boot disk and/or re-install Debian.
  • then re-install mdadm :#apt-get install mdadm

Then, there are many options to repair:

-Option 1 Your re-install mdadm which will detect the "md superblocks" and conclude that a RAID 1 exists whith disks /sdv/sdb and /dev/sdc. Do a "cat /proc/mdstat" and wait for the end of synchronisation before rebooting the os.


-Option 2 You have previously saved the config file /etc/mdadm/mdadm.conf. So you can restore you RAID by typing

 # mdadm --assemble --scan

This way, mdadm will scan mdadm.conf and it will assemeble every array listed in mdadm.conf. Or you can copy you backuped mdadm.conf in /etc/mdadm/mdadm.conf and reboot. The array will be restored.


-Option 3 mdadm doesn't synchronize and you have not a backup of mdadm.conf. So you have to know the name of your RAID array and what it is composed of. Of course I know the RAID array was composed of /dev/sbc and /dev/sdc in my the array /dev/md127 (thx to my memory 8-)). So yo have to type:

 # mdadm --assemble /dev/md127 /dev/sdb1 /dev/sdc1

-Option 4 The architecture of your RAID array is more complex than that. You have to examine the diskds with fdisk -l and mdadm --examine /dev/<partx> to identify the array.

Example:

 # fdisk -l
 ...
 ...
    Device Boot      Start         End      Blocks   Id  System
 /dev/sdb1               1      121601   976760001   fd  Linux raid autodetect
 ...
 ...

You can see that /dev/sdb1 is of type "Linux raid autodetect". Next thing to do is using mdadm --examine:

 # mdadm --examine /dev/sdb1
 mdadm: metadata format 00.90 unknown, ignored.
 /dev/sdb1:
           Magic : a92b4efc
         Version : 00.90.00
            UUID : 3b2be7cf:1eca6c08:a962df05:773a6f64
   Creation Time : Sun Dec 14 20:41:21 2008
      Raid Level : raid1
   Used Dev Size : 976759936 (931.51 GiB? 1000.20 GB)
      Array Size : 976759936 (931.51 GiB? 1000.20 GB)
    Raid Devices : 2
   Total Devices : 2
 Preferred Minor : 0
 .
     Update Time : Fri May  7 17:06:49 2010
           State : clean
  Active Devices : 2
 Working Devices : 2
  Failed Devices : 0
   Spare Devices : 0
        Checksum : f320b0b5 - correct
          Events : 556
 .
 .
       Number   Major   Minor   RaidDevice? State
 this     1       8       17        1      active sync   /dev/sdb1
 .
    0     0       8        1        0      active sync   /dev/sdc1
    1     1       8       17        1      active sync   /dev/sdb1

I know now that /dev/sdb1 and /dev/sdc1 are part of RAID 1 array. So you can type:

 # mdadm --assemble /dev/md0 /dev/sdb1 /dev/sdc1

Now that anything is back and operational, don't forget to type:

 # mdadm --detail --scan --verbose > /etc/mdadm/mdadm.conf

And backup the file /etc/mdadm/mdadm.conf. Just in case !!

+Reparer une install Linux ou Grub cassee

Avec un live CD, il faut utiliser grub-install. Mais on alors besoin de /dev /proc et /sys. On utiliser pour cela la commande mount -o bind. NB: avec df, on ne voit pas /proc /sys et /dev ; il faut utiliser la commande mount pour cela.

 # mount /dev/hda5 /mnt/hda5
 # chroot /mnt/hda5/
 [chroot]# grub-install /dev/hda
 /dev/hda: Not found or not a block device.
 [chroot]# exit

Ca ne fonctionne pas : il faut monter /dev, /proc et /sys.

 # cd /mnt/hda5
 # mount -o bind /proc /mnt/hda5/proc/
 # mount -o bind /dev  /mnt/hda5/dev/
 # mount -o bind /sys  /mnt/hda5/sys
 # df -h
 Filesystem            Size  Used Avail Use% Mounted on
 /dev/hda3             9.5G  3.9G  5.1G  44% /
 tmpfs                 311M     0  311M   0% /dev/shm
 AFS                   8.6G     0  8.6G   0% /afs
 /dev/hda1             9.7G  5.0G  4.2G  55% /mnt/hda1
 /dev/hda5             9.5G  3.8G  5.3G  42% /mnt/hda5
 # chroot /mnt/hda5
 [chroot]# grub-install /dev/hda
 Installation finished. No error reported.
 This is the contents of the device map /boot/grub/device.map.
 Check if this is correct or not. If any of the lines is incorrect,
 fix it and re-run the script `grub-install'. 

 # this device map was generated by anaconda
 (hd0)     /dev/hda
 [chroot]# exit
 #

Voir aussi le post sur http://forum.ubuntu-fr.org/viewtopic.php?id=358656 et les liens dans ce thread qui indiquent d'autres pistes comme https://help.ubuntu.com/community/Grub2/Installing#Fixing_a_Broken_System

+SmartMontools? HD test and infos
HD hard and tracks internals, http://hddscan.com/doc/HDD_Tracks_and_Zones.html
SmartMonTools? test and verify HDs http://smartmontools.sourceforge.net/
SMART attributes significations http://www.cropel.com/library/smart-attribute-list.aspx
+Unix hacking and admin horror stories
+Unix History
Unix Tree [source of old unixes] https://minnie.tuhs.org/cgi-bin/utree.pl
2018-12-12 17:37:48 se logger sur de vieilles versions [UNICW, ATT, BSD 1.2, ..] https://unix50.org/
The Unix Heritage Society : Unix sources, history, etc. http://www.tuhs.org/
Kernigan explaining pipes, it worth it! https://www.youtube.com/watch?v=tc4ROCJYbm0
Papers could be found at http://citeseerx.ist.psu.edu/index . Many documents about computing science here.
+Usefull command line tools

firejail to [temporary] launch a suspect command in a protected directory

Command line manual [complete] https://archive.flossmanuals.net/_booki/command-line/command-line.pdf

Commands excerpt from this site https://kkovacs.eu/cool-but-obscure-unix-tools:

change X11 keyboard to french : setxkbmap fr
Lots of shell tools, command line productivity, system utilities, media, etc.. https://github.com/alebcay/awesome-shell
dstat & sar: iostat, vmstat, ifstat and much more in one package
htop & iotop: Process, memory and io monitoring.
slurm: Resource mabagement of cluster nodes
ttyrec & ipbt: Record and play back terminal sessions.
screen, dtach, tmux, byobu: Keep your terminal sessions alive.
mtr: traceroute 2.0 combines traceroute and ping
multitail: See your log files in separate windows.
socat & netpipes: Directing stuff easily in and out of sockets.
tpp: Presentation ("PowerPoint?") tool for terminal.
iftop, iptraf & nethogs: To see where your traffic goes.
siege & tsung: Command line load test tools.
duplicity & rsyncrypto: Encrypting backup tools.
lftp: Does FTPS. Can mirror, kinda like rsync.
curl: Everybody's favorite HTTP toolbox.
ack: A better grep for source code.
rtorrent & aria2: Command line torrent downloaders.
calcurse & remind + wyrd: Calendar systems.
ttytter & earthquake: Nice trendy Twitter clients :)
newsbeuter & rsstail: Command line RSS readers.
vifm & ranger: Alternatives to the midnight commander.
powertop: Helps conserve power on Linux.
cowsay & sl: I just couldn't resist. :o)
tig: A console UI for git.
cloc: Counts lines of code.
qalc: The best calculator. Ever. (For scripts too.)
ipcalc: For network assignments.
+using lvm : exemple
  • augmenter le volume du LogVol05?

  umount /home 
  e2fsck -f /dev/VolGroup00/LogVol05            #noter le nombre de blocks
  lvresize -L+10G /dev/VolGroup00/LogVol05      #ajouter 10 GB
  e2fsck -f /dev/VolGroup00/LogVol05            
  resize2fs /dev/VolGroup00/LogVol05            #ajuster le fs
  mount /home 

NB: le nombre de blocks sera utilisé pour revenir a la taille d'origine

  • diminuer le volume du LogVol05?
  umount /home 
  e2fsck -f /dev/VolGroup00/LogVol05           
  resize2fs /dev/VolGroup00/LogVol05 <nbblocks> #ou alors option -r de lvresize qui utilise fsadm
  lvresize -L-10G /dev/VolGroup00/LogVol05     #enlever 10GB
  e2fsck -f /dev/VolGroup00/LogVol05

+using netcat (nc)
Note: netcat (aka nc) is an old tool. ncat is a new one provided with nmap, like netcat with enhancements.

to transfer files from zaphod to zombie, place zombie in listening on port 8888 and then, send file from zaphod

 zombie/usr/home/cmic >nc -nvl 8888 > received_file
 zaphod/home/cmic >nc -nv zombie 8888 < file to send

get a remote shell on zaphod from zombie. Zombie can launch unix command on zaphod

 zaphod/home/cmic >nc -nvlp 8888 -e /bin/bash
 zombie/usr/home/cmic >nc -nv zaphod 8888

see also network pivoting techniques with netcat or socat https://bitrot.sh/cheatsheet/14-12-2017-pivoting/
+using udev to backup
Utiliser udev pour faire un backup automatique sur USB des que le device USB est inséré

 #cat /etc/udev/rules.d/10.autobackup.rules
 SUBSYSTEM=="block", 
 ACTION=="add", 
 ATTRS{idVendor}=="125f" 
 SYMLINK+="external%n", 
 RUN+="/bin/autobackup.sh"

Ensuite, il suffit d'écrire autobackup.sh, avec rsync par exemple.
+Vinyl cutter software & hardware
Inkcut device install https://www.codelv.com/projects/inkcut/docs/device-setup
Modified hpgl_output extension for vinyl cutter http://www.inkscapeforum.com/viewtopic.php?t=1357
Inkscape extensions https://inkscape.org/gallery/=extension/
Inkscape and Inkcut https://inkscape.org/~frmdstryr/%E2%98%85inkcut
NB: under Windows you can use Adobe Illustrator
Inkskape + Inkcut for Linux to cut vinyl sheets http://inkcut.sourceforge.net/
compatible with Roland PNC-900 or PNC-1000 (see pnc900.pdf user manual)
Helpfull Inksape forum https://www.inkscapecuttingdesign.com/smf/
Other Linux Vinyl cutter software http://libregraphicsworld.org/blog/entry/vinyl-cutting-on-linux-the-real-deal
+weak host model and unix
weak host model and strong host model on linux : "... IPv6 implements a "strong host model" whereas Linux IPv4 implements a "weak host model". In the strong model, IP addresses are associated with interfaces; in the weak model, they are associated with the host...." (pour IPV6, voir aussi Computing section Misc Network)

Sous Linux, supprimer ce comportement :

 sysctl net.ipv4.conf.<INTERFACE>.arp_ignore=1 ou 2, voire 8
+X11 servers, clients, applications (Unix or Windows)
Pure X11 (and oldies !) apps from https://cyber.dabamos.de/unix/x11/#xosview : ASClock (AfterStep? clock) Free42 (HP 42S emulator) FSV2 (A 3D filesystem visualiser) GLXGears GMixer GVIM Micropolis (Open-source version of the famous computer game SimCity?) Sunclock Ted (A simple RTF editor for X11) TiEmu? (Texas Instruments TI-89/TI-92) X026 ( keypunch emulator) X48 (HP 48GX graphing calculator) XArchiver XASCII XBiff XBill (XBill is an arcade game) XBoard (front-end for chess engines like GNU Chess) Calc XCalendar XCHM (Microsoft Windows help file viewer for Unix.) XChomp (Pac-Man for X) XClipboard XClock XClock/Cat? Clock XColorSel? XConsole XDiary XEdit XEarth XEyes XFontSel? XGalaga (classic game Galaga for X11) XInvaders 3D (Space Invaders clone for X11.) XKill XLennart ( modification of the arcade game XBill.) XLoad XLock XLogo XMan XMahjongg XMessage XMixer XMMIX XMore XMOTD XMosaic XMountains XNeko ( cat chasing the mouse cursor) XOdometer (tracks the total distance of your pointing device) XOSView Xplore (Motif-based file manager) XPostIt? XRoach XScreenSaver? XSnow XSpread ( simple spreadsheet) XTerm XTide Xv Xvkbd (Virtual keyboard for X) XWPE (Borland-like IDE) XZoom
X2go is a new protocol over a low bandwidth http://wiki.x2go.org/doku.php/doc:newtox2go
Colas Nahaboo X11 and 3 buttons mouse http://colas.nahaboo.net/mouse-wheel-scroll/
+X11 security
Ssh -X is not very secure. Put this in you ~/.ssh/config to enhance security. Voir aussi la conférence ComputingSecurity
 Host stokes
      Hostname stokes.comp.prv
      User cmic
      ForwardX11? yes
      ForwardX11Trusted? yes

 Host *
      ForwardX11? no
      ForwardAgent? no