Skip to content

Instantly share code, notes, and snippets.

@dasniko
dasniko / _keycloak-cluster-config.md
Last active June 5, 2024 06:49
How to configure a Keycloak cluster properly (Quarkus edition)

Keycloak Cluster Configuration (How to)

This is a short and simple example on how to build a proper Keycloak cluster, using DNS_PING as discovery protocol and an NGINX server as reverse proxy.

If you prefer to use JDBC_PING, see @xgp's example gist here: https://gist.github.com/xgp/768eea11f92806b9c83f95902f7f8f80


Please see also my video about Keycloak Clustering: http://www.youtube.com/watch?v=P96VQkBBNxU
NOTE: The video covers JDBC_PING protocol and uses the legacy Keycloak Wildfly distribution!

Prerequisites

  • EKS Fargate profiles for <fargate-profile-namespace>. Guide
  • EKS Fargate coredns profile for coredns pods to run (create profile for kube-system namespace, refer guide from previous step)
  • EFS CSI Driver installed, mount points set and pv.yaml created. Refer Guide
  • EKS ALB Controller, refer Guide.

Install Helm

Refer Helm Installation to install helm command

@GeorgDangl
GeorgDangl / Startup.cs
Created July 10, 2018 12:05
Excluding Assemblies from ASP.NET Core MVC Controller Discovery
services.AddMvc()
// This allows to exclude some assembly from controller discovery
.ConfigureApplicationPartManager(a =>
{
var appPart = a.ApplicationParts.FirstOrDefault(ap => ap.Name == "Assembly.Name");
if (appPart != null)
{
a.ApplicationParts.Remove(appPart);
}
})
@yetanotherchris
yetanotherchris / google-cloud-pubsub-example.cs
Last active December 16, 2022 13:56
Google Cloud Pub/Sub C# example
//
// Google Cloud Pub/Sub C# example
// NOTE: This is a .NET Core 1.1 console app.
// Use "dotnet run" to run it, run setup.ps1 first.
//
using System;
using System.Collections.Generic;
using Google.Cloud.PubSub.V1;
using Google.Protobuf;
@knowbody
knowbody / RNfontWeights.js
Created July 14, 2016 13:42
React Native Font Weight Cheatsheet iOS
{ fontWeight: '100' }, // Thin
{ fontWeight: '200' }, // Ultra Light
{ fontWeight: '300' }, // Light
{ fontWeight: '400' }, // Regular
{ fontWeight: '500' }, // Medium
{ fontWeight: '600' }, // Semibold
{ fontWeight: '700' }, // Bold
{ fontWeight: '800' }, // Heavy
{ fontWeight: '900' }, // Black
@stracqan
stracqan / usb-credit-card-reader.js
Last active October 28, 2023 14:14
Very simple jQuery implementation that reads card data from a USB Magnetic Strip Credit Card Reader.
/**
*
* Simple jQuery Script to parse credit card data
* that was collected via a USB Magnetic Stripe
* Credit Card Reader.
*
* To get this to work, focus your cursor (either
* programmatically or via a click, it's your choice) on an input field #credit-card-number
* and then with the card reader plugged in, swipe
* the card and it will take over from there
@flbuddymooreiv
flbuddymooreiv / readme.md
Last active February 6, 2024 22:31
erlang + rebar + cowboy Hello World

This is the process of setting up erlang, rebar3, and cowboy for a Hello World, starting with a clean Debian 8 install.

Update apt and install deps:

root@046edcaea45a:~# apt-get update
root@046edcaea45a:~# apt-get install erlang erlang-dev gcc
root@046edcaea45a:~# wget https://s3.amazonaws.com/rebar3/rebar3
root@046edcaea45a:~# mkdir ~/bin/
root@046edcaea45a:~# mv rebar3 ~/bin/
root@046edcaea45a:~# chmod +x ~/bin/rebar3 
@davidfowl
davidfowl / dotnetlayout.md
Last active June 17, 2024 12:44
.NET project structure
$/
  artifacts/
  build/
  docs/
  lib/
  packages/
  samples/
  src/
 tests/
@andytill
andytill / Erlang Project Ideas.md
Last active February 20, 2023 06:00
Erlang Project Ideas

When I started erlang, I had a hard time thinking of ideas for projects to improve my skills. Now I have way too many ideas to possibly implement Myself. Since I actually want these projects to exist so I can use them (everlasting glory coming secondary to some handy tools) I have written them up here. Feel free to try them out. I'm open to questions and suggestions.

swagger for erlang

swagger is a JSON spec for REST APIs. Once you have written a spec in swagger, it can generate documentation (demo) and REST handlers.

An erlang swagger library should take swagger specs and generate cowboy_rest handlers for them.

Difficulty: low

@dmarcato
dmarcato / strip_play_services.gradle
Last active December 21, 2022 10:10
Gradle task to strip unused packages on Google Play Services library
def toCamelCase(String string) {
String result = ""
string.findAll("[^\\W]+") { String word ->
result += word.capitalize()
}
return result
}
afterEvaluate { project ->
Configuration runtimeConfiguration = project.configurations.getByName('compile')