Skip to content

Instantly share code, notes, and snippets.

View louisthomas's full-sized avatar

ltlamontagne louisthomas

  • Montreal
View GitHub Profile
@OLibutzki
OLibutzki / PlaywrightWithTestcontainers.java
Last active February 2, 2022 14:04
Demonstrates how to run Playwright Java in conjunction with Testcontainers
///usr/bin/env jbang "$0" "$@" ; exit $?
//DEPS com.microsoft.playwright:playwright:1.18.0
//DEPS org.testcontainers:testcontainers:1.16.3
//DEPS org.slf4j:slf4j-nop:1.7.35
import static java.lang.System.out;
import org.testcontainers.containers.GenericContainer;
import org.testcontainers.containers.wait.strategy.Wait;
class OpenSSLContainer : GenericContainer<OpenSSLContainer>(
ImageFromDockerfile().withDockerfileFromBuilder { it
.from("ubuntu:20.04")
.env("DEBIAN_FRONTEND", "noninteractive")
.env("LC_ALL", "C.UTF-8")
.run("apt-get update && apt-get install -y openssl")
.run("openssl version")
//we need a running container to call `execInContainer` commands
.cmd("/bin/bash -c 'while true; do sleep 10; done'")
})
Synchronous request/response Asynchronous request/response Asynchronous messages or events
Business level Synchronous Synchronous Asynchronous
Technical communication style Synchronous Asynchronous Asynchronous
Example HTTP AMQP, JMS AMQP, Apache Kafka
@ksingh7
ksingh7 / prometheus_db_backup_using_Snapshot.md
Last active November 28, 2023 03:55
Prometheus DB Backup using TSDB Snapshot

Get Token for API Authentication

oc whoami -t

Get Prometheus Route URL

oc get route -n openshift-monitoring | grep -i prometheus

Run sample curl request

//DEPS org.testcontainers:testcontainers:1.15.3
import com.github.dockerjava.api.command.InspectContainerResponse;
import org.junit.Test;
import org.testcontainers.containers.GenericContainer;
import org.testcontainers.containers.wait.strategy.Wait;
import org.testcontainers.images.builder.Transferable;
import java.nio.charset.StandardCharsets;
import org.springframework.core.convert.converter.Converter;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod;
import org.springframework.http.MediaType;
import org.springframework.http.RequestEntity;
import org.springframework.security.oauth2.client.endpoint.OAuth2ClientCredentialsGrantRequest;
import org.springframework.security.oauth2.client.endpoint.OAuth2ClientCredentialsGrantRequestEntityConverter;
import org.springframework.security.oauth2.client.registration.ClientRegistration;
import org.springframework.security.oauth2.core.ClientAuthenticationMethod;
import org.springframework.security.oauth2.core.endpoint.OAuth2ParameterNames;
@GolovPavel
GolovPavel / java_and_containers.md
Last active December 18, 2020 12:31
Java and Containers
@oliverjumpertz
oliverjumpertz / .dockerignore
Last active December 16, 2020 14:31
A Dockerfile to get your Next.js app containerized.
node_modules/
README.md
@nilsandrey
nilsandrey / .dockerfile
Last active December 17, 2020 20:13
Dockerfile to containerize a Next.js app by @oliverjumpertz@twitter
FROM node: 14-alpine as build
ENV NEXT_TELEMETRY_DISABLED=1
RUN apk add --no-cache libc6-compat
WORKDIR /app
COPY ..
RUN yarn install && \
yarn build
FROM node: 14-alpine
@jkuipers
jkuipers / spring-boot-snippet.gradle
Created June 23, 2020 21:18
Sample of how to configure Spring Boot's layered jar support for multi-module build that includes your own libs
subprojects { subproject ->
// ...
plugins.withId('org.springframework.boot') {
springBoot {
bootJar {
layered {
// application follows Boot's defaults
application {
intoLayer("spring-boot-loader") {