Skip to content

Instantly share code, notes, and snippets.

View mpreu's full-sized avatar

Matthias Preu mpreu

View GitHub Profile
@mpreu
mpreu / ocp-unique-namespace-generation.md
Last active February 22, 2021 15:00
OCP unique project generation.

To generate projects in OpenShift with unique names without manually intervention:

Via REST API:

TOKEN=$(oc whoami -t)
ENDPOINT=$(oc config current-context | cut -d/ -f2 | tr - .)

curl -k \
    -X POST \
@mpreu
mpreu / y-combinator.R
Last active February 13, 2020 23:02
How to implement recursion with the Y combinator in GNU R using the recursive addition as an example. Originates from this blog post: https://www.matthiaspreu.com/posts/lambda-calculus-recursion/.
# Part of a blog post about lambda calculus on my website:
# https://www.matthiaspreu.com/posts/lambda-calculus-recursion/
# Y combinator based on the expression:
#
# Y = λf.(λx.f(xx))(λx.f(xx))
Y <- function(f) {
fxx <- function(x) { f((x)(x)) }
(fxx)(fxx)
@mpreu
mpreu / fcos-embed-config-in-image
Created January 27, 2020 00:21
Fedora CoreOS - Example script to inject an Ignition configuration file into the virtual machine image. Originates from this blog post: https://www.matthiaspreu.com/posts/fedora-coreos-embed-ignition-config/.
#!/bin/env bash
set -eo pipefail
#
# Part of a Fedora CoreOS blog post on my website:
# https://www.matthiaspreu.com/posts/fedora-coreos-embed-ignition-config/
#
# Script modifies a FCOS virtual machine image and injects
# an Ignition configuration in it.
#
@mpreu
mpreu / fcos-qemu-demo
Last active May 25, 2021 05:41
Fedora CoreOS - Example script to setup a FCOS virtual machine using QEMU. Originates from this blog post: https://www.matthiaspreu.com/posts/fedora-coreos-first-steps/.
#!/bin/env bash
set -eo pipefail
#
# Part of an introductory Fedora CoreOS blog post on my website:
# https://www.matthiaspreu.com/posts/fedora-coreos-first-steps/
#
# Script sets up a FCOS virtual machine using QEMU.
#
# Initial user "matthias" with password "test" can be used.