Skip to content

Instantly share code, notes, and snippets.

View kwilczynski's full-sized avatar
🐧
Have you built a Linux kernel recently?

Krzysztof Wilczyński kwilczynski

🐧
Have you built a Linux kernel recently?
  • Yokohama, Japan
  • 20:08 (UTC +09:00)
View GitHub Profile
package main
import (
"testing"
)
func A() {
m := map[int][]string{}
for i, _ := range []int{1, 2, 3} {
@kwilczynski
kwilczynski / main.go
Created June 12, 2023 12:26
ZooKeeper TLS in Go example
package main
import (
"crypto/dsa"
"crypto/ecdsa"
"crypto/rsa"
"crypto/tls"
"crypto/x509"
"encoding/pem"
"flag"
with_entries(if .key == "Version" then . + {value: (.value | tonumber)} else . end)
@kwilczynski
kwilczynski / openpgp.md
Created December 21, 2022 20:07
openpgp.md

$argon2id$v=19$m=64,t=512,p=2$G/DQSn2+4afFDXZRdR3Vlw$DBvv46nt3EEkY5ehfDVfQQ

Keybase proof

I hereby claim:

  • I am kwilczynski on github.
  • I am kwilczynski (https://keybase.io/kwilczynski) on keybase.
  • I have a public key whose fingerprint is 12D2 7D5D 8C8E 9BF1 AABC 7C7C 7C64 768D 3DE3 34E7

To claim this, I am signing this object:

name: "Auto-merge Dependabot Pull Request for Dockerfile updates"
permissions:
pull-requests: write
contents: write
on:
pull_request_target:
branches:
- main
FROM registry.access.redhat.com/ubi8/python-39:latest AS builder
ARG psycopg2_version=2.9.5
USER 0
RUN set -eux && \
mkdir -p /build && \
chown 1001 /build
package main
import (
"fmt"
"net/url"
"strings"
"unicode/utf8"
)
func normalizePassword(input string, escape bool) (output string) {
diff -uNr linux-stable/drivers/pci/quirks.c linux-xanmod/drivers/pci/quirks.c
--- linux-stable/drivers/pci/quirks.c 2022-09-09 08:28:12.533768183 +0900
+++ linux-xanmod/drivers/pci/quirks.c 2022-09-09 07:19:42.327689416 +0900
@@ -3601,6 +3601,106 @@
dev->dev_flags |= PCI_DEV_FLAGS_NO_BUS_RESET;
}
+static bool acs_on_downstream;
+static bool acs_on_multifunction;
+
@kwilczynski
kwilczynski / scrtipt.sh
Created July 27, 2022 16:47
Check if an IP (IPv4) address is valid in Jsonnet, a simple example.
$ cat test.jsonnet
local validateIP(ip) =
local aux(value) =
local mask = std.parseHex("ffffffff");
local octets = std.prune([if x != "" then std.parseInt(x) else null for x in std.split(value, '.')]);
if std.length(octets) != 4 then
false
else
local masked = ((octets[0] << 24) | (octets[1] << 16) | (octets[2] << 8) | (octets[3] << 0) & mask);
if masked < 0 then false else masked <= mask;