Skip to content

Instantly share code, notes, and snippets.

View kwilczynski's full-sized avatar
:octocat:

Krzysztof Wilczyński kwilczynski

:octocat:
View GitHub Profile
docker.io/library/busybox:latest
{
"status": {
"id": "ba5dc23f65d4cc4a4535bce55cf9e63b068eb02946e3422d3587e8ce803b6aab",
"repoTags": [
"docker.io/library/busybox:latest"
],
"repoDigests": [
"docker.io/library/busybox@sha256:4be429a5fbb2e71ae7958bfa558bc637cf3a61baf40a708cb8fff532b39e52d0",
@kwilczynski
kwilczynski / disable-ipv6.sh
Last active April 11, 2024 11:09
Amazon Linux OS tweaks
#!/bin/bash
set -u
set -e
set -o pipefail
export PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
cat <<'EOF' > /etc/modprobe.d/blacklist-ipv6.conf
@kwilczynski
kwilczynski / getStackOutputs.js
Last active April 1, 2024 10:25
Get outputs from a stack by name in CloudFormation.
'use strict';
function getStackOutputs(properties, callback) {
if (typeof properties.StackName === 'undefined') {
return callback(new Error('The StackName property was not specified.'));
}
let filter = [];
if (typeof properties.Filter !== 'undefined') {
if (!Array.isArray(properties.Filter)) {
@kwilczynski
kwilczynski / Makefile
Last active March 8, 2024 23:48
Makefile for my Go projects (an example).
SHELL := /bin/bash
REV := $(shell git rev-parse HEAD)
CHANGES := $(shell test -n "$$(git status --porcelain)" && echo '+CHANGES' || true)
TARGET := packer-provisioner-itamae-local
VERSION := $(shell cat VERSION)
OS := darwin freebsd linux openbsd
ARCH := 386 amd64
@kwilczynski
kwilczynski / Makefile
Created February 20, 2024 11:19
Simple Linux kernel module to toggle running process state between "D" (uninterruptible) and interruptible
ccflags-y := -DDEBUG -Wfatal-errors
ifneq ($(KERNELRELEASE),)
obj-m += state-toggle.o
else
BUILD_KERNEL ?= /lib/modules/$(shell uname -r)/build
default:
$(MAKE) -C $(BUILD_KERNEL) M=$(CURDIR) modules
endif
@kwilczynski
kwilczynski / signal.go
Created May 11, 2017 20:40
Example signal handling in Go.
package main
import "fmt"
import "os"
import "os/signal"
import "syscall"
func main() {
done := make(chan bool, 1)
@kwilczynski
kwilczynski / fake-redirect.py
Created February 12, 2017 20:32
Create a simple HTTP redirect with Python on localhost.
import SimpleHTTPServer
import SocketServer
class FakeRedirect(SimpleHTTPServer.SimpleHTTPRequestHandler):
def do_GET(self):
print self.path
self.send_response(301)
new_path = '%s%s'%('http://localhost:8081', self.path)
self.send_header('Location', new_path)
self.end_headers()
openshift-machine-api cluster-autoscaler-operator-58fb97bc76-bqfbs cluster-autoscaler-operator I0116 11:12:17.588634 1 status.go:450] No ClusterAutoscaler. Reporting available.
openshift-machine-api cluster-autoscaler-operator-58fb97bc76-bqfbs cluster-autoscaler-operator I0116 11:12:17.588747 1 status.go:244] Operator status available: at version 4.14.4
openshift-kube-scheduler openshift-kube-scheduler-kwilczynski-dev-spqk6-master-2.c.openshift-gce-devel.internal kube-scheduler I0116 11:12:17.589871 1 eventhandlers.go:118] "Add event for unscheduled pod" pod="openshift-monitoring/node-exporter-9cvc2"
openshift-kube-scheduler openshift-kube-scheduler-kwilczynski-dev-spqk6-master-2.c.openshift-gce-devel.internal kube-scheduler I0116 11:12:17.589923 1 scheduling_queue.go:419] "Pod moved to an internal scheduling queue" pod="openshift-monitoring/node-exporter-9cvc2" event="PodAdd" queue="Active"
openshift-kube-scheduler openshift-kube-scheduler-kwilczynski-dev-spqk6-master-0.c.openshift-gc
kube-system kube-apiserver-master-node kube-apiserver 00000010 75 72 63 65 51 75 6f 74 61 4c 69 73 74 12 0c 0a |urceQuotaList...|
kube-system kube-apiserver-master-node kube-apiserver 00000020 0a 0a 00 12 04 32 38 37 39 1a 00 1a 00 22 00 |.....2879....".|
kube-system kube-scheduler-master-node kube-scheduler I0117 07:18:07.037670 1 eventhandlers.go:126] "Add event for unscheduled pod" pod="default/test-cj4n2"
kube-system kube-scheduler-master-node kube-scheduler I0117 07:18:07.037703 1 scheduling_queue.go:575] "Pod moved to an internal scheduling queue" pod="default/test-cj4n2" event="PodAdd" queue="Active"
kube-system kube-scheduler-master-node kube-scheduler I0117 07:18:07.037736 1 schedule_one.go:85] "About to try and schedule pod" pod="default/test-cj4n2"
kube-system kube-scheduler-master-node kube-scheduler I0117 07:18:07.037742 1 schedule_one.go:98] "Attempting to schedule pod" pod="default/test-cj4n2"
kube-system kube-scheduler-master-node kube-scheduler I0117 07:18:07.
@kwilczynski
kwilczynski / dynamodb-setup.sh
Last active January 14, 2024 15:22
Quickly automatically associate Elastic IP address with the current EC2 instance written in Go.
aws dynamodb create-table --region <REGION> --profile <PROFILE> --table-name "<TABLE>" --attribute-definitions "AttributeName=key,AttributeType=S" --key-schema "AttributeName=key,KeyType=HASH" --billing-mode "PAY_PER_REQUEST"
aws dynamodb create-table --region <REGION> --profile <PROFILE> --table-name "<TABLE>" --attribute-definitions "AttributeName=key,AttributeType=S" --key-schema "AttributeName=key,KeyType=HASH" --billing-mode "PROVISIONED" --provisioned-throughput "ReadCapacityUnits=1,WriteCapacityUnits=1"
aws dynamodb update-time-to-live --region <REGION> --profile <PROFILE> --table-name "<TABLE>" --time-to-live-specification "Enabled=true,AttributeName=ttl"
aws dynamodb scan --region <REGION> --profile <PROFILE> --table-name "<TABLE>"