Skip to content

Instantly share code, notes, and snippets.

@almorel
almorel / ffmpeg_h265.sh
Created August 4, 2017 12:45
ffmpeg - Encode DVD HVEC H265
ffmpeg -i concat:VTS_06_1.VOB\|VTS_06_2.VOB\|VTS_06_3.VOB\|VTS_06_4.VOB\|VTS_06_5.VOB\|VTS_06_6.VOB \
-vsync 1 \
-threads 0 \
-aspect 16:9 \
-map 0:v \
-map 0:3 \
-metadata title="TEST" \
-c:v libx265 \
-preset ultrafast \
-x265-params \
@almorel
almorel / payload.pcap
Last active February 15, 2026 05:27
Exemple de filtre pour capturer le payload HTTP
(ip[2:2] - ((ip[0]&0x0f)*4) - ((tcp[12]&0xf0)*4) != 0) and tcp port 80
@almorel
almorel / curl-format.txt
Created March 2, 2015 14:06
curl -w "@curl-format.txt" -o /dev/null -s http://www.google.fr
Size (bytes):\n
size_download : %{size_download}\n
size_header : %{size_header}\n
size_request : %{size_request}\n
size_upload : %{size_upload}\n
\n
Time (s) :\n
time_namelookup : %{time_namelookup}\n
time_connect : %{time_connect}\n
time_appconnect : %{time_appconnect}\n
@almorel
almorel / gist:5771742
Last active December 18, 2015 10:49
Extraction des statistiques d'un serveur TORQUE/MAUI
# Extract des statistiques TORQUE
cat /opt/torque/serv_priv/accounting/2012*|awk -F ';' '{if ($2 ~ '/E'/){print $4}}'|awk '{for (i=1;i<NF;i++){if ($i ~ '/^Exit\|^resources\|^user\|^group\|^Resource\|^queue/'){printf("%s ", $i);}};print ""}'|python -c 'import sys;a=[elt.rstrip().split(" ") for elt in sys.stdin.readlines()]; b=[["".join(subelt.split("=")[1::]) for subelt in elt] for elt in a];c=[";".join(ligne) for ligne in b];print "\n".join(c);'
#include <stdio.h>
#include <stdint.h>
#include <time.h>
int64_t timespecDiff(struct timespec *timeA_p, struct timespec *timeB_p)
{
return ((timeA_p->tv_sec * 1000000000) + timeA_p->tv_nsec) -
((timeB_p->tv_sec * 1000000000) + timeB_p->tv_nsec);
}
@almorel
almorel / cam.py
Created August 25, 2012 13:07
List Cam Table of Juniper EX4200
#!/usr/bin/env python
from pysnmp.entity.rfc3413.oneliner import cmdgen
import re
import struct
import getopt
import sys
import signal
OID_BRIDGE=(1,3,6,1,2,1,17,1,4,1,2)
@almorel
almorel / python-mersenne.py
Created June 1, 2012 15:21
Nombre de Mersenne
import math
for i in range(100):
print pow(2,i)-1
@almorel
almorel / gist:1324368
Created October 29, 2011 12:01
AWK - Supprimer lignes en doubles
cat FICHIER |awk '!x[$0]++'