Skip to content

Instantly share code, notes, and snippets.

View jesperronn's full-sized avatar

Jesper Rønn-Jensen jesperronn

View GitHub Profile
@jesperronn
jesperronn / keycloak_create_multi_idps.sh
Created April 23, 2025 08:57
creates multiple identity providers in Keycloak using the Keycloak API (curl)
#!/usr/bin/env bash
set -euo pipefail
# Author: Jesper Rønn-Jensen, Nine A/S
# Date: 2025-04-23
# Version: 1.0
# Description: This script creates multiple identity providers in Keycloak using the Keycloak API.
# Example on how to use Keycloaks API to create multiple Identity providers
# the script file here uses curl command to provide the example
# Direnv common sense configuration.
# This file is used to configure direnv, a shell extension that allows you to load and unload
# environment variables based on the current directory.
#
# This file is located in the $HOME/.config/direnv directory.
# It is loaded automatically by direnv when it starts up.
# $ cat $HOME/.config/direnv/direnv.toml
# see https://direnv.net/man/direnv.toml.1.html
@jesperronn
jesperronn / OidcSecurityClient.java
Last active September 20, 2024 11:04
Spring boot 3.3 example for OIDC client registration, which does not require HTTP request to discovery endpoint during startup
@Configuration
@NoArgsConstructor
@AllArgsConstructor
public class OAuth2LoginConfig {
@Value("${system.oauth2.client.id}")
private String adminClientId;
@Value("${system.oauth2.client.secret}")
private String adminClientSecret;
@jesperronn
jesperronn / .editorconfig
Last active March 31, 2025 10:28
.editorconfig improve IntelliJ defaults (google-java-code, properties in UTF-8, etc)
# EditorConfig is awesome: https://EditorConfig.org
# USAGE:
# curl -L --remote-name https://gist.github.com/jesperronn/e5415bbbdbc6028db09c4943c108da1d/raw/.editorconfig
# top-most EditorConfig file
root = true
# Unix-style newlines with a newline ending every file
[*]
charset = utf-8
@jesperronn
jesperronn / kickoff-2022-løsning-commodore-64.bas
Last active September 26, 2022 06:13
kick off 2022 Barcelona, Løsning commodore 64 opgave
1 REM Kick-off 2022 test løsningen. Opgaven gik ud på at udskrive teksten
2 REM "KICKOFF 2022 BARCELONA" på skærmen på en Commodore 64
3 REM
4 REM
5 REM **** COMMODORE 64 BASIC V2 ****
6 REM 64K RAM SYSTEM 38911 BASIC BYTES FREE
7 REM
8 REM READY.
9 REM
10 PRINT "KICKOFF 2022 BARCELONA"
@jesperronn
jesperronn / git-general-setup.sh
Last active May 4, 2021 13:27
Git generel opsætning/config som gør din hverdag lettere
# Fra Nine Speed Session Git Kommandolinje presentation 2021-05-04
#
# Flere af disse kan findes i mine dotfiles
# https://github.com/jesperronn/cowboy-dotfiles/blob/master/link/.gitconfig
# benyt git push -u for at oprette branches
git config --global push.default current
// example Jenkinsfile with the following features
//
// * parallel build
// * Slack notifications
// * Clickable links to relevant commits and healthcheck urls
// * Multisite deployments
def git_host = "https://github.com/company/project_name"
def host = [
integration: [
@jesperronn
jesperronn / ramdisk.sh
Created December 11, 2017 09:44 — forked from rxin/ramdisk.sh
ramdisk create/delete on Mac OS X.
#!/bin/bash
# From http://tech.serbinn.net/2010/shell-script-to-create-ramdisk-on-mac-os-x/
#
ARGS=2
E_BADARGS=99
if [ $# -ne $ARGS ] # correct number of arguments to the script;
then
@jesperronn
jesperronn / json-reformat.sh
Created February 19, 2017 21:44
reformat json: read filename and write it again in the same name
#!/usr/bin/env/bash
# reformat json: read filename and write it again in the same name
#
# read JSON file and save it again reformatted
#
# usage:
# `reformat my.json`
reformat(){
node -e "
var fs = require('fs')
#!/bin/bash
FILE=/etc/yum.repos.d/nginx.repo
sudo touch $FILE
sudo chown root:root $FILE
echo "
[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/rhel/$releasever/$basearch/