This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
import string | |
N=20 | |
api.insert([ | |
{ | |
'ucmdbId': i, | |
'type': 'node', | |
'properties': { | |
'name': ''.join(random.choices(string.ascii_uppercase + string.digits, k=N)) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from multiprocessing import Process | |
class C(object): | |
VAR = 'DEFAULT' | |
def print_c(): | |
print(f'C.VAR = {C.VAR}') | |
def main(): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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: https://github.com/docker/compose/issues/3874 | |
# | |
# Environment: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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=("$@") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.PHONY: all runtest | |
MODULES_DIR := /lib/modules/$(shell uname -r) | |
KERNEL_DIR := $(MODULES_DIR)/build | |
obj-m := test.o | |
all: test test.ko |