Skip to content

Instantly share code, notes, and snippets.


Ionel Cristian Mărieș ionelmc

Block or report user

Report or block ionelmc

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View cheatsheet.rst
watch --difference=cummulative --interval=1 '(echo device read_IOs read_merges read_sectors read_ticks write_IOs write_merges write_sectors write_ticks in_flight io_ticks time_in_queue; for file in /sys/block/*/stat; do echo -n $file; cat $file; done) | column -t'
#device read_IOs read_merges read_sectors read_ticks write_IOs write_merges write_sectors write_ticks in_flight io_ticks time_in_queue
#/sys/block/dm-0/stat 116962 0 2212746 314096 7705653 0 150218536 609670232 0 644428 610921004
#/sys/block/dm-1/stat 116479 0 2208882 313324 7686986 0 150218536 609676068 0 644616 611418072
#/sys/block/dm-2/stat 302 0 2416 780 0 0 0 0 0 148 780
#/sys/block/sda/stat 91181 26273 2217246 74876 7314854 388030 150261802 16954364
ionelmc / .gitignore
Last active Jun 16, 2019
Socat PPA (readline)
ionelmc /
Last active May 29, 2019
VirtualBox automatic shutdown cleaner. Runs in the "notification icon area". When closed by windows it waits for VMs to shutdown (acpi) and if it doesn't work it tries to suspend the VMs.
import logging
import subprocess
import time
import sys
import win32con
import win32gui_struct
import os
import winxpgui as win32gui
except ImportError:
ionelmc / .gitignore
Last active Mar 17, 2019
A JSON parser benchmark. See README.rst for instructions.
View .gitignore
View signalfd-with-threads-sucks.c
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <signal.h>
#include <pthread.h>
#include <sys/signalfd.h>
#include <sys/time.h>
#include <sys/types.h>
#define handle_error(msg) \
ionelmc /
Last active May 21, 2018
A more sophisticated celery fixture (logs + tree term)
from __future__ import print_function
import subprocess
import sys
import time
import psutil
import pytest
ionelmc /
Created May 21, 2018
pytest-django support for subprocesses
def django_db_setup(request,
import pytest_django.compat
def teardown_databases(db_cfg, verbosity, _teardown_databases=pytest_django.compat.teardown_databases):
Converts a dict containing a mongo query to a lambda. Doesn't support all the mongo
query $keywords, probably differs the result in subtle ways.
It only supports querying flat structures: dicts with no lists or other dicts in
them (aka subdocuments).
from __future__ import print_function
import sys
import tempfile
ionelmc /
Last active Mar 17, 2018
Pelican plugin to add permalinks (headerid) to every section header when using reStructuredText. You can see it in action at
from pelican import readers
from pelican.readers import PelicanHTMLTranslator
from pelican import signals
from docutils import nodes
def register():
class HeaderIDPatchedPelicanHTMLTranslator(PelicanHTMLTranslator):
def depart_title(self, node):
close_tag = self.context[-1]
parent = node.parent
You can’t perform that action at this time.