Skip to content

Instantly share code, notes, and snippets.

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "[email protected]"
@kamzrk
kamzrk / DeferredResultInSpring.java
Created July 17, 2020 06:21 — forked from MichalAdorno/DeferredResultInSpring.java
Using the DeferredResult Class in Spring (Non-blocking Java Servlet Controller Methods in Spring)
GetMapping("/async-deferredresult")
public DeferredResult<ResponseEntity<?>> handleReqDefResult(Model model) {
LOG.info("Received async-deferredresult request");
DeferredResult<ResponseEntity<?>> output = new DeferredResult<>(); //just a declaration
ForkJoinPool.commonPool().submit(() -> { //we pass a service method to an ExecutorService / thread pool
LOG.info("Processing in separate thread");
try {
Thread.sleep(6000);
} catch (InterruptedException e) {
@kamzrk
kamzrk / DeferredResultAndCompletableFuture.java
Created July 17, 2020 06:21 — forked from MichalAdorno/DeferredResultAndCompletableFuture.java
Combining CompletableFuture API with Spring's DeferredResult
//--------------------------------------------------------
//Service that we want to execute asynchroneously - consists of the following method:
public String execute() {
try {
Thread.sleep(5000);
logger.info("Slow task executed");
return "Task finished";
} catch (InterruptedException e) {
throw new RuntimeException();
}
@kamzrk
kamzrk / self-signed-certificate-with-custom-ca.md
Created July 3, 2019 06:34 — forked from fntlnz/self-signed-certificate-with-custom-ca.md
Self Signed Certificate with Custom Root CA

Create Root CA (Done once)

Create Root Key

Attention: this is the key used to sign the certificate requests, anyone holding this can sign certificates on your behalf. So keep it in a safe place!

openssl genrsa -des3 -out rootCA.key 4096