Skip to content

Instantly share code, notes, and snippets.

Kevin Krummenauer kekru

Block or report user

Report or block kekru

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 ssh-commands.md

SSH commands

Find out own SSH fingerprint:

ssh-keygen -lf /etc/ssh/ssh_host_ecdsa_key.pub

Add own public key to remote server for later verification:

@kekru
kekru / 01-reveal-md-plantuml.md
Last active Jun 2, 2019
reveal-md integrate plantuml
View 01-reveal-md-plantuml.md

Integrate plantuml in reveal-md

This is how to integrate plantuml scripts in you reveal-md presentations.

Download the preproc.js from below to your project and replace the plantuml server url with your plantuml server.
Also replace the plantumlDir with your target dir for the generated png files.
Run reveal-md with the preproc.js:

reveal-md slides.md --preprocessor preproc.js
@kekru
kekru / 01-container-structure-test.md
Last active May 30, 2019
Dockerfile for container-structure-test
View 01-container-structure-test.md

Dockerfile for container-structure-test

Use the following docker-compose file. It will build directly from this gist.
To be more stable, copy the Dockerfile and build on your own.

version: "3.3"

services:
  structure-test:
@kekru
kekru / traefik-redirect-path.md
Last active May 30, 2019
Traefik redirect / (root) to sub path with Docker labels
View traefik-redirect-path.md

Traefik: redirect base or root path to a subpath

This is how to redirect the root or base path to a sub path in Traefik using Docker labels: Goals

  • https://example.com -> https://example.com/abc/xyz/
  • https://example.com/ -> https://example.com/abc/xyz/
  • https://example.com/something -> no redirect

We will match <begin of line>https://<any chars but not slash AS group1><slash or nothing><end of line>

@kekru
kekru / 01nginx-tls-sni.md
Last active Mar 17, 2019
nginx TLS SNI routing, based on subdomain pattern
View 01nginx-tls-sni.md

Nginx TLS SNI routing, based on subdomain pattern

Nginx can be configured to route to a backend, based on the server's domain name, which is included in the SSL/TLS handshake (Server Name Indication, SNI).
This works for http upstream servers, but also for other protocols, that can be secured with TLS.

prerequisites

  • at least nginx 1.15.9 to use variables in ssl_certificate and ssl_certificate_key.
  • check nginx -V for the following:
    ...
    TLS SNI support enabled
View gist:3fe759fc98c432b1cbf6507b5bc107d0
/////////// changes for pom.xml
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-api-mockito</artifactId>
<version>1.6.2</version>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-module-junit4</artifactId>
<version>1.6.2</version>
@kekru
kekru / map-keyboard-key.md
Last active Oct 28, 2018
Ubuntu map keybooard special key
View map-keyboard-key.md

My low cost keyboard does not have a less/greater/pipe key....
So I mapped a special key, to the less/greater/pipe key

# find out the keycode of the special key, for me it was 148
xev
# set Strg_r to Mode_switch -> Strg_r + special key will print pipe
sudo xmodmap -e "keycode 0x69 = Mode_switch Mode_switch Mode_switch Mode_switch" 
# set key binding for special key. Replace the keycode with your keycode  
sudo xmodmap -e "keycode 148 = less greater bar"
@kekru
kekru / 1-WSL and Docker for Windows.md
Last active Jan 19, 2019
Windows 10 Subsystem for Linux combined with Docker for Windows
View 1-WSL and Docker for Windows.md

Using Windows Subsystem for Linux combined with Docker for Windows

Docker CE for Windows

  • Install Docker CE for Windows
  • Go to Docker for Windows Settings -> General and enable Expose daemon on tcp://localhost:2375 without TLS.
    This will enable the Docker remote API for requests, coming from localhost, not from another computer in your network. A TLS secured version is not yet supported in Docker for Windows. See https://github.com/docker/for-win/issues/453 for more information. I also tried a daemon.json file with options tlscacert, tlscert, tlskey and tlsverify, but Docker for Windows crashed on booting.

Install Windows Subsystem for Linux (WSL)

@kekru
kekru / install-docker-client.sh
Created Nov 29, 2017
Install Docker Client (CLI) on Linux
View install-docker-client.sh
#!/bin/bash
set -e
DIR=~/install-docker-client-temp
mkdir -v --parents $DIR
#https://get.docker.com/builds/Linux/i386/docker-latest.tgz | tar xvz --directory $DIR
curl https://download.docker.com/linux/static/edge/x86_64/docker-17.11.0-ce.tgz | tar xvz --directory $DIR
mv -v $DIR/docker/docker /usr/local/bin/docker
chmod +x /usr/local/bin/docker
@kekru
kekru / 1-Enable Docker Remote API with TLS client verification.md
Last active Jun 11, 2019
Docker Remote API with client verification via daemon.json
View 1-Enable Docker Remote API with TLS client verification.md

Enable Docker Remote API with TLS client verification

Docker's Remote API can be secured via TLS and client certificate verification.
First of all you need a few certificates and keys:

  • CA certificate
  • Server certificate
  • Server key
  • Client certificate
  • Client key

Create certificate files

You can’t perform that action at this time.