Skip to content

Instantly share code, notes, and snippets.

View kekru's full-sized avatar

Kevin Krummenauer kekru

View GitHub Profile
@kekru
kekru / 01-reveal-md-plantuml.md
Last active June 13, 2022 18:43
reveal-md integrate plantuml

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 / install-docker-client.sh
Created November 29, 2017 21:21
Install Docker Client (CLI) on Linux
#!/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 / 01-VSCode-foreach-project.md
Last active March 13, 2022 15:21
Command for each project in VS Code workspace

Run a command in every directory of a VSCode workspace

Deno must be installed.
On Windows GitBash is required.

Setup an alias and then run a command in every project of a VSCode workspace

# Store alias in $HOME/.bashrc
alias vsforeach="deno run --allow-run --allow-read https://gist.githubusercontent.com/kekru/256d73c7819efc35e55cd88c5903ab46/raw/25072c432cbadee38ca2d725fbe7f03f5f6eafcc/vsforeach.js"
@kekru
kekru / 01-nginx-serve-artifactory-unauthenticated.md
Last active October 29, 2021 16:33
nginx: Serve a file from Artifactory without login

nginx: serve a file from Artifactory without authentication

With the following nginx config you can expose a single file from Artifactory without need to authenticate.
Be sure that you only expose the files that are allowed to be public

I dont't recommend to run this nginx in the public internet. Run it only inside your company's firewall!
No warranty, that is totally safe.

nginx config

@kekru
kekru / process-file-locking-find.md
Last active August 27, 2021 02:08
Windows: Find process locking a file or directory

Find and stop process locking file on Windows

  • Download Handle
    or install with chocolatey:
    choco install -y handle
  • Print all file handles in a file:
    handle > handles.log
  • Find the process in handles.log (e.g example.exe) and stop it with Powershell:
    Stop-Process -Name example
@kekru
kekru / 01-docker-nginx-static-and-proxy-pass.md
Last active July 1, 2021 18:10
docker nginx static file and proxy pass

nginx docker serve static files

Simple Docker Setup for serving static files and proxy pass a path to a server

Just click "Download ZIP" oder "Embed -> Clone" and then run docker-compose up.
The server is available on http://localhost:8080 and will serve the files in ./static

@kekru
kekru / .01-gradle-gpg.md
Last active May 19, 2021 16:43
Gradle read secrets from gpg encrypted file

Gradle: Read repository secret from gpg encrypted .netrc file

This is how to read credentials from a .netrc formatted file, which is encrypted using gpg and use these credentials as login data for gradle remote repositories.

First you need to have gpg keys created.

Then create a ~/.netrc as shown below and encrypt it with gpg -r <your email> -e ~/.netrc, which will create a .netrc.gpg. Remove the unencypted .netrc afterwards.
Now create a ~/.gradle/init.gradle as shown below.

@kekru
kekru / 01-gradle-union-task-order.md
Created February 16, 2021 20:19
Gradle union task, execute in order

Gradle: Union wrapper task to execute subtasks in order

This is how to create a union tasks to execute subtasks in order

task A { doLast { println 'A' }}
task B { doLast { println 'B' }}
task C { doLast { println 'C' }}
task D { doLast { println 'D' }}
@kekru
kekru / 01-serve-static-site-deno.md
Last active January 27, 2021 20:44
Serve static site using deno

Serve static local site using deno and abc

This is how to create a simple static file server with deno and abc.
It serves the current dir and you can run it directly from the hosted script:

  • deno run --allow-net="0.0.0.0:80" --allow-read https://kekru.de/serve.ts
  • or deno run --allow-net="0.0.0.0:80" --allow-read https://gist.githubusercontent.com/kekru/751e32b5d97661f3649ce8ad8f8517ba/raw/2982a65c1205f72c56daf8827a8fc2f6b012600d/serve.ts
@kekru
kekru / 01-disable-windows-error-sound.md
Last active October 22, 2020 14:44
Disable Windows Default Error Sound

Disable Windows Error Sound

This is how to disable the default Windows error sound, which occurs, for example, when you search something in a browser and there is no result, or when you type something wrong in a terminal.

I tested this on a german Windows installation, so I'm not sure if my english translations are the correct ones.

  • Search in Windows for "Sound settings" (German: "Soundeinstellungen")
  • Click on "Sound-Control-Panel" (German "Sound-Systemsteuerung")
  • Choose "Sounds" tab
  • Look for "Default Sound - Warning Signal" (or something related, in german it is "Standardton Warnsignal")