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 apache-kafka-productivity-hacks.md

I've been working with Apache 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

@wybiral
wybiral / noscript-tracking.go
Last active Nov 9, 2019
Tracking cursor position in real-time with remote monitoring (without JavaScript)
View noscript-tracking.go
// Tracking cursor position in real-time without JavaScript
// Demo: https://twitter.com/davywtf/status/1124146339259002881
package main
import (
"fmt"
"net/http"
"strings"
)
@lizthegrey
lizthegrey / attributes.rb
Last active Nov 4, 2019
Hardening SSH with 2fa
View attributes.rb
default['sshd']['sshd_config']['AuthenticationMethods'] = 'publickey,keyboard-interactive:pam'
default['sshd']['sshd_config']['ChallengeResponseAuthentication'] = 'yes'
default['sshd']['sshd_config']['PasswordAuthentication'] = 'no'
@giannivh
giannivh / keycloak_impex.sh
Last active Sep 13, 2019 — forked from unguiculus/keycloak_impex.sh
Import/Export Keycloak Config running on Kubernetes
View keycloak_impex.sh
#!/usr/bin/env bash
set -e
set -u
set -o pipefail
show_help() {
cat << EOF
Usage: $(basename "$0") <options>
-h, --help Display help
View gist:547c550a532be7e8235aa653725b2ba2
@Override
public void authenticationFinished(AuthenticationSessionModel authSession, BrokeredIdentityContext context) {
String prompt = authSession.getClientNote(OIDCLoginProtocol.PROMPT_PARAM);
if (OIDCLoginProtocol.PROMPT_VALUE_LOGIN.equals(prompt)) {
UserSessionModel usm = session.sessions().getUserSessionByBrokerSessionId(authSession.getRealm(), context.getBrokerSessionId());
if (!AuthenticationManager.isSessionValid(authSession.getRealm(), usm)) {
logger.debugf("User session '%s' is not valid, maybe creating a new one", context.getBrokerSessionId());
EventBuilder event = new EventBuilder(authSession.getRealm(), session, session.getContext().getConnection());
event.event(EventType.IDENTITY_PROVIDER_LOGIN);
ClientSessionContext ctx = AuthenticationProcessor.attachSession(authSession, usm, session, authSession.getRealm(), session.getContext().getConnection(), event);
View App.js
import React, { Suspense, useState } from "react";
import { unstable_createResource as createResource } from "react-cache";
import {
Combobox,
ComboboxInput,
ComboboxList,
ComboboxOption
} from "./Combobox2.js";
function App({ tabIndex, navigate }) {
View keycloak_impex.sh
#!/usr/bin/env bash
set -e
set -u
set -o pipefail
show_help() {
cat << EOF
Usage: $(basename "$0") <options>
-h, --help Display help
@timheap
timheap / chunksof.py
Last active Jan 13, 2019
Split a generator up in to chunks of size `n`, without walking the list or keeping items in memory needlessly
View chunksof.py
from itertools import chain, islice
class splitter:
"""Helper class for splitat."""
def __init__(self, iterable, count):
self.iterator = iter(iterable)
self.count = count
self.queue = []
@docwalter
docwalter / create-react-ts-mobx-app.sh
Created Jun 25, 2018
create-react-app + TypeScript + MobX
View create-react-ts-mobx-app.sh
#!/bin/env sh
set -e
if [ -z "$1" ] ; then
echo "Usage: `basename $0` appname"
exit 1
fi
name="$1"
@tilakpatidar
tilakpatidar / postgres_to_kafka.sh
Last active Aug 29, 2019
Postgres to Kafka streaming using debezium
View postgres_to_kafka.sh
# Run postgres instance
docker run --name postgres -p 5000:5432 debezium/postgres
# Run zookeeper instance
docker run -it --name zookeeper -p 2181:2181 -p 2888:2888 -p 3888:3888 debezium/zookeeper
# Run kafka instance
docker run -it --name kafka -p 9092:9092 --link zookeeper:zookeeper debezium/kafka
# Run kafka connect
You can’t perform that action at this time.