Skip to content

Instantly share code, notes, and snippets.

Avatar
🐌

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="https://staging.drtufts.net/saml/metadata">
<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="http://www.w3.org/2000/09/xmldsig#">
<X509Data xmlns="http://www.w3.org/2000/09/xmldsig#">
<X509Certificate xmlns="http://www.w3.org/2000/09/xmldsig#">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"?>
<samlp:LogoutRequest
Destination="https://samltest.id/idp/profile/SAML2/Redirect/SLO"
ID="id-b92224d213b3905baf9a184d92170c5d9f98ec56"
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">https://staging.drtufts.net/saml/metadata</saml:Issuer>
<saml:NameID
Format="urn:oasis:names:tc:SAML:2.0:nameid-format:transient"
View saml-sp-server.go
// vim: set foldmethod=indent foldlevel=1 et:
package main
import (
"context"
"crypto/rsa"
"crypto/tls"
"crypto/x509"
"flag"
"fmt"
@drio
drio / fastq-nine-years-later.md
Last active Feb 19, 2022
Benchmark fastq reads
View fastq-nine-years-later.md

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, 'queue.buffering.max.ms': 1,
'message.send.max.retries': 5, 'retry.backoff.ms': 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,
'group.id': consumer_group,
View gist:b5262a864df722ade9ba311fca0e9250
#!./.venv/bin/python3
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))))
SSH_HOST=h4
GROUP=ss1
OFFSET=0
KB=
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))))
SSH_HOST=h4
GROUP=ss1
OFFSET=0
KB=""
ifeq '$(shell hostname -s)' 'hadoop-prod-04'
KB=@docker run -it -v "/home/driode01/kafka-area/":/stuff/ --network=host confluentinc/cp-kafka
@drio
drio / Makefile
Last active Dec 17, 2021
log4j bug checker
View Makefile
BIN_DIR=./bin
L4J_ID=CVE-2021-44228
# 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