Skip to content

Instantly share code, notes, and snippets.

View r0mdau's full-sized avatar

Romain Dauby r0mdau

View GitHub Profile
@r0mdau
r0mdau / delete-from-v2-docker-registry.md
Last active March 30, 2021 23:59 — forked from jaytaylor/delete-from-v2-docker-registry.md
One liner for deleting images with all associated tags and a progress bar from a v2 docker registry

One liner for deleting images from a v2 docker registry

Just plug in your own values for registry and repo/image name.

#!/bin/bash
registry='localhost:5000'
name='my-image'

tags=$(curl -sSL "http://${registry}/v2/${image}/tags/list" | jq -r '.tags[]')
@r0mdau
r0mdau / readme.md
Created February 9, 2021 12: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...

decode_base64_url() {
  local len=$((${#1} % 4))
  local result="$1"
  if [ $len -eq 2 ]; then result="$1"'=='
  elif [ $len -eq 3 ]; then result="$1"'=' 
  fi
 echo "$result" | tr '_-' '/+' | openssl enc -d -base64