Divers: Difference between revisions

From hugovil.com
Jump to navigationJump to search
No edit summary
No edit summary
 
(105 intermediate revisions by 2 users not shown)
Line 1: Line 1:
== Divers ==
=Syntax highlighting MediaWiki=


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


'''Pour capturer les données sur le réseau:'''
<source lang=ini>
  <nowiki>tcpdump -X -n -t -s 0 src 192.168.0.45</nowiki>
wfLoadExtension('SyntaxHighlight_GeSHi');
</source>


'''Pour afficher une image en arrière-plan (X-Windows):'''
=RTC=
  <nowiki>wmsetbg --center --workspace 0 image.jpeg</nowiki>


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


'''Configuration du client Email dans Opera'''
  Ne pas sélectionner "Enhanced Real-time clock Support" dans "Device Drivers  ---> Character devices  --->"
   <nowiki> sylpheed --compose [mailto:%t][?subject=%s]</nowiki>
   Sélectionner (built-in ,pas modulaire) "Device Drivers  ---> Real Time Clock  ---> Set system time from RTC on startup and resume"


'''Setup French Canadian (old ca_enhanced) layout'''
Avec ça, plus besoin du script /etc/rc.d/init.d/setclock


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:
Capture d'écran=
      Option          "XkbLayout"    "ca_enhanced"


To:
  import screenshot.png
      Option          "XkbLayout"    "ca"
      Option          "XkbVariant"    "fr"


'''Démarrage Linux sans authentification'''
=Permettre d'éteindre l'appareil sans être authentifié=


Dans le fichier /etc/inittab, remplacer cette ligne:
Enlever le '-a' de la ligne shutdown dans /etc/inittab
  1:12345:respawn:/sbin/agetty 38400 tty1


par celle-ci:
=Deleting files on mounted partitions in PcManFM gives error messge=
  1:12345:respawn:/sbin/agetty -n -l /bin/bootdisk-login 38400 tty1


et créez le script /bin/bootdisk-login:
Error message:
   #! /bin/sh
   Some files cannot be moved to trash can because the underlying file systems don't support this operation...
  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:
Fix by creating a trash folder on the partition root:
   #! /bin/sh
   mkdir .Trash-1004
   su <usager> -c /usr/X11R6/bin/startx
   chown -R 1004:1000 .Trash-1004/
   exit $?
   chmod 700 .Trash-1004/


'''How to do a search and replace over multiple files?'''
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.
=2 moniteurs avec Debian =
  -i means edit in-place
  -w write warnings
  -p loop


Example I had the following style sheet in a section:
Modifier:
  <nowiki><link rel="stylesheet" type="text/css" href="../includes/style.css"></nowiki>


and I wanted the following instead:
   $> /etc/gdm3/Init/Default
   <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 .
et ajouter la ligne:
  <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>
  xrandr --output DVI-0 --auto --output VGA-0 --auto --left-of DVI-0
</source >
 
=Configurer Debian pour rouler les applications X remote=
 
Ajouter dans /etc/gdm3/daemon.conf:
 
<source lang=text>
  [security]
   DisallowTCP=false
</source >
 
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 =
 
<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
 
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 &
</source >
 
 
= 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

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