Skip to content

Instantly share code, notes, and snippets.

View hardbyte's full-sized avatar

Brian Thorne hardbyte

View GitHub Profile
@hardbyte
hardbyte / miniopatch.py
Created April 7, 2020 11:42
Add AssumeRole support to Minio
from datetime import datetime
import hmac
import hashlib
import xml.etree.ElementTree
from urllib.parse import urlencode
from minio.credentials import Static, Credentials
from minio.fold_case_dict import FoldCaseDict
from minio.compat import urlsplit
from minio.helpers import get_sha256_hexdigest
@hardbyte
hardbyte / pull-feature-design.md
Last active April 6, 2020 02:58
Pull feature for Anonlink Entity Service

Add data pull feature to Anonlink Entity Service

Author: Brian Thorne Status: Draft Created: 2020-03-31 Updated: 2020-04-06

Abstract/Purpose

In early 2020 blocking has been added to increase the capacity of the Anonlink system, however the system cannot

@hardbyte
hardbyte / Julia Popcount.ipynb
Last active January 13, 2019 11:43
Making sure Julia can count bits.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@hardbyte
hardbyte / Automated TLS certificates on k8s.md
Last active September 17, 2018 22:00
Free automated TLS certificates on k8s

Cross posted from blog.n1analytics.com

At N1 Analytics we use Kubernetes for running experiments, continuous integration testing and deployment. In this post I document setting up a Kubernetes cluster to automatically provision TLS certificates from Let's Encrypt using Jetstack's Certificate Manager, the helm package manager and the nginx-ingress controller.

I wrote this after migrating our cluster from traefik to use cert manager and nginx-ingress. The end state will be one where we can create Kubernetes ingress with a TLS certificate with only a set of annotations in the respective helm template.

I'm going to assume some background knowlege for this post, if you haven't heard of [Let's Encrypt](https://letsencrypt.org/abou

@hardbyte
hardbyte / UntypedSimplePrime.java
Created October 26, 2017 03:34
Untyped Simple Prime Akka example
package com.lightbend.akka.sample;
import akka.actor.Props;
import akka.actor.UntypedAbstractActor;
class UntyptedSimplePrime {
static class IsPrimeActor extends UntypedAbstractActor {
// Define the messages
@hardbyte
hardbyte / StatelessPrime.java
Created October 26, 2017 03:10
Stateless Akka Prime Example
package com.lightbend.akka.sample;
import akka.actor.AbstractLoggingActor;
import akka.actor.Props;
import java.util.HashMap;
import java.util.Map;
class StatelessPrime {
@hardbyte
hardbyte / StatefulPrime.java
Last active October 26, 2017 03:15
Statefull Akka Prime Example
package com.lightbend.akka.sample;
import akka.actor.*;
public class StatefulPrime {
static class IsPrimeActor extends AbstractLoggingActor {
// Define the actor protocol
static class IsPrimeRequest {
import phe as paillier
import numpy as np
import pickle
class SecretKey():
def __init__(self,sk):
self.sk = sk
def decrypt(self,x):
@hardbyte
hardbyte / cansqlquery.py
Created March 17, 2017 23:47
Simple example access of sql database of can frames.
import sqlite3
import numpy as np
logfile = "output.db"
conn = sqlite3.connect(logfile)
c = conn.cursor()
c.execute("SELECT COUNT() FROM messages")

Keybase proof

I hereby claim:

  • I am hardbyte on github.
  • I am hardbyte (https://keybase.io/hardbyte) on keybase.
  • I have a public key whose fingerprint is E49A A499 5C2B 735C CB01 EA5E 22AD F3BF C183 47DE

To claim this, I am signing this object: