Divers: Difference between revisions

From hugovil.com
Jump to navigationJump to search
No edit summary
No edit summary
 
(74 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>
 
<source lang=ini>
wfLoadExtension('SyntaxHighlight_GeSHi');
</source>


=Email=
=RTC=


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


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


===Configuration du serveur LDAP===
Avec ça, plus besoin du script /etc/rc.d/init.d/setclock


LDAP search string:
Capture d'écran=
  (&(mail=*)(cn=*%s*))


==Configuration du client Email dans Opera==
   import screenshot.png
   <nowiki> sylpheed --compose [mailto:%t][?subject=%s]</nowiki>


=Setup French Canadian (old ca_enhanced) layout=
=Permettre d'éteindre l'appareil sans être authentifié=


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:
Enlever le '-a' de la ligne shutdown dans /etc/inittab
      Option          "XkbLayout"    "ca_enhanced"


To:
=Deleting files on mounted partitions in PcManFM gives error messge=
      Option          "XkbLayout"    "ca"
      Option          "XkbVariant"    "fr"


=Démarrage Linux sans authentification=
Error message:
  Some files cannot be moved to trash can because the underlying file systems don't support this operation...


Dans le fichier /etc/inittab, remplacer cette ligne:
Fix by creating a trash folder on the partition root:
   1:12345:respawn:/sbin/agetty 38400 tty1
   mkdir .Trash-1004
  chown -R 1004:1000 .Trash-1004/
  chmod 700 .Trash-1004/


par celle-ci:
  1:12345:respawn:/sbin/agetty -n -l /bin/bootdisk-login 38400 tty1


et créez le script /bin/bootdisk-login:
=2 moniteurs avec Debian =
  #! /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:
Modifier:
  #! /bin/sh
  su <usager> -c /usr/X11R6/bin/startx
  exit $?


=Affichage des fichiers avec majuscule en premier=
   $>  /etc/gdm3/Init/Default
   set LC_COLLATE=C


=How to do a search and replace over multiple files?=
et ajouter la ligne:
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.
<source lang=text>
  -i means edit in-place
   xrandr --output DVI-0 --auto --output VGA-0 --auto --left-of DVI-0
  -w write warnings
</source >
  -p loop


Example I had the following style sheet in a section:
=Configurer Debian pour rouler les applications X remote=
  <nowiki><link rel="stylesheet" type="text/css" href="../includes/style.css"></nowiki>


and I wanted the following instead:
Ajouter dans /etc/gdm3/daemon.conf:
  <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 .
<source lang=text>
   <nowiki>\.\.\/includes\/style\.css</nowiki>
   [security]
  DisallowTCP=false
</source >


So the final line of code ends up as
Et faire:
  <nowiki>perl -pi -w -e 's/\.\.\/includes\/style\.css/admin\.css/g;' *.php</nowiki>


=Installation de style file latex=
  $> xhost +


Éxécuter la commande:
=OpenWRT=
  mktexlsr


après avoir installé le fichier .sty
Luci install:


=Supprimer un "/" à la fin=
  $> opkg update
  $> opkg install luci
ou
  $> opkg install luci-ssl


DIR="/usr/local/bin/"
Luci start:
echo ${DIR%/}


=Effacer plusieurs fichiers avec find=
  /etc/init/uhttpd start


find . -name .svn -exec rm -rf {} \;
Configure to start automatically:


=LFS: Comment sauver de l'espace disque=
  /etc/init.d/uhttpd enable


==/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=
= Xresources =
  Sur le serveur (web admin interface, port 631), cliquer sur "Find New Printer"


  Sélectionner "Generic Make"
Pour voir la configuration actuelle:
  Model: Sélectionner "Generic CUPS-PDF Printer (en)"


=tar avec SSH=
   $> xrdb -query -all
   tar jcvf - directory | ssh user@host "cat > directory.tar.bz2"


=Navigateur par défaut pour les applications Gnome=


Éxécuter:
  $> gnome-default-applications-properties


= .xsessionrc =


=Syntax highlighting MediaWiki=
<source lang=bash>
#!/bin/bash


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


<source lang=css>
if [ -f ${HOME}/.profile ]; then
pre {
    . ${HOME}/.profile
padding: 1em;
fi
border: 1px dashed #2f6fab;
color: black;
background-color: #f9f9f9;
line-height: 1.1em;
</source>


With:
# Disable bell
xset -b


<source lang=css>
xscreensaver -no-splash &
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=
# Load resources
  $> hddtemp /dev/sda
xrdb -merge .Xresources


=SMART Disk Monitoring Daemon=
DBUS_SESSION_BUS_ADDRESS="" dropbox start &
</source >


  $> 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=
= Bug NFS Debian =


Si vous avez ce message d'erreur:
Message d'erreur:
    ...blkmapd[278]: open pipe file /run/rpc_pipefs/nfs/blocklayout failed: No such file or directory...


  password for ' null ' gnome keyring
Solution:
    $> sudo systemctl disable nfs-blkmap


Il faut éxécuter:
= XTerm =


  $> rm ~/.gnome2/keyrings/login.keyring
Pour sauvegarder le contenu du terminal dans un fichier faire:


=Combiner plusieurs documents PDF en un seul=
  Ctrl-Clickleft et sélectionner
    "Print-All Immediately"


  $> gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=finished.pdf file1.pdf file2.pdf
Cela va générer un fichier $HOME/XTermYYYY-MM-DD.hh.mm.ss

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