Skip to content

Instantly share code, notes, and snippets.

View steimntz's full-sized avatar

Steimntz Machado de Figueiredo steimntz

  • Tribunal de Justiça do Estado de Rondônia
  • Porto Velho - RO
View GitHub Profile
@steimntz
steimntz / Checksum.kt
Created August 29, 2019 16:12
Declarative Kotlin SHA-512 Checksum
import java.security.MessageDigest
/**
* This code is based on https://medium.com/rayn-studios/generating-sha-512-checksum-of-a-file-in-android-42ae135b0a52
* https://gist.github.com/rajat1saxena/738da60a88413a8c5b0bb8f41e31e796
* https://gist.github.com/rajat1saxena/ddd6301fd6564954e204eed23dcce2f4
*/
class Checksum(private val data: ByteArray) {
@steimntz
steimntz / bash.sh
Last active August 5, 2019 20:26
Change a Opaque secret in Kubernetes
MY_OLD_PASS="oldpass";
MY_NEW_PASS="newpass";
kubectl get secret sg -o yaml | sed -e "s,$(echo $MY_OLD_PASS | tr -d \\n | base64 -w 0),$(echo $MY_NEW_PASS | tr -d \\n | base64 -w 0)," | kubectl apply -f -;
@steimntz
steimntz / create_user_for_namespace.sh
Last active February 13, 2024 14:24
Script to create user with permission for a specific namespace.
#!/bin/bash
# In honor of the remarkable Windson
#/bin/bash
namespace=$1
if [[ -z "$namespace" ]]; then
echo "Use "$(basename "$0")" NAMESPACE";
exit 1;
fi
@steimntz
steimntz / delete-whole-repo-from-docker.md
Last active April 5, 2018 20:48
Ten liner for deleting images from a v2 docker registry

A ten liner for deleting images from a v2 docker registry

I use bash and jq to create that script.

The script

#!/usr/bin/env bash
reg=$1
repo=$2