Skip to content

Instantly share code, notes, and snippets.


Mischa Spiegelmock revmischa

Block or report user

Report or block revmischa

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

Keybase proof

I hereby claim:

  • I am revmischa on github.
  • I am cybermischa ( on keybase.
  • I have a public key ASA2gwimJ5iuAryMq_bkJ9OECR-6vpSHXoeCAGg_-GlY-Ao

To claim this, I am signing this object:

from random import uniform, randint
from locust import TaskSequence, HttpLocust
from locust import seq_task
import random
import string
import os
def randomStringDigits(stringLength=6):
"""Generate a random string of letters and digits """
revmischa / serverless.yml
Last active Apr 11, 2019
Serverless CloudFormation to provide private RDS and lambda networking with internet access in VPC.
View serverless.yml
- serverless-pseudo-parameters
name: aws
runtime: python3.7
stage: ${opt:stage, 'dev'}
revmischa / response_unwrap.kt
Created Mar 11, 2019
Always unwrap a JSON response key using Retrofit/Moshi/Kotlin
View response_unwrap.kt
// for parsing "data" out of every response object
class ItemTypeAdapterFactory : TypeAdapterFactory {
override fun <T> create(gson: Gson, type: TypeToken<T>): TypeAdapter<T> {
val delegate = gson.getDelegateAdapter(this, type)
val elementAdapter = gson.getAdapter(
return object : TypeAdapter<T>() {
override fun write(out: JsonWriter, value: T) {
revmischa / sdl_version_check.m4
Last active Feb 9, 2019
Autoconf m4 to check if minimum SDL library version exists
View sdl_version_check.m4
AC_ARG_ENABLE([sdl], AS_HELP_STRING([--enable-sdl], [Build SDL2 application]), [], [enable_sdl=check])
AS_IF([test "$enable_sdl" != "no"], [
AS_IF([test "$TRAVIS"], [SDL_VERSION=2.0.2]) # travis has old SDL, we don't care
AS_IF([test "$EMSCRIPTEN"], [SDL_VERSION=2.0.0]) # emscripten has old SDL, we don't care
# Check for libSDL >= $SDL_VERSION
revmischa /
Created Jan 15, 2019
Twilio call handler lambda
from twilio.twiml.voice_response import VoiceResponse, Dial
from import Client
from urllib.parse import parse_qsl
import requests
import json
from pprint import pprint
import boto3
session = boto3.session.Session()
revmischa /
Last active Oct 27, 2017
European Bash Prompt ($PS1)
if [[ `whoami` == "root" ]]; then
# Git branch in prompt.
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(❲.*\)/ ❲\1❳/'
# git status
parse_git_dirty() {
revmischa /
Last active Nov 20, 2018
Heroku logplex syslog handler lambda
"""Sample handler for parsing Heroku logplex drain events (
Expects messages to be framed with the syslog TCP octet counting method (
This is designed to be run as a Python3.6 lambda.
import json
import boto3
import logging
import iso8601
revmischa /
Created Jun 13, 2017
Open IoT Security Certification Draft

Level I - Basic



  • No default username/password
    • Devices must not ship with a well-known username and/or password
      • Unless the password must be changed on first use No backdoor passwords in firmware. This can be dumped and reversed and published.
revmischa /
Last active Nov 20, 2016
Deferred jobs with sqlalchemy/flask/apscheduler
# sample usage:
class MyFlaskApp(Flask):
def start_heartbeat(self):
"""Schedule periodic heartbeat updates."""
if hasattr(self, 'heartbeat_sched'):
raise Exception("Heartbeat already started")
sched = self.get_scheduler()
self.heartbeat_sched = sched
You can’t perform that action at this time.