Skip to content

Instantly share code, notes, and snippets.

package com.example.demo;
import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.apache.kafka.clients.producer.Producer;
import org.apache.kafka.clients.producer.ProducerRecord;
import org.apache.kafka.common.serialization.StringDeserializer;
import org.apache.kafka.common.serialization.StringSerializer;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
@destan
destan / ParseRSAKeys.java
Last active March 29, 2024 10:43
Parse RSA public and private key pair from string in Java
import java.io.IOException;
import java.net.URISyntaxException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.security.KeyFactory;
import java.security.NoSuchAlgorithmException;
import java.security.PrivateKey;
import java.security.interfaces.RSAPublicKey;
import java.security.spec.InvalidKeySpecException;
import java.security.spec.PKCS8EncodedKeySpec;
@alister
alister / DockerRedis_ExportImport_Dump.sh
Created January 27, 2015 21:46
Example of creating a Docker data volume, exporting it, and re-importing it to a completely fresh container
# Create the container - we run 'echo' in the container, and reuse the same as we will be running later
docker run -d -v /data --name redis.data dockerfile/redis echo Data-only container for Redis
# the data container doesn't show up - nothing is running
docker ps
# will show 'redis.data', but as stopped
docker ps -a
# start redis, attach to 'redis.data'
docker run -d -p 6379:6379 --volumes-from redis.data --name ca.redis.1 dockerfile/redis