Skip to content

Instantly share code, notes, and snippets.

@rdeva31
rdeva31 / analytics.c
Created November 20, 2017 06:27
Proof of concept
#include <alloca.h>
#include <errno.h>
#include <printf.h>
#include <stdio.h>
#include <stdarg.h>
#include <stdint.h>
#include <string.h>
#define MAX_ANALYTICS_RECORDS 256
puts <<EOS
[ 0.000000] event foo.bar START
[ 0.500000] some other generic log that should be ignored
[ 1.000000] event foo.bar STOP
[ 2.000000] event foo.bar START
[ 5.000000] event foo.bar STOP
[ 6.000000] event foo.qux START
[ 7.000000] event foo.qux STOP
EOS
.split("\n")
#!/usr/bin/ruby
#
# Vertical print
#
# 1. Print a word vertically. e.g. "one" should print as:
#
# o
# n
# e
#
@rdeva31
rdeva31 / analdoc.py
Last active March 27, 2017 06:07
Generates documentation in lookml or markdown format for nodelib
#!python3
# ANALytics DOCumentation generator
# ---------------------------------
# Generates documentation in lookml or markdown format. Example usage:
# ./analdoc.py --markdown nodelib/**/*.py
#
# Assumes that all events are properly documented in a specific format, e.g.:
# nodelib.record_event('foo.bar', baz=True, qux=phase_of_moon(),
# documentation="""
@rdeva31
rdeva31 / test_mg1.py
Last active March 23, 2017 22:06
Script to stress test MG1
from nodelib.utils import get_config
import logging.config
import logging
logging.config.dictConfig(get_config('/etc/nodelib.conf')['logging'])
log = logging.getLogger('Mg1Test')
from nodelib.system.common.mg1 import *
import sys