Skip to content

Instantly share code, notes, and snippets.

Engineering something

Chris Suszynski cardil

Engineering something
View GitHub Profile
cardil /
Last active Jul 9, 2020
[Draft] JEP - Change name of imported type (aliasing)


Change name of imported type (aliasing)


The goal is to make code more productive and clean in cases where multiple classes with same name must be used in code. It should relief a developers frustration in that

cardil / f32-k8s-shell.yml
Created May 15, 2020
Fedora 32 shell for K8s
View f32-k8s-shell.yml
kind: Pod
apiVersion: v1
name: shell
purpose: manual-inspection
- name: shell-f32
cardil /
Last active May 5, 2020
Test that stress large number of Serverless revisions
set -Eeuo pipefail
readonly START="${START:-1}"
readonly LIMIT="${LIMIT:-1200}"
for NUM in $(seq "${START}" "$LIMIT"); do
oc apply -f - <<EOF
cardil /
Last active Jan 17, 2020
Eventing #2388 manual reproduction

Eventing manual reproduction

I've manage to reproduce errors on a GCP Kubernetes cluster identical to the one used in Prow.

Below are test results. There ware 10 lost events, 505 total.

In other files are errors that I've noticed, and fetched with Stackdriver Log Viewer UI.

020-01-17T17:47:26.585+0100	INFO	prober/verify.go:35	Fetched receiver report. Events propagated: 495. State: failed
View activator-947bd7448-9mxxv-activator.log
2020/01/03 14:36:38 Registering 5 clients
2020/01/03 14:36:38 Registering 2 informer factories
2020/01/03 14:36:38 Registering 3 informers
{"level":"info","ts":"2020-01-03T14:36:38.541Z","caller":"logging/config.go:108","msg":"Successfully created the logger.","":"{\n \"level\": \"info\",\n \"development\": false,\n \"outputPaths\": [\"stdout\"],\n \"errorOutputPaths\": [\"stderr\"],\n \"encoding\": \"json\",\n \"encoderConfig\": {\n \"timeKey\": \"ts\",\n \"levelKey\": \"level\",\n \"nameKey\": \"logger\",\n \"callerKey\": \"caller\",\n \"messageKey\": \"msg\",\n \"stacktraceKey\": \"stacktrace\",\n \"lineEnding\": \"\",\n \"levelEncoder\": \"\",\n \"timeEncoder\": \"iso8601\",\n \"durationEncoder\": \"\",\n \"callerEncoder\": \"\"\n }\n}"}
{"level":"info","ts":"2020-01-03T14:36:38.541Z","caller":"logging/config.go:109","msg":"Logging level set to info"}
cardil / knative-serving-operator.log
Created Nov 26, 2019
View knative-serving-operator.log
{"level":"info","ts":1574791351.2938538,"logger":"cmd","msg":"Go Version: go1.13.4"}
{"level":"info","ts":1574791351.2938857,"logger":"cmd","msg":"Go OS/Arch: linux/amd64"}
{"level":"info","ts":1574791351.2938917,"logger":"cmd","msg":"Version of operator-sdk: v0.8.0"}
{"level":"info","ts":1574791351.2943332,"logger":"leader","msg":"Trying to become the leader."}
{"level":"info","ts":1574791351.4278533,"logger":"leader","msg":"No pre-existing lock was found."}
{"level":"info","ts":1574791351.4339006,"logger":"leader","msg":"Became the leader."}
{"level":"info","ts":1574791351.5361984,"logger":"cmd","msg":"Registering Components."}
{"level":"info","ts":1574791351.536406,"logger":"manifestival","msg":"Reading file","name":"deploy/resources"}
{"level":"info","ts":1574791351.552737,"logger":"openshift","msg":"Detected","gvk":", Kind=route"}
{"level":"info","ts":1574791351.5529993,"logger":"openshift","msg":"Dropping APIService for"}
cardil / aws-vpc-limits.groovy
Created Oct 17, 2019
A littple script that fetches VPC releated AWS quotas
View aws-vpc-limits.groovy
import groovy.json.JsonSlurper
def regions = ["us-west-1", "us-west-2", "us-east-1", "us-east-2", "eu-west-1"]
def vpcService = 'vpc'
def vpcCode = 'L-F678F1CE'
def elasticIpService = 'ec2'
def elasticIpCode = 'L-0263D0A3'
println "Current AWS limits"
println "------------------"
cardil /
Last active Apr 7, 2019
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() {
public boolean onPreferenceChange(Preference rawPreference, Object newValue) {
List<CharSequence> selected = Arrays.asList((CharSequence[]) newValue);
if (selected.contains("1")) {
// do some work
return true;
cardil /
Last active Jan 15, 2019
Bill of Materials (BOM) dla JS [PL]

Chciałem opisać koncept pracy nad dużym projektem. Wyobraźmy sobie duży projekt, wiele osób, wiele zakresów biznesowych, wiele osobnych backendów, wszystko powinno być zintegrowane do jednej spójnej aplikacji. Przy takim projekcie proponowałbym pracę w z użyciem projektu BOM (Bill of Materials).

Ten koncept wywodzi się z skomplikowanych projektów ze świata Java.

Poniżej graf przedstawiający taką strukturę.

cardil /
Last active Sep 5, 2018
Linux NVidia Optimus with external monitor - enable/disable scripts tested on Ubuntu. Source article:
# You will need latest NVIDIA drivers installed. At the time of writing, version is 331.20.
# On ubuntu 13.10, it looks like this:
sudo add-apt-repository ppa:xorg-edgers/ppa
sudo apt-get update
sudo apt-get install nvidia-331
# Now we need to install bumblebee:
sudo add-apt-repository ppa:bumblebee/stable
sudo apt-get install bumblebee bumblebee-nvidia bbswitch-dkms
You can’t perform that action at this time.