Skip to content

Instantly share code, notes, and snippets.



View GitHub Profile
Enteee /
Created Aug 27, 2019
ucmdb-api example
import random
import string
'ucmdbId': i,
'type': 'node',
'properties': {
'name': ''.join(random.choices(string.ascii_uppercase + string.digits, k=N))
Enteee /
Last active Aug 6, 2019
Demonstrate operating syste dependent behaviour w.r.t static class members in subprocess
from multiprocessing import Process
class C(object):
def print_c():
print(f'C.VAR = {C.VAR}')
def main():
Enteee / events.js
Last active Aug 5, 2019
FluentFlow Example: If you see within 2 seconds two invalid login attemps followed by a successful login from the same source, then alert.
View events.js
const ff = require('fluentflow')
const $ = ff.RuleBuilder;
const _ = require('lodash');
const moment = require('moment')
* Not interesting if older than 2 seconds
function isInteresting(c, pc){
return moment.duration(
Enteee /
Last active Sep 25, 2019 — forked from Gems/
A `docker-compose` wrapper for multiple configuration files with relative paths
#!/usr/bin/env bash
# Docker compose wrapper with submodule support
# Reads all docker-compose.yaml files given with -f / --files and compiles one
# big docker-compose.yaml file before running docker-compose.
# This is useful when you have nested docker-compose subprojects in different
# folders which contain relative paths.
# see:
# Environment:
Enteee / :for
Last active Dec 27, 2018
Bash: Parallel execute and retain exit code
View :for
#!/usr/bin/env bash
# Wait for pids to terminate. If one pid exits with
# a non zero exit code, send the TERM signal to all
# processes and retain that exit code
# usage:
# :wait 123 32
function :wait(){
local pids=("$@")
Enteee /
Created Oct 7, 2017
Check eval(repr(cls())) == cls() for whole package
#!/usr/bin/env python3
# vim: set fenc=utf8 ts=4 sw=4 et :
Tests the follwoing rules for a whole package:
1. Repr is unique: All classes must implement __repr__ with eval(repr(cls())) == cls()
import unittest
Enteee / Makefile
Last active Aug 11, 2016
scanf userland & kernelspace test
View Makefile
.PHONY: all runtest
MODULES_DIR := /lib/modules/$(shell uname -r)
obj-m := test.o
all: test test.ko
You can’t perform that action at this time.