Skip to content

Instantly share code, notes, and snippets.


David Rio Deiros drio

View GitHub Profile
View metadata.staging.xml
<EntityDescriptor xmlns="urn:oasis:names:tc:SAML:2.0:metadata" validUntil="2022-03-31T17:10:39.744Z" entityID="">
<SPSSODescriptor xmlns="urn:oasis:names:tc:SAML:2.0:metadata" validUntil="2022-03-31T17:10:39.743793359Z" protocolSupportEnumeration="urn:oasis:names:tc:SAML:2.0:protocol" AuthnRequestsSigned="false" WantAssertionsSigned="true">
<KeyDescriptor use="encryption">
<KeyInfo xmlns="">
<X509Data xmlns="">
<X509Certificate xmlns="">MIICqjCCAZICCQC6eUzsDXLswzANBgkqhkiG9w0BAQsFADAXMRUwEwYDVQQDDAwuZXhhbXBsZS5jb20wHhcNMjIwMzA5MjEwMzA4WhcNMjMwMzA5MjEwMzA4WjAXMRUwEwYDVQQDDAwuZXhhbXBsZS5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCxSkMqXJKLrCp5Ywugxw2/oUcyGkqFNQqOn7Uf/TTCGYZMKjCnd88dXbPpMMDH8O17TJxS4pygCzXSUXZyWicDrnwOmteNvfYJGehFCbzL1fit7PmAbpdra6Q/baCfQm+R6Jpm9CVyIm6WkKeXUcYymb4RyCSIqHZ1vP0oUmQUL47bdBuoDxt/YULH6SQjxzgI4wEAETgM1c6oKFmZu5
View saml-flow-samltestid.txt
2022-03-17 11:16:27,681 - DEBUG [PROTOCOL_MESSAGE:?] -
<?xml version="1.0" encoding="UTF-8"?>
IssueInstant="2022-03-17T11:16:27.575Z" Version="2.0"
xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion" xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol">
<saml:Issuer Format="urn:oasis:names:tc:SAML:2.0:nameid-format:entity"></saml:Issuer>
View saml-sp-server.go
// vim: set foldmethod=indent foldlevel=1 et:
package main
import (
drio /
Last active Feb 19, 2022
Benchmark fastq reads

Nine years ago I was doing a lot of bioinformatics work. I was also writing golang code to learn the language and see if I could use it for my daily programming tasks.

At the same time I came across a set of benchmarks that tested how fast different programming languages could read fastq files. The winner was a heavily optimized c program.

Naturally, I decided to write an implementation in golang. My first attempt did not do better than the c version (didn't do that bad either -- same order of magnitude if I remember correctly). But with the help of the golang community I ended up writing a version that was faster than the c implementation.

Fast forward 9 years. I came across this article that discusses how the different versions of golang have been cons

View gist:9aed19c2c60c825064889abae70c19f4
from confluent_kafka import Producer
class SimpleProducer:
def __init__(self, brokers: str):
config = {'bootstrap.servers': brokers, '': 1,
'message.send.max.retries': 5, '': 200,
'message.max.bytes': 104857600,
'default.topic.config': {'request.required.acks': 'all'}}
View gist:afa0d4e13c872f28ec2a9f4d5ab6d97a
from confluent_kafka import Consumer, KafkaError, OFFSET_BEGINNING
class SimpleConsumer:
def __init__(self, brokers: str, topic: str, consumer_group: str):
self.topic = topic
self.config = {
'bootstrap.servers': brokers,
'': consumer_group,
View gist:b5262a864df722ade9ba311fca0e9250
from confluent_kafka import Consumer, KafkaException
import sys
import getopt
import json
import logging
from pprint import pformat
config = {
View Makefile
BASEDIR=$(shell basename $(PWD))
PRJ_DIR:=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
ifeq '$(shell hostname -s)' 'hadoop-prod-04'
KB=@docker run -it -v "/home/driode01/kafka-area/":/stuff/ --network=host confluentinc/cp-kafka
View Makefile
BASEDIR=$(shell basename $(PWD))
PRJ_DIR:=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
ifeq '$(shell hostname -s)' 'hadoop-prod-04'
KB=@docker run -it -v "/home/driode01/kafka-area/":/stuff/ --network=host confluentinc/cp-kafka
drio / Makefile
Last active Dec 17, 2021
log4j bug checker
View Makefile
# To make sure some binaries exists in path
BINARIES = curl sh python3
K := $(foreach exec,$(BINARIES),\
$(if $(shell which $(exec)),some string,$(error "No $(exec) in PATH")))
define PARSE
import json