This gist demonstrates how to change the reclaim policy of a Persistent Volume (PV) in Kubernetes from "Delete" to "Retain".
- kubectl configured to your cluster
- Proper permissions to modify PV resources
fetch k8s_node | |
| ${project_id_var} | |
| ${cluster_name_var} | |
| metric kubernetes.io/node/cpu/allocatable_cores | |
| align next_older(2m) | |
| group_by [resource.location], .count() |
#!/bin/bash | |
# Script to display Kubernetes pods grouped and color-coded by node | |
kubectl get pods -o wide | sort -k7 | awk ' | |
BEGIN { | |
# Define ANSI color codes for groups | |
colors[1] = "\033[1;31m"; # Red | |
colors[2] = "\033[1;32m"; # Green | |
colors[3] = "\033[1;33m"; # Yellow | |
colors[4] = "\033[1;34m"; # Blue |
a = document.querySelectorAll('.segment-text') | |
b = [...a] | |
c = b.map(e => e.innerText).join('\n') | |
console.log(c) |
#!/bin/bash | |
# Create a disconnected git branch for GitHub Pages | |
# Clone the repository without checking out files | |
git clone --no-checkout https://github.com/yourusername/yourrepo.git | |
cd yourrepo | |
# Create a new orphan branch | |
git checkout --orphan gh-pages |
#!/usr/bin/python3 | |
import string | |
import codecs | |
import random | |
s = """Ornhgvshy vf orggre guna htyl. | |
Rkcyvpvg vf orggre guna vzcyvpvg. | |
Fvzcyr vf orggre guna pbzcyrk. | |
Pbzcyrk vf orggre guna pbzcyvpngrq. |
#!/bin/bash | |
# die () { | |
# echo >&2 "$@" | |
# exit 1 | |
# } | |
# v=4.2.24 | |
# [ "$v" = "4.2.24" ] || | |
# die "Patch solo puede aplicarse a [email protected], se encontro $v" | |
# usage: curl 'https://gist.githubusercontent.com/korutx/27f9b7d8fd2f141002c6922456d73ab9/raw/a1c05d17069acb64893066c725202c79e9c6a4db/patch-configure-devserver.sh' | bash /dev/stdin ~/.nvm/versions/node/v13.9.0/lib/node_modules | |
nmpath="$1" |
/** | |
* Hight-Order Funcion | |
* Returns a single item by iterating through the list, successively calling the iterator function and passing it an accumulator value and | |
* the current value from the array, and then passing the result to the next call. | |
* @param {Array} list Array of element | |
* @param {Function} fn Functor. The iterator function. Receives two values, the accumulator and the current element from the array. | |
* @param {*} acc The accumulator value. | |
* @return {*} The final, accumulated value. | |
*/ | |
const reduce = (list, fn, acc) => { |
#!/bin/sh | |
# @Author: @korutx | |
# @Date: 2018-05-31 12:18:34 | |
# @Last Modified time: 2018-05-31 12:18:34 | |
# | |
# Using: Add the following lines to .bashrc | |
# | |
# if [ -f ~/bin/my_prompt.sh ]; then | |
# . ~/bin/my_prompt.sh | |
# fi |