This file contains hidden or 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
@html "<testsuite name=\"kyverno\" tests=\"\(.summary|add)\" failures=\"\(.summary.fail)\" skipped=\"\(.summary.skip)\" errors=\"\(.summary.error)\">", | |
(.results | group_by(.policy) | .[] | [ | |
@html "<testsuite name=\"\(.[0].policy)\">", | |
(group_by(.rule) | .[] | [ | |
"<testsuite name=\"\(.[0].policy).\(.[0].rule)\">", | |
(.[] | [ | |
@html "<testcase name=\"\(.policy).\(.rule).\(.resources[0].namespace)/\(.resources[0].kind)/\(.resources[0].name)\">", | |
(if .result == "fail" | |
then @html "<failure message=\"\(.message)\" />" | |
else if .result == "skip" |
This file contains hidden or 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
#!/bin/sh -eu | |
# Update the actual storage requets of existing PVCs to those specified in their owning StatefulSet. | |
# This assumes the StatefulSet was already "updated" (via `kubectl replace --force --cascade=orphan` or similar) | |
STS="$1" | |
kubectl get statefulset "$STS" -o jsonpath='{range .spec.volumeClaimTemplates[]}{.metadata.name} {.spec.resources.requests.storage}{"\n"}{end}' | | |
while read -r VOLNAME SIZE; do | |
for PVC in $(kubectl get pvc -o custom-columns=NAME:.metadata.name | grep -E "^$VOLNAME-$STS-[0-9]+\$"); do |
This file contains hidden or 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
#!/bin/sh | |
set -eu | |
REPO="$1" | |
ARCHIVE="$2" | |
FILE="$3" | |
# Fetch the latest version using GitHub API | |
VERSION="$(curl -s "https://api.github.com/repos/${REPO}/releases" | jq -r 'map(select(.prerelease | not)) | .[0].tag_name' | cut -c 2-)" |
This file contains hidden or 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
#!/bin/bash | |
set -eu | |
PROXY=false | |
usage() { | |
echo "Usage: $0 [-X connect -x <proxy:port>] <host> <port>" | |
} |
This file contains hidden or 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
stream_defaults.rules = { | |
{ | |
matches = { | |
{ | |
{ "application.name", "matches", "Firefox" }, | |
{ "media.name", "matches", "AudioCallbackDriver" }, | |
{ "media.class", "matches", "Stream/Output/Audio" }, | |
} | |
}, | |
apply_properties = { |
This file contains hidden or 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
class TPLink < Oxidized::Model | |
# tp-link prompt | |
prompt /^\r?([\w.@()-]+[#>]\s?)$/ | |
comment '! ' | |
# handle paging | |
# workaround for sometimes missing whitespaces with "\s?" | |
expect /Press\s?any\s?key\s?to\s?continue\s?\(Q\s?to\s?quit\)/ do |data, re| | |
send ' ' | |
data.sub re, '' |
This file contains hidden or 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
#!/bin/sh /etc/rc.common | |
START=50 | |
USE_PROCD=1 | |
NAME=co2mon | |
PROG=/root/co2mon/hidapi_co2mon.py | |
start_service() { | |
local url=$(uci -q get co2mon.@co2mon[0].url) |
This file contains hidden or 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
#!/bin/bash | |
set -eu | |
declare -a STATES=(OK WARNING CRITICAL UNKNOWN) | |
declare -i STATE_OK=0 | |
declare -i STATE_WARNING=1 | |
declare -i STATE_CRITICAL=2 | |
declare -i STATE_UNKNOWN=3 |
This file contains hidden or 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
#!/bin/sh | |
set -eu | |
if [ "$#" != 2 ]; then | |
echo "Usage: $(basename "$0") <iface> <file>" | |
exit 1 | |
fi | |
IFACE="$1" |
This file contains hidden or 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
#!/bin/sh | |
SERVER="$1" | |
INTERVAL=10 | |
# read once and ignore result, as it is bogus at first | |
cat /sys/bus/w1/devices/*/w1_slave > /dev/null | |
while sleep "$INTERVAL"; do | |
for DEV in /sys/bus/w1/devices/*/w1_slave; do |
NewerOlder