Skip to content

Instantly share code, notes, and snippets.

R. Tyler Croy rtyler

Block or report user

Report or block rtyler

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
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 Jul 31, 2019
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
@rtyler
rtyler / find-ed25519.groovy
Last active Oct 12, 2018
Determine whether there are passphrase-protected ed25519 keys in a Jenkins instance
View find-ed25519.groovy
import com.cloudbees.hudson.plugins.folder.*
import com.cloudbees.hudson.plugins.folder.properties.*
import com.cloudbees.hudson.plugins.folder.properties.FolderCredentialsProvider.FolderCredentialsProperty
import com.cloudbees.plugins.credentials.*
import com.cloudbees.jenkins.plugins.sshcredentials.SSHUserPrivateKey
/* Let's see if the key is ed25518 */
boolean checkKey(def key) {
boolean found = false
View runlocal.sh
#!/bin/sh
exec docker run --rm -ti -p 8080:8080 -e GITHUB_USER=rtyler -v $PWD/init.groovy.d:/var/jenkins_home/init.groovy.d -e CLIENT_SECRET=foobar -e CLIENT_ID=foobar -e AZURE_SUBSCRIPTION_ID=fooar -e AZURE_TENANT_ID=FOOBAR -e AZURE_CLIENT_ID=FOOBAR-e AZURE_CLIENT_SECRET="FOOBAR" rtyler/codevalet-master
You can’t perform that action at this time.