Skip to content

Instantly share code, notes, and snippets.

View rtyler's full-sized avatar

R. Tyler Croy rtyler

View GitHub Profile
@rtyler
rtyler / 0_readme.adoc
Last active May 25, 2020 18:27
trying to reproduce a BufReader error in async_std.

Reproducing errors in async-std/async-tls

The binary and client.rb can both be run in plaintext mode (no arguments) and everything will work out fine. When both are run with the tls argument, the error can be reproduced, e.g ruby client.rb tls and ./target/debug/big-async-reader tls

---
thread 'main' panicked at 'assertion failed: `(left == right)`
  left: `32768`,
 right: `0`', <::std::macros::panic macros>:5:6
stack backtrace:
@rtyler
rtyler / gitlab-to-csv.sh
Created April 2, 2020 19:17
Generate a CSV dump of project information from GitLab
#!/bin/bash
#
# This script can be used as a starting point for generating a spreadsheet of
# GitLab projects, with their properties, from an existing GitLab instance
#
# You must set a GitLab access token via the GITLAB_TOKEN env variable
#
# Invoke with ./gitlab-to-csv.sh <gitlab hostname>
[user]
name = R. Tyler Croy
email = rtyler@brokenco.de
signingkey = BEF6CEA2
[github]
user = rtyler
[pack]
threads = 2
[core]
packedgitlimit = 1G
@rtyler
rtyler / v-edit
Last active April 18, 2020 07:17
Simple Vault editing script
#!/bin/bash
VAULT_KEY=$1
FORMAT=${2:-yaml}
export WORK_FILE=$(mktemp).yml
EDITOR=${EDITOR:-vim}
function cleanup {
rm -f ${WORK_FILE}
}
#!/bin/sh
ZOOMHOME=$HOME/scratch/zoom
# To make audio work, pulseaudio needs to be configured to listen on the
# network via paprefs
exec docker run --rm \
--net host \
--cpuset-cpus 2 \
@rtyler
rtyler / Jenkinsfile
Last active April 24, 2024 05:54
Docker in docker within Jenkins on Kubernetes. Eat at Arby's.
pipeline {
agent {
kubernetes {
label 'dind'
defaultContainer 'docker'
yaml """
---
apiVersion: v1
kind: Pod
metadata:
@rtyler
rtyler / build.gradle
Created May 25, 2019 18:18
A quick example pre-compiling JRuby before stuffing it into a .jar file.
plugins {
id 'java'
id "com.github.jruby-gradle.base" version "1.7.0"
id "com.github.jruby-gradle.jar" version "1.7.0"
}
import com.github.jrubygradle.JRubyExec
dependencies {
jrubyJar "rubygems:state_machines:0.5.0"
➜ redspark git:(master) ✗ spark-submit --class "org.jruby.Main" --master local\[4\] --verbose build/libs/redspark-jruby-1.0-SNAPSHOT.jar simple.rb [30/608]
Using properties file: null
19/05/18 18:13:22 WARN Utils: Your hostname, grape resolves to a loopback address: 127.0.0.1; using 192.168.1.102 instead (on interface wlp58s0)
19/05/18 18:13:22 WARN Utils: Set SPARK_LOCAL_IP if you need to bind to another address
Parsed arguments:
master local[4]
deployMode null
@rtyler
rtyler / Cargo.toml
Created April 4, 2019 22:55
An example of a Rurst rdkafka producer publishing to an Azure Event Hub
[package]
name = "rustyhub"
version = "0.1.0"
authors = ["R. Tyler Croy <rtyler@brokenco.de>"]
edition = "2018"
[dependencies]
futures = "~0.1.21"
clap = "~2.32.0"
@rtyler
rtyler / main.adb
Last active November 9, 2018 17:43
with MicroBit.Display;
with MicroBit.SPI;
with MicroBit.Buttons; use MicroBit.Buttons;
with MicroBit.Time;
with HAL.Bitmap;
with ST7735R; use ST7735R;
with nRF51.Device;
procedure Main is