Skip to content

Instantly share code, notes, and snippets.

@macwinnie
macwinnie / kubectl_fqdn.sh
Last active September 25, 2023 00:25
Kubernetes – FQDN work
#!/usr/bin/env bash
# This small Gist is meant to hold some ideas of scraping useful information from Kubernetes.
# First trials, which were more complex (or just deprecated) are commented for documentation.
## get all services with NS and name
# kubectl get services -A -o json | jq '[ .items[].metadata | { "name": .name, "namespace": .namespace } ]'
# kubectl get services -A -o json | jq '[ .items[].metadata | { name, namespace } ]'
@macwinnie
macwinnie / pg-backup-docker.md
Created July 24, 2022 19:43
Docker – PostgreSQL Export und Import

PostgreSQL

Alle docker run Befehle unten können natürlich auch mit bereits laufenden PG-Containern durch docker exec ersetzt werden!

Vorbereitung

# ACHTUNG: nur in einer `bash`, nie in einer `zsh` ausführen =)
read -p  "DB Host: " PG_HOST
read -p  "DB Name: " PG_DB
@macwinnie
macwinnie / analyse texts old
Last active October 22, 2018 20:45 — forked from phpfiddle/fiddle_038149.php
[ Posted by Martin ] Word analysing in texts
<?php
$analyze = '';
$punctuations = '.:-,;–_?!';
if (isset($_POST['analyze']) and trim($_POST['analyze']) != '') {
$analyze = $_POST['analyze'];
$analyzed = preg_replace( "/\s+/", " ", $analyze );
$len = strlen($analyze);
$pl = strlen($punctuations);
for ($i=0; $i < $pl; $i++) {
$analyzed = str_replace($punctuations[$i], ' ', $analyzed);