Skip to content

Instantly share code, notes, and snippets.

View cardil's full-sized avatar

Chris Suszynski cardil

View GitHub Profile
@cardil
cardil / stress-revisions.sh
Last active May 5, 2020 17:02
Test that stress large number of Serverless revisions
#!/bin/bash
set -Eeuo pipefail
readonly START="${START:-1}"
readonly LIMIT="${LIMIT:-1200}"
for NUM in $(seq "${START}" "$LIMIT"); do
oc apply -f - <<EOF
apiVersion: serving.knative.dev/v1
@cardil
cardil / f37-k8s-shell.yml
Last active February 15, 2023 12:35
Fedora 37 shell for K8s
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: shell-cluster-admin
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: shell-cluster-admin
@cardil
cardil / cumbersome.sh
Last active October 21, 2020 17:27
Invalid & convoluted Bash scripting fixed
#!/usr/bin/env bash
set -Eeuo pipefail
function testing.of() {
local what
what="${1:?Pass what as arg[1]}"
echo "Testing of ${what}..."
eval "non-existing-showcase-command ${what}"
@cardil
cardil / remote-sleep.go
Created January 29, 2021 12:51
Reporduction for Wathola sender is affected by Coordinated Omission Problem
package main
import (
"fmt"
"html"
"log"
"net/http"
"time"
)
func waitForUser() pkgupgrade.BackgroundOperation {
file, err := homedir.Expand(
fmt.Sprintf("~/.cache/waitForUser-%s.sock", uuid.NewString()),
)
ensure.NoError(err)
var mod time.Time
check := func() (bool, error) {
res, err := os.Stat(file)
if err != nil {
return false, err
@cardil
cardil / heartbeats-cronjob.yml
Created September 3, 2021 21:52
Example of cronjob that sends CloudEvents to K_SINK
apiVersion: batch/v1
kind: CronJob
metadata:
name: heartbeat-cron
spec:
# Run every minute
schedule: "*/1 * * * *"
jobTemplate:
metadata:
labels:
@cardil
cardil / serverless-chaostest.sh
Last active September 10, 2021 09:18
This is a prototype of a Serverless Operator chaos test, suited directly to check for SRVKE-927, (looking for failures different then SRVKE-911)
#!/usr/bin/env bash
set -Eexuo pipefail
if ! [ -d serverless-operator ]; then
git clone https://github.com/cardil/serverless-operator.git --branch srvke-927
fi
cd serverless-operator
env SYSTEM_NAMESPACE=knative-serving \
@cardil
cardil / kernel-koji-install.sh
Created September 15, 2021 09:12
A script that can be used to quickly install specific version of Fedora kernel
#!/usr/bin/env bash
set -Eeuo pipefail
version="${1:?Pass a kernel version as arg[1]}"
build="${2:?Pass a kernel build as arg[2]}"
repo="${KOJI_REPO:-https://kojipkgs.fedoraproject.org//packages/kernel}"
arch="$(uname --hardware-platform)"
source /etc/os-release
rel="${VERSION_ID}"
@cardil
cardil / kafka-channel-6.yaml
Created October 1, 2021 20:17
Channel with 6 replicas
apiVersion: messaging.knative.dev/v1beta1
kind: KafkaChannel
metadata:
name: kafka-channel-6
labels:
app: kafka-channel-6
app.kubernetes.io/component: kafka-channel-6
app.kubernetes.io/instance: kafka-channel-6
app.kubernetes.io/name: kafka-channel-6
spec:
@cardil
cardil / openssh-client.log
Created November 17, 2021 12:51
Calling `ssh -vvv git@github.com` having `ssh-rsa` type key in knownhosts file
OpenSSH_8.6p1, OpenSSL 1.1.1l FIPS 24 Aug 2021
debug1: Reading configuration data /home/ksuszyns/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug3: /etc/ssh/ssh_config line 55: Including file /etc/ssh/ssh_config.d/50-redhat.conf depth 0
debug1: Reading configuration data /etc/ssh/ssh_config.d/50-redhat.conf
debug2: checking match for 'final all' host github.com originally github.com
debug3: /etc/ssh/ssh_config.d/50-redhat.conf line 3: not matched 'final'
debug2: match not found
debug3: /etc/ssh/ssh_config.d/50-redhat.conf line 5: Including file /etc/crypto-policies/back-ends/openssh.config depth 1 (parse only)
debug1: Reading configuration data /etc/crypto-policies/back-ends/openssh.config