Skip to content

Instantly share code, notes, and snippets.

View gillg's full-sized avatar

Guillaume GILL gillg

View GitHub Profile
@gillg
gillg / sort.py
Last active March 27, 2020 18:03
Script to sort huge (or small) text files with a complex sort key
#!/usr/bin/env python
# base on Gabriel Genellina http://code.activestate.com/recipes/576755-sorting-big-files-the-python-26-way/
# based on Recipe 466302: Sorting big files the Python 2.4 way
# by Nicolas Lehuen
from __future__ import print_function
import os
import sys
import re
from tempfile import gettempdir
@gillg
gillg / rrd_to_openmetrics.py
Last active December 6, 2023 16:02
Script to convert a set of RRD files (issued from collectd for example) to Open Metrics format (prometheus)
#!/usr/bin/env python
from __future__ import print_function
'''
Usage:
./rrd_to_openmetrics.py /path/rrd_directory/ > openmetrics.txt
'''
'''
Directory structure :