Skip to content

Instantly share code, notes, and snippets.

🏠
Working from home

Thomas Darimont thomasdarimont

🏠
Working from home
Block or report user

Report or block thomasdarimont

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@thomasdarimont
thomasdarimont / RsyncOverSsh_Fast_Documentation.md
Created Nov 12, 2019 — forked from KartikTalwar/Documentation.md
Rsync over SSH - (40MB/s over 1GB NICs)
View RsyncOverSsh_Fast_Documentation.md

The fastest remote directory rsync over ssh archival I can muster (40MB/s over 1gb NICs)

This creates an archive that does the following:

rsync (Everyone seems to like -z, but it is much slower for me)

  • a: archive mode - rescursive, preserves owner, preserves permissions, preserves modification times, preserves group, copies symlinks as symlinks, preserves device files.
  • H: preserves hard-links
  • A: preserves ACLs
View HttpClientExample.java
package demo.example;
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class HttpClientExample {
public static void main(String[] args) throws Exception {
View Example020_HttpClientExample.java
package demo;
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpHeaders;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
View gist:b7540bfb8771fa666b59a61426a205c2
Sub unprotected()
If Hook Then
MsgBox "VBA Project is unprotected!", vbInformation, "*****"
End If
End Sub
View gist:056fc3100b5989e4ccd82a9d3abbac69
Option Explicit
Private Const PAGE_EXECUTE_READWRITE = &H40
Private Declare PtrSafe Sub MoveMemory Lib "kernel32" Alias "RtlMoveMemory" _
(Destination As LongPtr, Source As LongPtr, ByVal Length As LongPtr)
Private Declare PtrSafe Function VirtualProtect Lib "kernel32" (lpAddress As LongPtr, _
ByVal dwSize As LongPtr, ByVal flNewProtect As LongPtr, lpflOldProtect As LongPtr) As LongPtr
@thomasdarimont
thomasdarimont / readme.md
Created Aug 29, 2019
Keycloak get client by clientId
View readme.md
KC_CLIENT_ID=admin-cli
KC_SERVER=http://localhost:8080/auth

KC_REALM=master
KC_ISSUER=$KC_SERVER/realms/$KC_REALM
KC_USERNAME=admin
KC_PASSWORD=admin

# Fetch ACCESS_TOKEN
@thomasdarimont
thomasdarimont / readme.md
Created Aug 6, 2019
Keycloak Secure Admin Console via TLS Certificate
View readme.md
View readme.md

List locally trusted certifcates

certutil -d sql:$HOME/.pki/nssdb -L

Add locally trusted certifcate

certutil -d sql:$HOME/.pki/nssdb -D -t "P,," -n ~/Downloads/apps.tdlabs.local.crt -i ~/Downloads/apps.tdlabs.local.crt
View kafka-productivity-hacks.md

I've been working with Kafka for over 7 years. I inevitably find myself doing the same set of activities while I'm developing or working with someone else's system. Here's a set of Kafka productivity hacks for doing a few things way faster than you're probably doing them now. 🔥

Get the tools

@thomasdarimont
thomasdarimont / readme.md
Last active Nov 3, 2019
PoC for building a custom OpenJDK 12 JDK (47MB) with JLink that can run Keycloak 6.0.1
View readme.md

This is a small PoC for creating a custom Java-Runtime with reduced dependencies and tools. The idea is to use this JRE in a Docker image layer on top of a slim Linux distribution.

Cleanup java-runtime-kc

rm -rf java-runtime-kc

Create custom JRE with JLink

Produces a 51M custom JRE distribution

You can’t perform that action at this time.