docker run -it --rm --user 0 -v $PWD/caddy/caddy.json:/etc/caddy.json:z --entrypoint /bin/sh caddy:2.4.2-alpine
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class LocalOnceExample { | |
public static void main(String[] args) { | |
foo(); | |
foo(); | |
} | |
static int foo() { | |
System.out.println("start foo"); | |
class Local { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package wb.java17; | |
import java.math.BigInteger; | |
import java.util.Map; | |
import java.util.concurrent.ConcurrentHashMap; | |
public class StaticsInLocalClassesExample { | |
public static void main(String[] args) { | |
System.out.println(factorial(120)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let code = `self.onmessage = msg => { console.log("Worker: %s", msg.data.text)}`; | |
const worker = new Worker("data:,"+code); | |
worker.postMessage({text: 'Hello from main thread!'}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"context" | |
"fmt" | |
"log" | |
"net" | |
"net/http" | |
"os" | |
"syscall" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Keycloak SPA Demo</title> | |
<style> | |
body { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Edit this file then run `update-haproxy haproxy-servers.cfg`. | |
# Alternatively, use a shell pipeline to build server list `... | update-haproxy`. | |
server demo1 127.0.0.1:8001 check cookie demo1 weight 100 | |
server demo2 127.0.0.1:8002 check cookie demo2 weight 100 | |
server demo3 127.0.0.1:8003 check cookie demo3 weight 0 | |
server demo4 127.0.0.1:8004 check cookie demo3 weight 0 |
The example uses the embedded Spring Boot Keycloak Server to quickly spin up a new Keycloak instance.
Create JBang script with
jbang init spring-keycloak-server
Adapt spring-keycloak-server
script.
Run the Keycloak server via:
Add regular-expression filter under /etc/fail2ban/filter.d/keycloak.conf
:
[INCLUDES]
before = common.conf
[Definition]
_threadName = [a-z][-_0-9a-z]*(\s[a-z][-_0-9a-z]*)*
_userId = (null|[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package demo.once; | |
import java.lang.invoke.MethodHandle; | |
import java.lang.invoke.MethodHandles; | |
import java.lang.invoke.MethodType; | |
import java.lang.invoke.MutableCallSite; | |
import java.lang.reflect.UndeclaredThrowableException; | |
import java.util.Objects; | |
import java.util.concurrent.locks.ReentrantLock; | |
import java.util.function.Supplier; |