Skip to content

Instantly share code, notes, and snippets.

View michel-zimmer's full-sized avatar

Michel Zimmer michel-zimmer

View GitHub Profile
#!/bin/bash
set -eo pipefail
json=`cat $1 | y2j`
overrides=`echo "$json" | jq "{spec}"`
name=`echo "$json" | jq -r ".metadata.name"`
labels=`echo "$json" | jq -r '.metadata.labels | keys[] as $k | "\($k)=\(.[$k])"' | paste -sd "," -`
image=`echo "$json" | jq -r ".spec.containers[0].image"`
@brasey
brasey / Configure systemd-resolved to use a specific DNS nameserver for a given domain.md
Created October 25, 2019 14:38
Configure systemd-resolved to use a specific DNS nameserver for a given domain

Configure systemd-resolved to use a specific DNS nameserver for a given domain

Use case

Given

  • I use a VPN to connect to my work network
  • I'm on a Linux computer that uses systemd-resolved
  • I have a work domain called example.com
  • example.com is hosted by both public and private DNS nameservers
@kamermans
kamermans / configure_docker0.sh
Last active April 26, 2024 00:58
Change the IP subnet of Docker's docker0 interface
#!/bin/sh -e
#
# NOTE: Since Docker 1.10 (February 4, 2016), it has been possible to configure the
# Docker daemon using a JSON config file. On Linux, this file is normally located at
# /etc/docker/daemon.json. You should use this JSON config method if you are running
# a version of Docker that is at least 1.10!
# Here is an example configuration that sets the docker0 bridge IP to 192.168.254.1/24:
# {
# "bip": "192.168.254.1/24"
# }
@mathieuancelin
mathieuancelin / Lens.java
Last active March 7, 2023 02:23
Lenses with Java 8
package bar.foo.lenses;
import java.util.function.BiFunction;
import java.util.function.Function;
public class Lens<A, B> {
private final Function<A, B> getter;
private final BiFunction<A, B, A> setter;
@staltz
staltz / introrx.md
Last active November 17, 2024 01:08
The introduction to Reactive Programming you've been missing