Skip to content

Instantly share code, notes, and snippets.

View odoucet's full-sized avatar

Olivier Doucet odoucet

  • OXEVA
  • Paris, France
View GitHub Profile
@odoucet
odoucet / remove-dstroot-cax3.sh
Created October 4, 2021 08:38
Remove DST Root CA X3
#!/bin/bash
# SOURCE: https://blog.devgenius.io/rhel-centos-7-fix-for-lets-encrypt-change-8af2de587fe4
trust dump --filter "pkcs11:id=%c4%a7%b1%a4%7b%2c%71%fa%db%e1%4b%90%75%ff%c4%15%60%85%89%10" | openssl x509 | sudo tee /etc/pki/ca-trust/source/blacklist/DST-Root-CA-X3.pem
sudo update-ca-trust extract
@odoucet
odoucet / todo
Last active November 29, 2017 18:06
securize-windows
- Supprimer les applications non utilisées, notamment toutes les éventuelles version Office présentes
- applications et fonctionnalités
- Chiffrement BitLocker du disque
- installer Cmder full
- installer Office365 (www.office365.com)
@odoucet
odoucet / fio on zvol with volblocksize=128k
Created November 20, 2017 11:08
bad read performance investigation
random-read: (g=0): rw=randread, bs=256KiB-256KiB,256KiB-256KiB,256KiB-256KiB, ioengine=libaio, iodepth=256
fio-2.18
Starting 1 process
Jobs: 1 (f=1): [r(1)][100.0%][r=27.3MiB/s,w=0KiB/s][r=109,w=0 IOPS][eta 00m:00s]
random-read: (groupid=0, jobs=1): err= 0: pid=5216: Mon Nov 20 11:25:52 2017
read: IOPS=111, BW=27.1MiB/s (29.4MB/s)(1678MiB/60002msec)
slat (usec): min=937, max=48829, avg=8931.40, stdev=4220.94
clat (usec): min=6, max=2544.4k, avg=2225904.59, stdev=255594.73
lat (msec): min=10, max=2560, avg=2234.84, stdev=255.58
clat percentiles (msec):
@odoucet
odoucet / zpool-histogram
Last active November 17, 2017 14:39
ZFS performance issues
# NOTE:
# /dev/zvol/xxxxx/test volume is tested by FIO
# volblocksize 16K
# compression lz4
# usedbydataset 50.4G
# logbias latency
# sync always
xxxxxxx sync_read sync_write async_read async_write scrub
req_size ind agg ind agg ind agg ind agg ind agg
@odoucet
odoucet / agregate-fioresults.php
Last active March 21, 2017 16:13
FIO benchmarking with stats per job
<?php
/**
* Agregate stats per job on a unique file compatible with fio2gnuplot
**/
if (!$argv[1]) {
echo "syntax: ".$argv[0]." <prefix-file>\n";
echo "Example : ".$argv[0]." nametest\n";
}
$tests = array('bw','lat','slat','clat','iops');
@odoucet
odoucet / haproxy-sample.cfg
Created December 27, 2016 16:41
HAProxy bug with balance uri + option prefer-last-server + hash-type consistent
global
pidfile /tmp/haproxytest.pid
defaults
# we do web !
mode http
option httpchk /c
option http-keep-alive
option http-pretend-keepalive
@odoucet
odoucet / haproxy-sample.cfg
Last active May 26, 2016 09:25
HAProxy 1.6.5 bug with "show servers state"
global
chroot /tmp
daemon
group users
user nobody
pidfile /var/run/haproxy.pid
log xxx local2 notice
nbproc 4
server-state-file /tmp/haproxy_server_state
@odoucet
odoucet / proc-slabinfo
Created April 13, 2016 15:16
100% system load with 0.6.5.6 - zfs_znode_hold_enter suspected
slabinfo - version: 2.1
# name <active_objs> <num_objs> <objsize> <objperslab> <pagesperslab> : tunables <limit> <batchcount> <sharedfactor> : slabdata <active_slabs> <num_slabs> <sharedavail>
lio_r2t_cache 285 531 64 59 1 : tunables 120 60 8 : slabdata 9 9 0
lio_ooo_cache 0 0 64 59 1 : tunables 120 60 8 : slabdata 0 0 0
lio_dr_cache 325 413 64 59 1 : tunables 120 60 8 : slabdata 7 7 0
lio_qr_cache 996 1120 32 112 1 : tunables 120 60 8 : slabdata 10 10 0
lio_cmd_cache 476 489 1216 3 1 : tunables 24 12 8 : slabdata 163 163 108
t10_alua_tg_pt_gp_mem_cache 124 154 48 77 1 : tunables 120 60 8 : slabdata 2 2 0
t10_alua_tg_pt_gp_cache 124 176 248 16 1 : tunables 120 60 8 : slabdata 11 11 0
t10_alua_lu_gp_mem_cache 124 385 48 77 1
@odoucet
odoucet / parse_namedstats.php
Last active September 8, 2015 13:36
Named statistics parser into CSV
<?php
$fp = fopen('/etc/named/named.stats', 'r');
$data = array();
$start = false;
$currentHost = '';
while($line = fgets($fp, 1024)) {
if (strpos($line, 'Per Zone Query Statistics ') !== false) {
@odoucet
odoucet / modsecurity_id_extractor.php
Created May 6, 2015 12:23
Extract modsecurity rule ID from modsec_audit.log
<?php
/***************
* Extract rule ID from modsecurity log
* and print TOP hits by rule ID
*
* @author github.com/odoucet
*
* useful when using mod_security as DETECTION_ONLY mode
*
* USAGE :