Divers: Difference between revisions

From hugovil.com
Jump to navigationJump to search
No edit summary
No edit summary
 
(66 intermediate revisions by the same user not shown)
Line 1: Line 1:
=Pour capturer les données sur le réseau=
=Syntax highlighting MediaWiki=
  <nowiki>tcpdump -X -n -t -s 0 src 192.168.0.45</nowiki>


=Pour afficher une image en arrière-plan (X-Windows)=
Ajouter à la fin de /etc/mediawiki/LocalSettings.php:
  <nowiki>wmsetbg --center --workspace 0 image.jpeg</nowiki>


=Email=
<source lang=ini>
wfLoadExtension('SyntaxHighlight_GeSHi');
</source>


==Sylpheed==
=RTC=


===Configuration du naviguateur===
Pour que Linux ajuste automatiquement son horloge selon le RTC au démarrage, il faut:
  <nowiki>opera -newpage %s</nowiki>


===Configuration du serveur LDAP===
  Ne pas sélectionner "Enhanced Real-time clock Support" dans "Device Drivers  ---> Character devices  --->"
  Sélectionner (built-in ,pas modulaire) "Device Drivers  ---> Real Time Clock  ---> Set system time from RTC on startup and resume"


LDAP search string:
Avec ça, plus besoin du script /etc/rc.d/init.d/setclock
  (&(mail=*)(cn=*%s*))


==Configuration du client Email dans Opera==
Capture d'écran=
  <nowiki> sylpheed --compose [mailto:%t][?subject=%s]</nowiki>


=Setup French Canadian (old ca_enhanced) layout=
  import screenshot.png


With Xorg7, "ca_enhanced" is no more. You have to do a little trick to get the same layout that you are used to: Switch the old:
=Permettre d'éteindre l'appareil sans être authentifié=
      Option          "XkbLayout"    "ca_enhanced"


To:
Enlever le '-a' de la ligne shutdown dans /etc/inittab
      Option          "XkbLayout"    "ca"
      Option          "XkbVariant"    "fr"


=Démarrage Linux sans authentification=
=Deleting files on mounted partitions in PcManFM gives error messge=


Dans le fichier /etc/inittab, remplacer cette ligne:
Error message:
   1:12345:respawn:/sbin/agetty 38400 tty1
   Some files cannot be moved to trash can because the underlying file systems don't support this operation...


par celle-ci:
Fix by creating a trash folder on the partition root:
   1:12345:respawn:/sbin/agetty -n -l /bin/bootdisk-login 38400 tty1
  mkdir .Trash-1004
   chown -R 1004:1000 .Trash-1004/
  chmod 700 .Trash-1004/


et créez le script /bin/bootdisk-login:
  #! /bin/sh
  export HOME=/root
  export PS1='\u:\w\$ '
  export PATH=/bin:/usr/bin:/sbin:/usr/sbin
  cd ${HOME}
  /bin/bash --login
  exit $?


Si vous voulez démarrer X sans authentification pour un usager en particulier, voici le script à utiliser:
=2 moniteurs avec Debian =
  #! /bin/sh
  su <usager> -c /usr/X11R6/bin/startx
  exit $?


=Affichage des fichiers avec majuscule en premier=
Modifier:
  set LC_COLLATE=C


=How to do a search and replace over multiple files?=
  $> /etc/gdm3/Init/Default
   
You could use find and sed, but I find that this little line of perl works nicely:
    <nowiki>perl -pi -w -e 's/search/replace/g;' *.php</nowiki>


  -e means execute the following line of code.
et ajouter la ligne:
  -i means edit in-place
  -w write warnings
  -p loop


Example I had the following style sheet in a section:
<source lang=text>
  <nowiki><link rel="stylesheet" type="text/css" href="../includes/style.css"></nowiki>
  xrandr --output DVI-0 --auto --output VGA-0 --auto --left-of DVI-0
</source >


and I wanted the following instead:
=Configurer Debian pour rouler les applications X remote=
  <nowiki><link rel="stylesheet" type="text/css" href="admin.css"></nowiki>


As each expression is a regular expression you've got to escape the special characters such as forward slash and .
Ajouter dans /etc/gdm3/daemon.conf:
  <nowiki>\.\.\/includes\/style\.css</nowiki>


So the final line of code ends up as
<source lang=text>
   <nowiki>perl -pi -w -e 's/\.\.\/includes\/style\.css/admin\.css/g;' *.php</nowiki>
  [security]
   DisallowTCP=false
</source >


=Installation de style file latex=
Et faire:


Éxécuter la commande:
   $> xhost +
   mktexlsr


après avoir installé le fichier .sty
=OpenWRT=


=Supprimer un "/" à la fin=
Luci install:


DIR="/usr/local/bin/"
  $> opkg update
echo ${DIR%/}
  $> opkg install luci
ou
  $> opkg install luci-ssl


=Effacer plusieurs fichiers avec find=
Luci start:


find . -name .svn -exec rm -rf {} \;
  /etc/init/uhttpd start


=LFS: Comment sauver de l'espace disque=
Configure to start automatically:
 
==/usr/share/zoneinfo==
If you copy your timezone to /etc/localtime instead of making the
normal symbolic link, all of /usr/share/zoneinfo can be removed.
 
==/usr/share/locale and /usr/lib/locale==
If you don't use NLS, you can remove all the locale info in /usr/share/locale and /usr/lib/locale.
 
==/usr/share/man==
Les répertoires /usr/share/man{cs,de,es,fi,fr,sauver de l'espace disquehu,id,it,ja,ko} etc peuvent être enlevés.
 
=Comment synchroniser deux répertoires=
Le répertoire dest va devenir un miroir de src:
  $> rsync -av --delete src/* dest
 
=Installation CUPS-PDF=
  Sur le serveur (web admin interface, port 631), cliquer sur "Find New Printer"
 
  Sélectionner "Generic Make"
  Model: Sélectionner "Generic CUPS-PDF Printer (en)"
 
=tar avec SSH=
  tar jcvf - directory | ssh user@host "cat > directory.tar.bz2"
 
=Navigateur par défaut pour les applications Gnome=
 
Éxécuter:
  $> gnome-default-applications-properties
 
 
=Syntax highlighting MediaWiki=
 
Replace in skins/monobook/main.css:
 
<source lang=css>
pre {
padding: 1em;
border: 1px dashed #2f6fab;
color: black;
background-color: #f9f9f9;
line-height: 1.1em;
</source>
 
With:
 
<source lang=css>
pre {
padding: 1em !important;
border: 1px dashed #2f6fab !important;
color: black;
background-color: #f9f9f9 !important;
line-height: 1.1em !important;
</source>


=Lecture température disque dur=
   /etc/init.d/uhttpd enable
   $> hddtemp /dev/sda


=SMART Disk Monitoring Daemon=


  $> apt-get install smartmontools
  $> smartctl -t long /dev/sda [wait until test completes, then]
  $> smartctl -l selftest /dev/sda


=Changement du mot de passe usager=


Si vous avez ce message d'erreur:


  password for ' null ' gnome keyring
= Xresources =


Il faut éxécuter:
Pour voir la configuration actuelle:


   $> rm ~/.gnome2/keyrings/login.keyring
   $> xrdb -query -all


=Combiner plusieurs documents PDF en un seul=


  $> gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=finished.pdf file1.pdf file2.pdf


Si les sources sont des images, on peut utiliser ImageMagick:
= .xsessionrc =


  $> convert *.gif foo.pdf
<source lang=bash>
#!/bin/bash


# Nécessaire car lightdm ne lit pas /etc/profile (not a login shell):
if [ -f /etc/profile ]; then
    . /etc/profile
fi


=Désactiver mode large files=
if [ -f ${HOME}/.profile ]; then
    . ${HOME}/.profile
fi


si vous avez ce message quand vous essayez de monter un disque:
# Disable bell
xset -b


  EXT4-fs (sda1): Filesystem with huge files cannot be mounted read-write without CONFIG_LBDAF
xscreensaver -no-splash &


Selon la doc du kernel de Linux:
# Load resources
xrdb -merge .Xresources


<source lang=text>
DBUS_SESSION_BUS_ADDRESS="" dropbox start &
The ext4 filesystem requires that this feature be enabled in
order to support filesystems that have the huge_file feature
enabled.  Otherwise, it will refuse to mount in the read-write
mode any filesystems that use the huge_file feature, which is
enabled by default by mke2fs.ext4.
</source >
</source >


The feature can be removed from an existing filesystem by running the following commands:
  $> tune2fs -O ^huge_file /dev/whatever
  $> fsck /dev/whatever
This should allow you to mount the drive without CONFIG_LBDAF in the kernel.
=RTC=
Pour que Linux ajuste automatiquement son horloge selon le RTC au démarrage, il faut:
  Ne pas sélectionner "Enhanced Real-time clock Support" dans "Device Drivers  ---> Character devices  --->"
  Sélectionner (built-in ,pas modulaire) "Device Drivers  ---> Real Time Clock  ---> Set system time from RTC on startup and resume"
Avec ça, plus besoin du script /etc/rc.d/init.d/setclock
=Scanner Epson Perfection V100 Photo=
==Installation instructions for scanner EPSON Perfection V100 Photo==
# Start each line
# with a [[Wikipedia:Number_sign|number sign]] (#).
## More number signs gives deeper
### and deeper
### levels.
# Line breaks<br>don't break levels.
### But jumping levels creates empty space.
# Blank lines
# end the list and start another.
Any other start also
ends the list.
The scanner can be controlled either by iscan or by xsane, but in both cases
the firmware files, the iscan plugin library, iscan-data, iscan and the
sane configuration files (dll.conf and epkowa.conf) must be installed.
Note 1: The usbfs (/proc/bus/usb) filesystem is not necessary even if using
        libusb.
Note 2: It seems that the iscan-registry command must be executed even if
        using sane.
Note 3: The epkowa back-end comes from iscan (not from sane).
1. Download:
    "iscan-plugin-gt-s600-2.0.0-1.c2.i386.rpm" OR
    "iscan-plugin-gt-s600-2.1.2-1.x86_64.rpm"
2. Extract content of RPM:
    rpm2cpio iscan-plugin-gt-s600-...rpm > iscan-plugin.cpio
3. Extract files from CPIO archive:
    mkdir iscan-plugin
    cd iscan-plugin
    cpio -ivd < ../iscan-plugin.cpio
4. Copy firmware files and plugin:
    cp -a usr/share/iscan /usr/share
    cp -a usr/lib/iscan  /usr/lib
5. Download and install " iscan-data_1.9.0-1.tar.gz"
    ./configure --prefix=/usr &&
    make &&
    make install
6. Download and install "iscan_2.26.4-2.tar.gz"
    ./configure --prefix=/usr --localstatedir=/var &&
    make &&
    make install
8. Create entry for scanner:
    iscan-registry --add interpreter usb 0x04b8 0x012d \
      /usr/lib/iscan/libesint66 \
      /usr/share/iscan/esfw66.bin


  This will create the file /var/lib/iscan/interpreter
= Bug NFS Debian =


9. In "/etc/sane.d/dll.conf":
Message d'erreur:
    epkowa
    ...blkmapd[278]: open pipe file /run/rpc_pipefs/nfs/blocklayout failed: No such file or directory...


10. Create file "/etc/sane.d/epkowa.conf":
Solution:
    usb
     $> sudo systemctl disable nfs-blkmap
Note importante: si on met cette ligne dans epkowa.conf:
  usb 0x04b8 0x012d
ça prend une éternité (environ 1 à 2 minutes) avant de voir
apparaître la fenêtre de scan.
      
3. Activate either xsane or iscan plugin (or both) for Gimp:
    ln -s /usr/bin/xsane /usr/lib/gimp/2.0/plug-ins
    ln -s /usr/bin/iscan /usr/lib/gimp/2.0/plug-ins


Exemple pour lancer xsane et avoir des traces:
= XTerm =
SANE_DEBUG_EPKOWA=CMD xsane


Exemple pour spécifier le scanner directement:
Pour sauvegarder le contenu du terminal dans un fichier faire:
SANE_DEBUG_EPKOWA=CMD xsane epkowa:interpreter


  Ctrl-Clickleft et sélectionner
    "Print-All Immediately"


Avasys download URL:
Cela va générer un fichier $HOME/XTermYYYY-MM-DD.hh.mm.ss
  http://www.avasys.jp/english/linux_e/dl_scan.html

Latest revision as of 19:48, 2 April 2026

Syntax highlighting MediaWiki

Ajouter à la fin de /etc/mediawiki/LocalSettings.php:

wfLoadExtension('SyntaxHighlight_GeSHi');

RTC

Pour que Linux ajuste automatiquement son horloge selon le RTC au démarrage, il faut:

 Ne pas sélectionner "Enhanced Real-time clock Support" dans "Device Drivers  ---> Character devices  --->"
 Sélectionner (built-in ,pas modulaire) "Device Drivers  ---> Real Time Clock  ---> Set system time from RTC on startup and resume"

Avec ça, plus besoin du script /etc/rc.d/init.d/setclock

Capture d'écran=

 import screenshot.png

Permettre d'éteindre l'appareil sans être authentifié

Enlever le '-a' de la ligne shutdown dans /etc/inittab

Deleting files on mounted partitions in PcManFM gives error messge

Error message:

 Some files cannot be moved to trash can because the underlying file systems don't support this operation...

Fix by creating a trash folder on the partition root:

 mkdir .Trash-1004
 chown -R 1004:1000 .Trash-1004/
 chmod 700 .Trash-1004/


2 moniteurs avec Debian

Modifier:

 $>  /etc/gdm3/Init/Default

et ajouter la ligne:

  xrandr --output DVI-0 --auto --output VGA-0 --auto --left-of DVI-0

Configurer Debian pour rouler les applications X remote

Ajouter dans /etc/gdm3/daemon.conf:

  [security]
  DisallowTCP=false

Et faire:

 $> xhost +

OpenWRT

Luci install:

 $> opkg update
 $> opkg install luci

ou

 $> opkg install luci-ssl

Luci start:

 /etc/init/uhttpd start

Configure to start automatically:

 /etc/init.d/uhttpd enable



Xresources

Pour voir la configuration actuelle:

 $> xrdb -query -all


.xsessionrc

#!/bin/bash

# Nécessaire car lightdm ne lit pas /etc/profile (not a login shell):
if [ -f /etc/profile ]; then
    . /etc/profile
fi

if [ -f ${HOME}/.profile ]; then
    . ${HOME}/.profile
fi

# Disable bell
xset -b

xscreensaver -no-splash &

# Load resources
xrdb -merge .Xresources

DBUS_SESSION_BUS_ADDRESS="" dropbox start &


Bug NFS Debian

Message d'erreur:

   ...blkmapd[278]: open pipe file /run/rpc_pipefs/nfs/blocklayout failed: No such file or directory...

Solution:

   $> sudo systemctl disable nfs-blkmap

XTerm

Pour sauvegarder le contenu du terminal dans un fichier faire:

 Ctrl-Clickleft et sélectionner
   "Print-All Immediately"

Cela va générer un fichier $HOME/XTermYYYY-MM-DD.hh.mm.ss