Skip to content

Instantly share code, notes, and snippets.

View .gitconfig
[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 Apr 18, 2020
Simple Vault editing script
View v-edit
#!/bin/bash
VAULT_KEY=$1
FORMAT=${2:-yaml}
export WORK_FILE=$(mktemp).yml
EDITOR=${EDITOR:-vim}
function cleanup {
rm -f ${WORK_FILE}
}
View zoom
#!/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 Feb 14, 2022
Docker in docker within Jenkins on Kubernetes. Eat at Arby's.
View Jenkinsfile
pipeline {
agent {
kubernetes {
label 'dind'
defaultContainer 'docker'
yaml """
---
apiVersion: v1
kind: Pod
metadata:
@rtyler
rtyler / build.gradle
Created May 25, 2019
A quick example pre-compiling JRuby before stuffing it into a .jar file.
View build.gradle
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"
View gist:b24e399dd38546af11389482362faa44
➜ 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 Apr 4, 2019
An example of a Rurst rdkafka producer publishing to an Azure Event Hub
View Cargo.toml
[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"
View main.adb
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
@rtyler
rtyler / check-updates
Created Sep 28, 2018
A simple script to update a pom.xml for the latest updates
View check-updates
#!/usr/bin/env bash
DEPENDS=$(xmlstarlet sel -N x='http://maven.apache.org/POM/4.0.0' \
-t -m x:project/x:dependencies/x:dependency \
-v x:artifactId -o ' ' \
pom.xml)
if [ ! -f update-center.actual.json ]; then
wget https://updates.jenkins.io/update-center.actual.json;
fi;
@rtyler
rtyler / upload-to-azure.sh
Created Jan 4, 2018
A bash script which supports uploading blobs to Azure Storage: ./upload-to-azure.sh [filename]
View upload-to-azure.sh
#!/usr/bin/env bash
FILENAME=${1}
# expected to be defined in the environment
# - AZURE_STORAGE_ACCOUNT
# - AZURE_CONTAINER_NAME
# - AZURE_ACCESS_KEY
# inspired by