Skip to content

Instantly share code, notes, and snippets.

View rhuss's full-sized avatar

Roland Huß rhuss

View GitHub Profile
@rhuss
rhuss / gist:1015bf1ffa6bedcd72e6
Last active September 24, 2021 16:02
Pushing to an OpenShift registry

How to setup an OpenShift registry

  • Create registry with oadm
oadm registry --latest-images --create \
              --credentials=/var/lib/openshift/openshift.local.config/master/openshift-registry.kubeconfig
  • Create route (optional, alternatively you can use also the internal ip of the registry service later)
@rhuss
rhuss / migrate_influx_db.pl
Last active January 5, 2021 20:18
Migration script for migration from a very old InfluxDB installation to a recent version (e.g. 0.7.0 to 1.8.3)
use InfluxDB;
use Data::Dumper;
use REST::Client;
use strict;
# Script for migrating data from an outdated InfluxDB to one of the
# latsest version.
# Developed for migrating from an InfluxDB 0.7.0 to a 1.8.3 version in one go
# ------------------------------------------------------------------------
@rhuss
rhuss / alpine-jre-8
Last active January 3, 2021 13:03
The Holy Grail of a Minimal, Headless, OpenJDK JRE 8
# Build for 206 MB JRE 1.8.0_60 (192 MB in size) with Alping and glibc
FROM alpine:3.2
ENV JRE=jre1.8.0_60 \
JAVA_HOME=/opt/jre
# That's the an EA from OpenJDK.net
# Courtesy to https://github.com/frol/docker-alpine-oraclejdk8 from where the setup of glibc is borrowed
@rhuss
rhuss / execute_groovy_jenkins_sample.groovy
Last active August 12, 2020 19:09
How to execute some shell scripting on Groovy with environment variables and redirection
def exec(cmd) {
println cmd
def process = new ProcessBuilder([ "sh", "-c", cmd])
.directory(new File("/tmp"))
.redirectErrorStream(true)
.start()
process.outputStream.close()
process.inputStream.eachLine {println it}
process.waitFor();
return process.exitValue()
@rhuss
rhuss / Dockerfile
Last active June 22, 2020 21:33
Restic + Rclone for ARM
FROM golang:1.13.10-buster AS builder
ARG VERSION_RESTIC=v0.9.6
ARG VERSION_RCLONE=v1.51.0
WORKDIR /opt
RUN apt-get update \
&& apt-get install -y \
git \
@rhuss
rhuss / knative-setup.sh
Created March 8, 2020 09:08
Knative Setup Script
#!/usr/bin/env bash
set -e
# Turn colors in this script off by setting the NO_COLOR variable in your
# environment to any value:
#
# $ NO_COLOR=1 test.sh
NO_COLOR=${NO_COLOR:-""}
if [ -z "$NO_COLOR" ]; then
#!/usr/bin/env bash
set -e
# Turn colors in this script off by setting the NO_COLOR variable in your
# environment to any value:
#
# $ NO_COLOR=1 test.sh
NO_COLOR=${NO_COLOR:-""}
if [ -z "$NO_COLOR" ]; then
brew install libvirt
sudo ln -s /opt/vagrant/embedded/include/ruby-2.0.0/{universal-darwin12.6.0,x86_64-darwin12.6.0}
ARCHFLAGS='-arch x86_64' \
CONFIGURE_ARGS="with-libvirt-include=/usr/local/include/libvirt:/opt/vagrant/embedded//include/ruby-2.0.0/universal-darwin12.6.0/ with-libvirt-lib=/usr/local/lib" \
vagrant plugin install vagrant-libvirt
@rhuss
rhuss / console.md
Created April 5, 2019 21:46
CRDs with multiple version on OpenShift
$ kubectl get crd | grep crontab
crontabs.example.com                                                     2019-04-05T21:33:36Z

$ kubectl get crontab
NAME      AGE
new-tab   6m
old-tab   5m

$ kubectl get crontab old-tab -o yaml