Skip to content

Instantly share code, notes, and snippets.

View mathieue's full-sized avatar

Mathieu Elie mathieue

View GitHub Profile
@mathieue
mathieue / TP ELK
Last active April 24, 2024 14:48
TP ELK
Se connecter avec le user elastic.
Aller dans management -> roles
Créer un role.
Le nommer log_view.
Mettre l'ccés en lecture à kibana_sample_data_log.
Créer un utilisateur.
@mathieue
mathieue / udp-multi-socat.sh
Created August 28, 2012 23:57
udp multiplexer with socat
socat - udp4-listen:8125,fork | tee >(socat - udp-sendto:127.0.0.1:8135) >(socat - udp-sendto:127.0.0.1:8140)
output.file:
path: "chemin/vers/le/dossier/de/sortie"
filename: winlogbeat
rotate_every_kb: 10000
number_of_files: 7
codec.json:
pretty: false
output.file:
path: "chemin/vers/le/dossier/de/sortie"
@mathieue
mathieue / UpdateLogstashLogging.ps1
Created November 27, 2023 14:48
UpdateLogstashLogging.ps1
$headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
$headers.Add("Content-Type", "application/json")
$body = '{ "logger.logstash.inputs.jdbc" : "ERROR" }'
$url = 'http://localhost:9600/_node/logging?pretty'
$response = Invoke-RestMethod -Uri $url -Method 'PUT' -Headers $headers -Body $body
@mathieue
mathieue / socat-tty.sh
Created August 7, 2012 21:21
socat read tty serial and provide a server to read serial output
socat -d -d tcp-l:1234,reuseaddr,fork file:/dev/ttyUSB0,nonblock,raw,echo=0,waitlock=/var/run/tty,min=0,b38400
@mathieue
mathieue / 6379.conf
Last active April 23, 2022 16:23
redis conf with disk persistance
## Generated by install_server.sh ##
# Redis configuration file example
# Note on units: when memory size is needed, it is possible to specify
# it in the usual form of 1k 5GB 4M and so forth:
#
# 1k => 1000 bytes
# 1kb => 1024 bytes
# 1m => 1000000 bytes
# 1mb => 1024*1024 bytes
TP SECU
Dans le fichier de configuration elasticsearch.yml
xpack.security.enabled: true
Relancer elasticsearch.
Se connecter a kibana: est-il accessible ?
Se connecter a elasticsearch sur le port 9200: est-il accessible ?
@mathieue
mathieue / reverse.es
Created June 29, 2012 09:11
Simple apache read only reverse proxy on elasticsearch
<VirtualHost *:80>
ServerName es.yourhost.com
<Proxy balancer://main>
BalancerMember http://127.0.0.1:9200 max=1 retry=5
<Limit GET >
order deny,allow
deny from all
allow from 127.0.0.1
@mathieue
mathieue / playlist-converter-node.js
Last active January 14, 2019 14:04
Export a playlist to any service calling Playlist Converter Api with nodejs.
console.log("runing playlist converter api demo....");
var name = "Super Playlist";
var tracks = [];
tracks.push("Shape of You Ed Sheeran");
tracks.push("One Dance Drake");
let tracksJoined = tracks.join("\n");
@mathieue
mathieue / install-nginx-munin-debian.sh
Created October 2, 2012 12:19
Install nginx with munin plugins on debian
apt-get install munin-plugins-extra libio-all-lwp-perl
echo "[nginx_*]
env.url http://localhost/nginx_status
" > /etc/munin/plugin-conf.d/nginx
vi /etc/nginx/sites-available/default
# in server section
location /nginx_status {
stub_status on;
access_log off;