When you nest values in yaml like
server:
spec:
cpu: 0.5
You use it in helm as {{ .Values.server.spec.cpu | default 0.5 }}
, which works fine till you try the values as not defined
e.g
When you nest values in yaml like
server:
spec:
cpu: 0.5
You use it in helm as {{ .Values.server.spec.cpu | default 0.5 }}
, which works fine till you try the values as not defined
e.g
#!/usr/bin/env bash | |
echo "ingress deployments services statefulset" | \ | |
xargs -n 1 -I ktype \ | |
sh -c 'kubectl get ktype | tail -n+2 | awk '\''{print $1}'\'' | xargs -t -P 2 -I resource sh -c '\''kubectl get ktype resource -o yaml > resource.yml'\''' | |
# echo "ingress deployments services statefulset" | xargs -n 1 -I ktype sh -c | |
# ^^ runs a command for each ingress deployments etc.. the -I parameter is string substitution, i.e where ever it sees ktype it will put the ingress deployments etc read from stdin. | |
# kubectl get ktype | tail -n+2 | awk '{print $1}' | xargs -t -P 2 -I resource sh -c 'kubectl get ktype resource -o yaml > resource.yml' |
(ns lcm.core) | |
;; Finding the least common multiplier for a list of numbers | |
;; Reference material | |
;; https://en.wikipedia.org/wiki/Least_common_multiple | |
;; https://en.wikipedia.org/wiki/Euclidean_algorithm | |
;; https://lemire.me/blog/2013/12/26/fastest-way-to-compute-the-greatest-common-divisor/ | |
;; https://octave.sourceforge.io/octave/function/lcm.html | |
(defn bigint-gcd ^long [^long a ^long b] | |
(.longValue (.gcd (BigInteger/valueOf a) (BigInteger/valueOf b)))) |
import java.util.HashMap; | |
import java.util.List; | |
import java.util.LongSummaryStatistics; | |
import java.util.Map; | |
import java.util.stream.Collectors; | |
class Averages { | |
public static void main(String[] args) { | |
List<Map<String, Long>> data = List.of( | |
Map.of("age", 18L, "rate", 30L), |
#!/usr/bin/env python3 | |
# pip3 install matplotlib | |
# pip3 install numpy | |
import matplotlib.pyplot as plt | |
import numpy as np | |
import sys | |
file = sys.argv[1] | |
with open(file, 'rb') as io: |
#!/usr/bin/env python3 | |
# pip3 install sounddevice --user | |
# pip3 install numpy | |
# pip3 install scipy | |
import sounddevice as sd | |
import numpy as np | |
fs=44100 | |
duration = 5 # seconds |
(require '[clojure.walk :refer [postwalk]]) | |
(defn mapvals [f m] | |
(let [v-f (fn [v] | |
(cond | |
(map? v) v | |
(coll? v) (into (empty v) (map f) v) | |
:else (f v))) | |
(defn in? [vs ls] | |
(boolean (some (partial (set vs)) ls))) | |
(in? [1 2] [3 4 2 5]) => false | |
(in? [1 2] [3 1 4 2 5]) => true | |
(defn in? [v ls] | |
(loop [[x & rs] ls] | |
(if-not x |
# The aim is to support e.g | |
# URL="dburl" variables and then override at will when PROD_URL is available. | |
switch_prod.sh | |
for v in $(env | awk '/PROD_/ {gsub(/PROD_/,""); print $1}'); do | |
eval "export $v" | |
done | |