Table des matières
- 2026:
- 2025:
4 billet(s) pour septembre 2026
| Notes HTTP Strict Transport Security - HSTS | 2026/09/18 11:04 | Jean-Baptiste |
| Notes GNU Linux GPU carte graphiques | 2026/09/08 15:49 | Jean-Baptiste |
| Notes GNU Linux graphique | 2026/09/08 15:42 | Jean-Baptiste |
| Notes urlencoding - passer des mots de passe en HTTPS | 2026/09/03 17:58 | Jean-Baptiste |
Notes Elasticsearch Logstash Kibana
Voir :
Voir aussi :
- Loki (remplace Elasticsearch Logstash) Voir Loki, centralisation de logs à la sauce Prometheus * https://vector.dev * Metricbeat * Promtail & Loki OpenSearch** remplace ElasticSearch
Vérif syntax Grok : https://grokdebug.herokuapp.com/
Notes perso
A lire
API
RSYSLOG
Fluentd
NGINX JSON
DOCKER
Elasticsearch
Config
/etc/elasticsearch/jvm.options.d/mem.options
-Xms512m -Xmx512m
Sécurité : Voir : https://www.elastic.co/guide/en/elasticsearch/reference/7.12/security-minimal-setup.html
/etc/elasticsearch/elasticsearch.yml
xpack.security.enabled: true
Attention, cette commande ne peut s’exécuter qu'une seule fois !
/usr/share/elasticsearch/bin/elasticsearch-setup-passwords auto
Logstash
Voir aussi :
- Filebeat
- Fluentd
Config
Conf Java Mem
/etc/logstash/jvm.options
## JVM configuration # Xms represents the initial size of total heap space # Xmx represents the maximum size of total heap space #-Xms1g #-Xmx1g -Xms512m -Xmx512m
Exemple Nginx
Voir : https://www.elastic.co/guide/en/logstash/7.9/logstash-config-for-filebeat-modules.html#parsing-nginx
Note : préférer Filebeat
/etc/logstash/conf.d/nginx-exemple.conf
input { file { path => ["/var/log/nginx/access.log", "/var/log/nginx/error.log"] type => "nginx" } } filter { if [fileset][module] == "nginx" { if [fileset][name] == "access" { grok { match => { "message" => ["%{IPORHOST:[nginx][access][remote_ip]} - %{DATA:[nginx][access][user_name]} \[%{HTTPDATE:[nginx][access][time]}\] \"%{WORD:[nginx][access][method]} %{DATA:[nginx][access][url]} HTTP/%{NUMBER:[nginx][access][http_version]}\" %{NUMBER:[nginx][access][response_code]} %{NUMBER:[nginx][access][body_sent][bytes]} \"%{DATA:[nginx][access][referrer]}\" \"%{DATA:[nginx][access][agent]}\""] } remove_field => "message" } mutate { add_field => { "read_timestamp" => "%{@timestamp}" } } date { match => [ "[nginx][access][time]", "dd/MMM/YYYY:H:m:s Z" ] remove_field => "[nginx][access][time]" } useragent { source => "[nginx][access][agent]" target => "[nginx][access][user_agent]" remove_field => "[nginx][access][agent]" } geoip { source => "[nginx][access][remote_ip]" #target => "[nginx][access][geoip]" } } else if [fileset][name] == "error" { grok { match => { "message" => ["%{DATA:[nginx][error][time]} \[%{DATA:[nginx][error][level]}\] %{NUMBER:[nginx][error][pid]}#%{NUMBER:[nginx][error][tid]}: (\*%{NUMBER:[nginx][error][connection_id]} )?%{GREEDYDATA:[nginx][error][message]}"] } remove_field => "message" } mutate { rename => { "@timestamp" => "read_timestamp" } } date { match => [ "[nginx][error][time]", "YYYY/MM/dd H:m:s" ] remove_field => "[nginx][error][time]" } } } } output { elasticsearch { hosts => localhost #user => elastic #password => PassWord #manage_template => false #index => "%{[@metadata][beat]}-%{[@metadata][version]}-%{+YYYY.MM.dd}" index => "logstash-plop-%{+YYYY.MM.dd}" } # stdout { codec => rubydebug } }
Debug
su - logstash -s /bin/bash # Validation de la conf / vérif de la syntax /usr/share/logstash/bin/logstash --config.test_and_exit --path.settings /etc/logstash -f /etc/logstash/conf.d/plop.conf -f # Debug /usr/share/logstash/bin/logstash --debug --path.settings /etc/logstash -f /etc/logstash/conf.d/plop.conf -f
Autres
Notes en vrac
file {
path => "/var/log/apache2/apache.log"
start_position => "beginning"
type => "apache"
}
elasticksearch
-p 9200-e discovery.type=single-node
Kibana
Nginx reverse proxy
/etc/nginx/sites-available/kibana.acme.fr
server { server_name kibana.acme.fr; root /var/www/html; location / { proxy_pass http://127.0.0.1:5601; include /etc/nginx/proxy_params; client_max_body_size 10M; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_cache_bypass $http_upgrade; } access_log /var/log/nginx/kibana.acme.fr.log; error_log /var/log/nginx/kibana.acme.fr.err; listen [::]:443 ssl ipv6only=on; # managed by Certbot listen 443 ssl; # managed by Certbot ssl_certificate /etc/letsencrypt/live/kibana.acme.fr/fullchain.pem; # managed by Certbot ssl_certificate_key /etc/letsencrypt/live/kibana.acme.fr/privkey.pem; # managed by Certbot include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot } server { if ($host = kibana.acme.fr) { return 301 https://$host$request_uri; } # managed by Certbot listen 80; listen [::]:80; server_name kibana.acme.fr; return 404; # managed by Certbot }
Sécurité
/etc/kibana/kibana.yml
elasticsearch.username: "elastic"
/usr/share/kibana/bin/kibana-keystore create /usr/share/kibana/bin/kibana-keystore add elasticsearch.password
Filebeat
Voir aussi fluentd
Dans certain cas, remplace Logstash
filebeat.yml
output.elasticsearch: hosts: ["http://localhost:9200"] username: "elastic" password: "P@ssw0rd" setup.kibana: host: "http://localhost:5601"
filebeat modules enable system nginx filebeat setup filebeat -e
Il suffit de chercher des Dashboard commençant par “[Filebeat System]” et [Filebeat Nginx]“ pour avoir déjà une conf prête à l'emploi
Brouillons
filebeat setup -e \ -E output.logstash.enabled=false \ -E output.elasticsearch.hosts=['localhost:9200'] \ -E output.elasticsearch.username=filebeat_internal \ -E output.elasticsearch.password=YOUR_PASSWORD \ -E setup.kibana.host=localhost:5601 filebeat setup -e \ -E 'setup.template.overwrite=true' \ -E 'setup.kibana.host="localhost:5601"' \ -E 'output.logstash.enabled=false' \ -E 'output.elasticsearch.hosts=["localhost:9200"]' filebeat keystore create #filebeat keystore add ES_PWD filebeat keystore add elastic filebeat keystore list
Notes écran tactile touch screen
Voir :
Pb écran tactile
apt-get install xinput-calibrator xinput
export DISPLAY=:0 ID=$(xinput list --id-only "eGalax Inc. USB TouchController") SCREEN=$(xrandr 2>&1 | grep -e ' connected primary' | awk '{print $1}') #xinput --map-to-output 11 DVI-D-0 xinput --map-to-output $ID $SCREEN
xinput list-props "eGalax Inc. USB TouchController" | grep -e "Coordinate Transformation Matrix"
Coordinate Transformation Matrix (155): 0.000000, 0.375000, 0.000000, -1.000000, 0.000000, 1.000000, 0.000000, 0.000000, 1.000000
xinput_calibrator -v --device "eGalax Inc. USB TouchController"
https://askubuntu.com/questions/41385/cannot-calibrate-touchscreen
Persistance
/usr/local/bin/touchscreencfg.sh
#! /bin/bash export DISPLAY=:0 NAME=$(xinput list --name-only | grep -i -e touch | grep -iv -e ' pen') ID=$(xinput list --id-only "$NAME") SCREEN=$(xrandr 2>&1 | grep -e ' connected primary' | awk '{print $1}') /usr/bin/xinput --map-to-output $ID $SCREEN ( sleep 5 ; /usr/bin/xinput --map-to-output $ID $SCREEN ) &
chmod +x /usr/local/bin/touchscreencfg.sh
~/.xsessionrc
/usr/local/bin/touchscreencfg.sh
Pb
Pb persistance sur débranchement ou extinction de l'écran
Voir Notes Systemd udev
Notes en vrac - pb débranchement retranchement extinction écran - perte orientation touchscreen
Voir :
68.624] (II) NVIDIA(0): Setting mode "DVI-D-0: nvidia-auto-select @768x1024 +0+0 {ViewPortIn=768x1024, ViewPortOut=1024x768+0+0, Rotation=270}"
modprobe evdev modprobe usbtouchscreen usbhid cat /proc/bus/input/devices echo Y > /sys/module/usbtouchscreen/parameters/swap_xy
Enable the Touchscreen in Lightdm (the login screen) copy ~/.config/monitors.xml to /var/lib/lightdm/.config
xinput_calibrator --device "Elo Touch Solutions Elo Touch Solutions Pcap USB Interface" --output-type xorg.conf.d --no-timeout
Calibrating EVDEV driver for "Elo Touch Solutions Elo Touch Solutions Pcap USB Interface" id=8
current calibration values (from XInput): min_x=0, max_x=4095 and min_y=0, max_y=4095
Doing dynamic recalibration:
Setting calibration data: 1, 4064, -19, 4082
--> Making the calibration permanent <--
copy the snippet below into '/etc/X11/xorg.conf.d/99-calibration.conf' (/usr/share/X11/xorg.conf.d/ in some distro's)
Section "InputClass"
Identifier "calibration"
MatchProduct "Elo Touch Solutions Elo Touch Solutions Pcap USB Interface"
Option "Calibration" "1 4064 -19 4082"
Option "SwapAxes" "0"
EndSection
/etc/X11/xorg.conf.d/99-calibration.conf
Section "InputClass"
Identifier "calibration"
MatchProduct "Elo Touch Solutions Elo Touch Solutions Pcap USB Interface"
Option "Calibration" "44 4061 4081 -44"
Option "SwapAxes" "1"
Option "InvertX" "0"
Option "InvertY" "0"
EndSection
Matrix
https://gist.github.com/mildmojo/48e9025070a2ba40795c#file-rotate_desktop-sh-L41
https://github.com/swkim01/waveshare-dtoverlays
xinput list-props "Elo Touch Solutions Elo Touch Solutions Pcap USB Interface" | grep Matrix
Coordinate Transformation Matrix (155): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
Option "TransformationMatrix" "1 0 0 0 1 0 0 0 1"
Troubleshooting
sudo apt-get install -y evtest
Notes
https://askubuntu.com/questions/253395/touchscreen-calibration-with-dual-monitors-nvidia-and-xinput
https://wiki.archlinux.org/index.php/Calibrating_Touchscreen
Do it automatically via a udev rule
Create a file something like /etc/udev/rules.d/99-acer-touch.rules with contents like this:
ENV{ID_VENDOR_ID}=="2149",ENV{ID_MODEL_ID}=="2703",ENV{WL_OUTPUT}="DVI1",ENV{LIBINPUT_CALIBRATION_MATRIX}="1 0 0 0 1 0"
LXQt
~/.config/autostart/lxqt-config-touchpad-autostart.desktop
[Desktop Entry] Comment=Autostart touchpad settings for lxqt-config-input Exec=lxqt-config-input --load-touchpad Name=lxqt-config-touchpad-autostart OnlyShowIn=LXQt Type=Application Version=1.0
Notes e-commerce
Les sites d'e-commerce
Sites Web :
Les passerelles de paiement
Voir :
Voir :
Voir aussi :
Éventuellement à tester : Braintree (compatible PayPal et CB) ?
.
Notes DokuWiki API XML-RPC
Généralités
Penser à restreindre l'accès à https://wiki.acme.fr/lib/exe/xmlrpc.php depuis le serveur web
Il faut activer l'option :
remote
Active l'API système distante. Ceci permet à d'autres applications d'accéder au wiki via XML-RPC ou d'autres mécanismes.
Voir aussi l'option :
remoteuser
Restreindre l'accès à l'API à une liste de groupes ou d'utilisateurs (séparés par une virgule). Laisser vide pour donner l'accès tout le monde.
Exemple en Python
pip3 install --user dokuwiki
import dokuwiki wiki=dokuwiki.DokuWiki('https://wiki.acme.fr', 'remoteuser', 'P@ssw0rd') wiki.version wiki.send('dokuwiki.getVersion') wiki.title wiki.pages.list() [page['id'] for page in wiki.pages.list('Tech')] # Info wiki.pages.info('Test') wiki.send('wiki.getPageInfo','Test') wiki.pages.versions('Test') # Modification, ajout à une page existente wiki.pages.append('Test', 'http://linuxfr.org/\n\n', sum='Via XML-RPC', minor=True) # Création nouvelle page avec son lien wiki.pages.set('Test1', 'Test1 : \n * http://linuxfr.org/') wiki.pages.append('Test', '[[Test1]]', sum='Via XML-RPC', minor=True) # Recherche motif textuel [x['id'] for x in wiki.pages.search('linuxfr')] # Effacement page ':Test1' et de son lien présent sur ':Test' import re wiki.pages.delete('Test1') newpage=re.sub('\[\[Test1\]\]', `, wiki.pages.get('Test')) wiki.pages.set('Test', newpage, sum='XML-RPC', minor=True)
Recherche par date
from datetime import datetime wiki.pages.changes(datetime(2023, 9, 1).timestamp())
Trouver les pages non référencées
Avec l'extension Dokuwiki
- orphanswanted plugin
Avec l'API
no_backlink = [] for page in wiki.pages.list(): back_links = wiki.pages.backlinks(page['id']) #print(page['id'], '\t', back_links) if not back_links: no_backlink.append(page['id']) #print('\t\t\t', page['id']) print(no_backlink)
En ligne de commande avec PHP
su - dokuwiki -s /bin/bash -c "php ${DOKUROOT}/bin/wantedpages.php | egrep -v 'playground:playground|sidebar|some:namespaces|wiki:nonexisting|wiki:pagename'"
