Skip to content

Instantly share code, notes, and snippets.

View floweb's full-sized avatar

Florian Le Frioux floweb

  • Seldon Finance
  • Basusarri, Euskal Herria, France
View GitHub Profile
@xenophonf
xenophonf / satosa-quickstart.md
Last active June 14, 2023 13:38
SATOSA Quick Start Guide Using SAMLtest

This deploys SATOSA 8.0.0, at the end of which an interested party could perform a basic, end-to-end test of the current SATOSA release using SAMLtest (https://samltest.id/). Run all commands in a root shell.

  1. Install Debian 11 (Bullseye). This is essentially the Docker image build process, only it uses the SATOSA release (etc.) on PyPI:
apt update
apt dist-upgrade -y
apt install -y \
    curl \
    git \
@flozz
flozz / arctis7.py
Last active December 10, 2024 04:04
Displays the battery level of a SteelSeries Arctis 7 headset.
#!/usr/bin/env python3
"""
This script displays the battery level of a SteelSeries Acrtis 7 headset.
USING
-----
To use this script you must install hidapi (https://github.com/trezor/cython-hidapi):
@joshdcollins
joshdcollins / MultitenantConfigResolver.java
Last active November 3, 2023 05:30
Full Keycloak Multitenant Configuration
package commons.keycloakauth.security;
import java.text.ParseException;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import com.nimbusds.jwt.JWT;
import com.nimbusds.jwt.JWTParser;
import admin.auth.AdminAuthService;
@kohenkatz
kohenkatz / generate_ulid_text.sql
Created April 28, 2020 06:29
Postgres stuff for working with ULID
-- From https://github.com/geckoboard/pgulid/blob/d6187a00f66dca196cf5242588f87c3a7969df75/pgulid.sql
--
-- pgulid is based on OK Log's Go implementation of the ULID spec
--
-- https://github.com/oklog/ulid
-- https://github.com/ulid/spec
--
-- Copyright 2016 The Oklog Authors
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
@fabiolimace
fabiolimace / UUIDv6.sql
Last active May 11, 2025 12:04
Functions for generating UUIDv6 and UUIDv7 on PostgreSQL
/*
* MIT License
*
* Copyright (c) 2023-2024 Fabio Lima
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
@ERRECabrera
ERRECabrera / keycloak-postgres-jdbc-ping.yml
Created December 16, 2019 16:32
Template creates a volume for PostgreSQL and boots up Keycloak connected to it. Traefik is used like load balancer to redirect all request to diferent container instances. The most important change is the JGroups Discovery protocol that is used in this configuration, which is `JDBC_PING`. `JDBC_PING` reuses the same database instance as all Keyc…
version: '3'
volumes:
postgres_data:
driver: local
services:
postgres:
image: 'postgres:alpine'
volumes:
@pyrou
pyrou / docker-compose.yml
Last active March 31, 2025 19:52
Use https://traefik.me SSL certificates for local HTTPS without having to touch your /etc/hosts or your certificate CA.
version: '3'
services:
traefik:
restart: unless-stopped
image: traefik:v2.0.2
ports:
- "80:80"
- "443:443"
labels:
- "traefik.http.services.traefik.loadbalancer.server.port=8080"
@eviltester
eviltester / gist:11093f0e4c501a41990e227393184eda
Last active February 14, 2025 09:30
uncheck twitter interests
var timer=100;document.querySelectorAll("div > input[type='checkbox']:checked").forEach((interest) => {setTimeout(function(){interest.click()},timer);timer+=2000;});
@igorstojanovski
igorstojanovski / KeycloakClientTest.java
Created July 28, 2019 19:44
Using the Keycloak client to create a user, set a real role and then delete it.
package io.aktivator;
import org.jboss.resteasy.client.jaxrs.ResteasyClientBuilder;
import org.keycloak.admin.client.Keycloak;
import org.keycloak.admin.client.KeycloakBuilder;
import org.keycloak.admin.client.resource.RealmResource;
import org.keycloak.admin.client.resource.RolesResource;
import org.keycloak.admin.client.resource.UsersResource;
import org.keycloak.representations.AccessTokenResponse;
import org.keycloak.representations.idm.ClientRepresentation;
@kasperpeulen
kasperpeulen / redux.ts
Created May 15, 2019 11:33
The essence of redux in 30 lines of code.
class Store<S> {
private readonly reducer: (state: S, action: Action) => S;
private state: S;
private listeners: Listener[] = [];
constructor(reducer, state) {
this.reducer = reducer;
this.state = state;
}