Skip to content

Instantly share code, notes, and snippets.

View mjpitz's full-sized avatar
🏳️‍🌈
out and proud

Mya mjpitz

🏳️‍🌈
out and proud
View GitHub Profile
@mjpitz
mjpitz / storj_uplink_oidc.go
Created September 7, 2022 16:43
Some rough code used to obtain access to storj using OIDC
package main_test
func Test(t testing.T) {
testplanet.Test(
storagenodetp.Configure(...),
satellitetp.Configure(...),
)(func() {})
}

Keybase proof

I hereby claim:

  • I am mjpitz on github.
  • I am mjpitz (https://keybase.io/mjpitz) on keybase.
  • I have a public key ASAZhypY8jMENYr7mgIk7AijguSzbO9acsBYDamMX4cNSgo

To claim this, I am signing this object:

@mjpitz
mjpitz / storj-upload-server.js
Last active February 15, 2022 21:29
Pseudocode for performing an upload using a chunked HTTP request
// The guide online generally works, but has values that do not correspond to the primary active satellites.
// https://github.com/storj-thirdparty/uplink-nodejs/blob/7fb4a9ab35b04c7338d503d6d3d76d9264c53867/docs/tutorial.md
const http = require('http');
// Step 2 / 3
const storj = require("uplink-nodejs");
const uplink = new storj.Uplink();
// Step 1
@mjpitz
mjpitz / appscripts.md
Last active January 13, 2022 16:38
Various Google AppScripts that I have.

Scripts for https://script.google.com/home/start

Create the project:

  1. Click new "New Project"
  2. Delete the contents of the default project
  3. Paste one of the following snippets into the editor
  4. Name and save your project
  5. In the editor bar, select the function that you want to run (for the tadpoles script, select imageDownloader)
  6. Run the function and grant it the required permissions.
@mjpitz
mjpitz / io_performance.go
Last active October 15, 2021 13:41
A quick look at the performance of different encoding / serialization protocols
package io_test
import (
"bytes"
"encoding/binary"
"encoding/hex"
"encoding/json"
"testing"
"time"
@mjpitz
mjpitz / Dockerfile
Created July 8, 2021 15:26
Dockerfile for RedisRaft build
FROM ubuntu:21.04 AS builder
WORKDIR /scratch
RUN apt-get update -y && apt-get install -y ca-certificates git build-essential libtool cmake libbsd-dev peg
ARG REDISRAFT_VERSION="4bbf5af1"
RUN git clone https://github.com/RedisLabs/redisraft.git redisraft && \
cd redisraft && \
git checkout ${REDISRAFT_VERSION} && \
@mjpitz
mjpitz / _README.md
Last active August 1, 2024 21:43
comparison of embedded databases for raft

As an exercise, I started to design and implement a database in some of my free time. As I started working through some of the details, there were a few things that I knew I wanted to work with and a few things I wanted to evaluate. Since I'm looking at more of a CP system, my mind immediately jumped to Raft. But which implemenation to use? And what storage mechanism? Since I had more familiarity with Hashicorps implemenation, I started there.

The first thing I wanted to do was consider the performance characteristics of the underlying data stores. One of the nice features of the hashicorp implementation is it allows callers to plugin in different stores for logs, stable, and snapshots. There's a whole slew of community implementations.

@mjpitz
mjpitz / _README.md
Last active May 29, 2021 00:58
dgraph troubles

Three files:

  • schema.gql contains the type definitions I inserted into dgraph.
  • seed.rdf contains the set definition used to populate the database with associated information.
  • query.gql contains the dql query I'm trying to execute based on the examples...

When I run the query I get no results back. I've tried this at all sorts of different parts of the simple tree. Can't get any information anywhere. Can see data stored in the system just can't access it.

@mjpitz
mjpitz / kube-zsh-rprompt.zsh
Created March 9, 2021 04:14
embed some kube context in your zsh shell
kubeconfig="${KUBECONFIG}"
if [[ -z "${kubeconfig}" ]]; then
kubeconfig="$(mktemp):$(ls -1 ${HOME}/.kube/*.yaml | tr $'\n' ':')${HOME}/.kube/config"
fi
export KUBECONFIG="${kubeconfig}"
function zsh_kube_prompt() {
zsh_kube_context=$(kubectl config current-context)
zsh_kube_authinfo=$(kubectl config get-contexts "${zsh_kube_context}" --no-headers | awk '{print $4}')
zsh_kube_ns=$(kubectl config get-contexts "${zsh_kube_context}" --no-headers | awk '{print $5}')