Skip to content

Instantly share code, notes, and snippets.

View r10r's full-sized avatar

Ruben Jenster r10r

  • Drachenfels GmbH
  • Pforzheim
View GitHub Profile
@r10r
r10r / mwd.sleepMac.plist
Created December 4, 2023 20:25 — forked from dusenberrymw/mwd.sleepMac.plist
Automatically force OS X / macOS to sleep when the battery is low (script + plist).
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>mwd.sleepMac</string>
<key>ProgramArguments</key>
<array>
<string>/path/to/sleepMac.sh</string>
</array>
@r10r
r10r / bash_strict_mode.md
Created August 29, 2023 15:20 — forked from mohanpedala/bash_strict_mode.md
set -e, -u, -o, -x pipefail explanation
Aspect or Feature kubernetes/ingress-nginx nginxinc/kubernetes-ingress with NGINX nginxinc/kubernetes-ingress with NGINX Plus
Fundamental
Authors Kubernetes community NGINX Inc and community NGINX Inc and community
NGINX version Custom NGINX build that includes several third-party modules NGINX official mainline build NGINX Plus
Commercial support N/A N/A Included
Implemented in Go/Lua (while Nginx is written in C) Go/Python Go/Python
Load balancing configuration via the Ingress resource
@r10r
r10r / migrate.configmap.yaml
Created June 6, 2023 08:56 — forked from deefdragon/migrate.configmap.yaml
Migrating Kubernetes PVC/PVs from one storage class to another
apiVersion: v1
kind: ConfigMap
metadata:
# any name can be used; Velero uses the labels (below)
# to identify it rather than the name
name: change-storage-class-config
# must be in the velero namespace
namespace: velero
# the below labels should be used verbatim in your
# ConfigMap.
@r10r
r10r / Dockerfile
Created January 13, 2022 09:58 — forked from hermanbanken/Dockerfile
Compiling NGINX module as dynamic module for use in docker
FROM nginx:alpine AS builder
# nginx:alpine contains NGINX_VERSION environment variable, like so:
# ENV NGINX_VERSION 1.15.0
# Our NCHAN version
ENV NCHAN_VERSION 1.1.15
# Download sources
RUN wget "http://nginx.org/download/nginx-${NGINX_VERSION}.tar.gz" -O nginx.tar.gz && \
@r10r
r10r / kubernetes-cheatsheet.md
Created October 12, 2021 20:01 — forked from jonashackt/kubernetes-cheatsheet.md
Kubernetes cheat sheet
@r10r
r10r / runc_with_tty.md
Created October 7, 2021 07:03 — forked from jzaccone/runc_with_tty.md
Start runC container with TTY Device

About

recvtty is a reference implementation of a consumer of runC's --console-socket API. It is automatically built when doing a make on the runc project.

Prereq

These instructions were tested on Ubuntu 16.04. Also go, git are required.

Install runC

go get github.com/opencontainers/runc
cd $GOPATH/src/github.com/opencontainers/runc
@r10r
r10r / postgres_recovery.md
Last active August 19, 2021 06:07 — forked from supix/postgres_recovery.md
Postgres error: Missing chunk 0 for toast value in pg_toast

References

https://newbiedba.wordpress.com/2015/07/07/postgresql-missing-chunk-0-for-toast-value-in-pg_toast/

The problem

In some cases, it is possible that PostgreSQL tables get corrupted. This can happen in case of hardware failures (e.g. hard disk drives with write-back cache enabled, RAID controllers with faulty/worn out battery backup, etc.), as clearly reported in this wiki page. Furthermore, it can happen in case of incorrect setup, as well.

One of the symptoms of such corruptions is the following message:

@r10r
r10r / jq-cheetsheet.md
Created July 7, 2021 13:53 — forked from olih/jq-cheetsheet.md
jq Cheet Sheet

Processing JSON using jq

jq is useful to slice, filter, map and transform structured json data.

Installing jq

On Mac OS

brew install jq

@r10r
r10r / README.md
Created August 14, 2016 11:22 — forked from eliquious/README.md
Golang OpenPGP examples

Building

go build -o goencrypt main.go

Generating Keys