Skip to content

Instantly share code, notes, and snippets.

View cardil's full-sized avatar

Chris Suszynski cardil

View GitHub Profile
@cardil
cardil / podman-info.yaml
Created October 9, 2023 10:52
Podman info
host:
arch: amd64
buildahVersion: 1.32.0
cgroupControllers:
- cpu
- io
- memory
- pids
cgroupManager: systemd
cgroupVersion: v2
@cardil
cardil / knative-nightly-ci-kn-plugin-event-635.log
Created September 1, 2023 18:54
Log of Knative-Serverless fork sync for kn-plugin-event #635
00:34:05 Started by upstream project "triggers/knative-nightly-ci-trigger" build number 859
00:34:05 originally caused by:
00:34:05 Started by timer
00:34:05 Loading library jenkins-dsl@master
00:34:05 Attempting to resolve master from remote references...
00:34:05 > git --version # timeout=10
00:34:06 > git --version # 'git version 2.31.1'
00:34:06 using GIT_SSH to set credentials Jenkins SSH private key
00:34:06 [INFO] Currently running in a labeled security context
00:34:06 > /usr/bin/chcon --type=ssh_home_t /tmp/jenkins-gitclient-ssh17556338054709331370.key
@cardil
cardil / ubi8-k8s-shell.yml
Created July 5, 2023 17:57
Ubi8 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
Building function image
Pulling image gcr.io/paketo-buildpacks/builder:base
29dc7596322b: Already exists
ed10c4dc1cb9: Already exists
baabd6616689: Already exists
70e0bea64ce8: Already exists
5128128e1ba9: Already exists
5e995c53af94: Already exists
c971d13c0b7c: Already exists
d9853c09e885: Already exists
@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 / bash-error-pitfall.sh
Last active October 12, 2022 17:30
Bash scripting pitfall
#!/usr/bin/env bash
set -Eeuo pipefail
function error_handler() {
local code="${1:-${?}}"
abort "🚨 Error (code: ${code}) occurred at ${BASH_SOURCE[1]}:${BASH_LINENO[0]}, with command: ${BASH_COMMAND}"
}
function abort() {
@cardil
cardil / serverless-install.sh
Last active February 23, 2022 23:16
Installs Serverless on OpenShift (with Serving+Eventing)
kubectl apply -f https://raw.githubusercontent.com/cardil/openshift-serverless-pres-notes/master/serverless-subscription.yaml
while ! kubectl get csv -n openshift-serverless -l operators.coreos.com/serverless-operator.openshift-serverless= 1>/dev/null 2>&1; do sleep 1; done
kubectl wait --for=jsonpath='{.status.phase}'=Succeeded \
--timeout=5m csv -n openshift-serverless \
-l operators.coreos.com/serverless-operator.openshift-serverless=
kubectl apply -f https://raw.githubusercontent.com/cardil/openshift-serverless-pres-notes/master/serverless-bundle.yaml
while ! kubectl get knativeserving knative-serving -n knative-serving 1>/dev/null 2>&1; do sleep 1; done
kubectl wait --for=condition=Ready --timeout=5m \
knativeserving knative-serving -n knative-serving
@cardil
cardil / ExamplePartOfActivity.java
Last active January 31, 2022 10:49
MultiSelectListPreference for devices running Android in the API earlier than level 11. Support ChangeListener receiving list of selected values. Supports automatically setting of summary. Examples attached.
private static OnPreferenceChangeListener autoOnChangeListener = new OnPreferenceChangeListener() {
@Override
public boolean onPreferenceChange(Preference rawPreference, Object newValue) {
List<CharSequence> selected = Arrays.asList((CharSequence[]) newValue);
if (selected.contains("1")) {
// do some work
}
return true;
}
@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
@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: