Some of my ramlings whilst working with Azure. This includes dev-ops and more.
This requires that the permission is defined on the feed itself.
| #!/usr/bin/env bash | |
| # Usage: pod-dump <namespace> <pod-identifier> | |
| # Summary: Grab a heap- and thread-dump of an app running on an active k8s pod ✨ | |
| if [ -z "$*" ]; then | |
| echo -e " | |
| Welcome to 💩 the Dumper 💩! 👋 | |
| This will trigger a dump of heap and thread for a specific pod on a defined namespace. Is it safe?! Yes, this is fairly safe to run! Worst case?: Stop-the-world. | |
| @usage: |
| echo "Stopping existing (perhaps) running Postgres.." | |
| brew services stop [email protected] | |
| if [ ! -f /usr/local/var/postgresql\@9.5/postmaster.pid ]; then | |
| echo "🛑 Ops, cannot unfuck Postgres. The file does not exists??? (postmaster.pid)"; | |
| echo "Try to restart and see if that helps? ===> brew services start [email protected] <===...amazingly this will also be happening right... NOW!" | |
| brew services restart [email protected] | |
| exit 1; | |
| fi | |
| echo "⚡️ Unfucking Postgres..."; |
| package cache | |
| import java.time.Duration | |
| /* | |
| Usage: | |
| data class Something(val whatever: String) | |
| internal val myAwesomeCache by lazy { Cache<Something>(expire = Duration.ofDays(10)) } | |
| myAwesomeCache.pushOrFetch("identifierForMySomething") { someMethodThatReturnsSomething() } | |
| */ |
| #!/usr/bin/env bash | |
| # usage ./azure-get-secrets-from-keyvault.sh my-awesome-az-keyvault | |
| KEY_VAULT=${1:-my-keyvault} | |
| if [[ -z `which az` ]]; then | |
| echo -e "OH NOES! Missing A Z U R E 😱! Install the tools by running \nbrew install azure-cli" | |
| exit 1; | |
| fi |
| #!/bin/sh | |
| # | |
| # An example hook script to check the commit log message. | |
| # Called by "git commit" with one argument, the name of the file | |
| # that has the commit message. The hook should exit with non-zero | |
| # status after issuing an appropriate message if it wants to stop the | |
| # commit. The hook is allowed to edit the commit message file. | |
| # | |
| # Place this file under "<project-home>/.githooks/commit-msg" | |
| # Allow only e.g "PK-12345: ", "FPFEIL-12: ", "FIX: " eller "Merge " |
| import com.google.gson.Gson; | |
| import com.google.gson.TypeAdapter; | |
| import com.google.gson.TypeAdapterFactory; | |
| import com.google.gson.reflect.TypeToken; | |
| import com.google.gson.stream.JsonReader; | |
| import com.google.gson.stream.JsonToken; | |
| import com.google.gson.stream.JsonWriter; | |
| import com.google.gson.stream.MalformedJsonException; | |
| import java.io.IOException; |