2 command line tools are required to works with kubernetes:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
declare -- url="$1" | |
if [[ -z "$url" ]]; then | |
echo "Missing url" | |
exit 1 | |
fi | |
# @example https://goo.gl/ | |
curl -sLD - "$url" -o /dev/null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Returns a top 20 sortered list of used ressources by process. | |
for x in `ps -eF| awk '{ print $2 }'` | |
do echo `ls /proc/$x/fd 2> /dev/null | wc -l` $x `cat /proc/$x/cmdline 2> /dev/null` | |
done | sort -n -r | head -n 20 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
curl -sL -w "%{http_code} %{url_effective} (%{time_total})\\n" -H 'Host: example.com' "http://localhost:8080/" -o /dev/null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"flag" | |
"fmt" | |
"io" | |
"log" | |
"os" | |
"golang.org/x/crypto/openpgp" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Package slices defines various functions useful with slices of any type. | |
package slices | |
import "math" | |
// Chunk splits a slice into uniform chunks of the requested size. | |
func Chunk[V any](x []V, size int) [][]V { | |
n := len(x) | |
if n == 0 || size <= 0 { | |
return nil |