Divers: Difference between revisions

From hugovil.com
Jump to navigationJump to search
No edit summary
No edit summary
 
(113 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>
  tcpdump -X -n -t -s 0 src 192.168.0.45
wfLoadExtension('SyntaxHighlight_GeSHi');
</source>


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


'''How to do a search and replace over multiple files?'''
Pour que Linux ajuste automatiquement son horloge selon le RTC au démarrage, il faut:
You could use find and sed, but I find that this little line of perl works nicely:
    perl -pi -w -e 's/search/replace/g;' *.php


   -e means execute the following line of code.
   Ne pas sélectionner "Enhanced Real-time clock Support" dans "Device Drivers  ---> Character devices  --->"
   -i means edit in-place
   Sélectionner (built-in ,pas modulaire) "Device Drivers  ---> Real Time Clock  ---> Set system time from RTC on startup and resume"
  -w write warnings
  -p loop


Example I had the following style sheet in a section:
Avec ça, plus besoin du script /etc/rc.d/init.d/setclock


  <link rel="stylesheet" type="text/css" href="../includes/style.css">
Capture d'écran=


and I wanted the following instead:
   import screenshot.png
   <link rel="stylesheet" type="text/css" href="admin.css">


As each expression is a regular expression you've got to escape the special characters such as forward slash and .
=Permettre d'éteindre l'appareil sans être authentifié=
\.\.\/includes\/style\.css


So the final line of code ends up as
Enlever le '-a' de la ligne shutdown dans /etc/inittab
perl -pi -w -e 's/\.\.\/includes\/style\.css/admin\.css/g;' *.php
 
=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:
 
<source lang=text>
  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