Skip to content

Instantly share code, notes, and snippets.

@02strich
02strich / Python_XML_Parsing.md
Created March 28, 2020 15:52
XML Parsing - a performance study

Data Set

ted_lsp_latency_2.xml: 426M with 3,187,102 tags

xmllint ~  Desktop  time xmllint -noout ted_lsp_latency_2.xml

real 0m13.399s user 0m11.707s sys 0m1.668s

@02strich
02strich / keybase.md
Created January 17, 2018 05:55
Proof for keybase.io

Keybase proof

I hereby claim:

  • I am 02strich on github.
  • I am 02strich (https://keybase.io/02strich) on keybase.
  • I have a public key ASB5ICFfXbA4TMXdbrXE8oRyKsd0nZj_C8lMgNDxGWEkUwo

To claim this, I am signing this object:

@02strich
02strich / handler.py
Created November 20, 2017 06:33
apple_product_checker
import boto3
import os
from urllib.request import urlopen
import json
# could be for example: apple_product_code = MQAQ2LL/A
APPLE_PRODUCT_CODE = os.environ['apple_product_code'] # URL of the site to check, stored in the site environment variable
def lambda_handler(event, context):
@02strich
02strich / check_mk_twilio.py
Created May 16, 2014 13:48
Twilio Notifications for Check MK
#!/usr/bin/env python
# Send Notifications via SMS (twilio)
import os
import logging
from twilio.rest import TwilioRestClient
ACCOUNT_SID = "<<YOUR SID>>"
AUTH_TOKEN = "<<YOUR TOKEN>>"
import socket
import random
IP = "192.168.178.2"
SID = random.randint(0,10000)
CSEQ = 0
class RtspSession(object):
def __init__(self, remote):
self.client_id = random.randint(0,10000)
@02strich
02strich / convert_mw_template.py
Created March 5, 2014 15:11
Wiki Migration Scripts
import os
import os.path
import sys
import shutil
IN_DIR = "servers/"
PROCESSED_DIR = "servers-processed/"
OUT_DIR = "sysadmin/Servers/"
PREFIX_MAP = {
@02strich
02strich / people-list.vm
Created February 28, 2014 08:53
Confluence People List User Macro
## Macro title: People List
## Macro has a body: N
## Body processing: no body
## Output: Selected output option
##
## Developed by: Stefan Richter
## Date created: 28/02/2014
## Installed by: Stefan Richter
## This is the people list
@02strich
02strich / 0_reuse_code.js
Created January 29, 2014 18:48
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@02strich
02strich / dlna_proxy.py
Created May 2, 2013 19:33
DLNA Proxy (including SSDP and Multicast)
import socket, thread, sys
import logging
BUFLEN = 1024
logger = logging.getLogger(__name__)
class DLNAProxy(object):
MEDIASERVER_IP = ""
@02strich
02strich / celeryd
Created November 27, 2012 12:31
CeleryD init script with start-stop-daemon
#!/bin/sh -e
# ============================================
# celeryd - Starts the Celery worker daemon.
# ============================================
#
# :Usage: /etc/init.d/celeryd {start|stop|force-reload|restart|try-restart|status}
# :Configuration file: /etc/default/celeryd
#
# See http://docs.celeryproject.org/en/latest/tutorials/daemonizing.html#generic-init-scripts