Skip to content

Instantly share code, notes, and snippets.

View cescoffier's full-sized avatar
⚗️
Quarking...

Clement Escoffier cescoffier

⚗️
Quarking...
View GitHub Profile
@cescoffier
cescoffier / HostEdit.java
Created June 26, 2023 09:06
A JBang script to edit your /etc/hosts file (add and remove entries)
///usr/bin/env jbang "$0" "$@" ; exit $?
//DEPS info.picocli:picocli:4.7.4
import java.io.File;
import java.io.IOException;
import java.lang.System.Logger.Level;
import java.nio.file.Files;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.Callable;
///usr/bin/env jbang "$0" "$@" ; exit $?
//DEPS info.picocli:picocli:4.5.0
//DEPS org.eclipse.jgit:org.eclipse.jgit:5.10.0.202012080955-r
//DEPS org.eclipse.jgit:org.eclipse.jgit.gpg.bc:5.10.0.202012080955-r
//DEPS org.kohsuke:github-api:1.122
//DEPS commons-io:commons-io:2.8.0
//DEPS org.slf4j:slf4j-jdk14:1.7.30
import org.apache.commons.io.FileUtils;
import org.eclipse.jgit.api.CherryPickResult;
//usr/bin/env jbang "$0" "$@" ; exit $?
//DEPS io.quarkus:quarkus-smallrye-reactive-messaging-kafka:1.9.0.CR1
//DEPS io.quarkus:quarkus-smallrye-health:1.9.0.CR1
//DEPS org.testcontainers:kafka:1.15.0-rc2
//JAVAC_OPTIONS -parameters
//JAVA_OPTIONS -Djava.util.logging.manager=org.jboss.logmanager.LogManager
//JAVA_OPTIONS -Dmp.messaging.outgoing.movies-out.connector=smallrye-kafka -Dmp.messaging.outgoing.movies-out.topic=movies -Dmp.messaging.outgoing.movies-out.value.serializer=org.apache.kafka.common.serialization.StringSerializer
//JAVA_OPTIONS -Dmp.messaging.incoming.movies.connector=smallrye-kafka -Dmp.messaging.incoming.movies.value.deserializer=org.apache.kafka.common.serialization.StringDeserializer -Dmp.messaging.incoming.movies.auto.offset.reset=earliest
//JAVA_OPTIONS -Dmp.messaging.incoming.movies.failure-strategy=dead-letter-queue
//JAVA_OPTIONS -Dmp.messaging.incoming.dead-letter-topic-movies.connector=smallrye-kafka -Dmp.messaging.incoming.dead-letter-topic-movies.value.deserializer=org.apache.k
@cescoffier
cescoffier / Retry.java
Last active March 31, 2023 06:45
Various examples of retries with Mutiny
//usr/bin/env jbang "$0" "$@" ; exit $?
//DEPS io.smallrye.reactive:smallrye-mutiny-vertx-web-client:1.1.0
//DEPS io.smallrye.reactive:mutiny:0.7.0
//DEPS org.slf4j:slf4j-nop:1.7.30
package io.vertx.mutiny.retry;
import io.smallrye.mutiny.Uni;
import io.vertx.mutiny.core.Vertx;
//usr/bin/env jbang "$0" "$@" ; exit $?
//DEPS io.smallrye.reactive:smallrye-mutiny-vertx-web-client:1.1.0
//DEPS io.smallrye.reactive:mutiny:0.7.0
//DEPS org.slf4j:slf4j-nop:1.7.30
package io.vertx.mutiny.quotes;
import io.smallrye.mutiny.Multi;
import io.smallrye.mutiny.Uni;
//usr/bin/env jbang "$0" "$@" ; exit $?
//DEPS io.smallrye.reactive:smallrye-mutiny-vertx-web-client:1.1.0
//DEPS io.smallrye.reactive:mutiny:0.7.0
//DEPS org.slf4j:slf4j-nop:1.7.30
package io.vertx.mutiny.pagination;
import io.smallrye.mutiny.Multi;
import io.smallrye.mutiny.Uni;
//usr/bin/env jbang "$0" "$@" ; exit $?
//DEPS io.smallrye.reactive:smallrye-mutiny-vertx-redis-client:1.1.0
//DEPS io.smallrye.reactive:mutiny:0.7.0
//DEPS org.testcontainers:testcontainers:1.14.3
//DEPS org.slf4j:slf4j-nop:1.7.30
package io.vertx.mutiny.redis;
import io.smallrye.mutiny.Multi;
//usr/bin/env jbang "$0" "$@" ; exit $?
//DEPS info.picocli:picocli:4.2.0
//DEPS org.eclipse.jgit:org.eclipse.jgit:5.8.1.202007141445-r
import org.eclipse.jgit.api.ListBranchCommand;
import org.eclipse.jgit.api.errors.GitAPIException;
import org.eclipse.jgit.lib.Ref;
import org.eclipse.jgit.lib.Repository;
import org.eclipse.jgit.revwalk.RevCommit;

Keybase proof

I hereby claim:

  • I am cescoffier on github.
  • I am cescoffier (https://keybase.io/cescoffier) on keybase.
  • I have a public key ASC8ybjXsNKHF59bNxYdSY9On5NEGOVh39RP29SkJFMETAo

To claim this, I am signing this object:

version: '2'
services:
zookeeper:
image: strimzi/kafka:0.11.3-kafka-2.1.0
command: [
"sh", "-c",
"bin/zookeeper-server-start.sh config/zookeeper.properties"
]