Skip to content

Instantly share code, notes, and snippets.

View lounagen's full-sized avatar

Julien Blondeau lounagen

View GitHub Profile
@lounagen
lounagen / readme.md
Last active May 6, 2020 16:12
Configure proxy on Jersey 2.x with Apache connector and JVM properties

Configure Jersey to support proxy, taking into account the regular JVM properties

The issue with the standard Jersey 2.x proxy configuration is it doesn't allow nonProxyHosts option. It doesn't allow to separate http and https calls too, but these limitations were ok for me.

In maven3 pom.xml:

  <properties>
    <jersey.version>2.30.1</jersey.version>
  </properties>
@lounagen
lounagen / readme.md
Last active April 12, 2023 00:43 — forked from thomasdarimont/readme.md
Example for decoding a JWT Payload with your Shell (bash, zsh...)

Setup

Add this to your .profile, .bashrc, .zshrc...

BASE64_DECODER_PARAM="-d" # option -d for Linux base64 tool
echo AAAA | base64 -d > /dev/null 2>&1 || BASE64_DECODER_PARAM="-D" # option -D on MacOS

decode_base64_url() {
  local len=$((${#1} % 4))
  local result="$1"
 if [ $len -eq 2 ]; then result="$1"'=='
@lounagen
lounagen / nginx-proxy-saltstack-network-creation
Created May 14, 2017 08:31
Sample saltstack state to create a docker nginx-proxy bridge (https://github.com/jwilder/nginx-proxy)
# Sample saltstack state to create a docker nginx-proxy bridge
# See details for separate docker network interest on https://github.com/jwilder/nginx-proxy
# --subnet option set the subnet of this docker network (instead of random), to configure many hosts in the same way (iptables, ...)
# --opt com.docker.network.bridge.name option fix the real bridge name got from ```ip addr``` (instead of random name)
nginx-proxy-network:
cmd.run:
- names:
- docker network create -d bridge --subnet 172.28.0.0/16 --opt com.docker.network.bridge.name=nginx-proxy nginx-proxy
- unless: docker network list | grep nginx-proxy