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
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 Aug 15, 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

@thomasdarimont
thomasdarimont / App.java
Created Jun 20, 2019
Simple example for using custom mime-types with fixed request mappings in Spring REST MVC
View App.java
package demo;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@SpringBootApplication
public class App {
@thomasdarimont
thomasdarimont / readme.md
Created May 3, 2019
Generate random data with openssl
View readme.md
openssl rand -hex 128
@thomasdarimont
thomasdarimont / readme.md
Created Apr 26, 2019
JQ Filter & Update Objects
View readme.md
json=$(cat << EOF
{
    "id":"test1234",
    "components": [
        {
            "id":"c1",
            "type":"foo",
            "bubu":1,
            "secret":"****"
You can’t perform that action at this time.