Skip to content

Instantly share code, notes, and snippets.

View kwilczynski's full-sized avatar
:octocat:

Krzysztof Wilczyński kwilczynski

:octocat:
View GitHub Profile
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;
@kwilczynski
kwilczynski / gist:dc69ed5acb27a19ec1e29914895d7666
Last active January 11, 2024 09:40
Install lei for kernel development using lore directly on Ubuntu
apt install -y vim
apt install -y wget
apt install -y sqlite3 (used by a test, not needed for the build to complete)
apt install -y curl
apt install -y git
apt install -y build-essential
apt install -y pkg-config
duplicateConditionalAssign ext/nokogiri/xml_node.c:1898 The statement 'if (child_iter->parent!=(xmlNodePtr)node->doc) child_iter->parent=(xmlNodePtr)node->doc' is logically equivalent to 'child_iter->parent=(xmlNodePtr)node->doc'.
class Terramate < Formula
desc "Tool for managing multiple Terraform stacks"
homepage "https://github.com/mineiros-io/terramate"
# Disabled. No official release of Terramate yet.
# url ""
# sha256 ""
license "Apache-2.0"
head "https://github.com/mineiros-io/terramate.git", branch: "main"
# Disabled. No official release of Terramate yet.
# livecheck do
>>> a = 975205316
>>> b = 4096
>>> (a + b) - (a % b)
975208448
>>> ((a + b) - (a % b)) + 64
975208512
>>> 975208448 % 4096
0
>>> a + (b - 1) & ~(b - 1)
975208448
@kwilczynski
kwilczynski / config.txt
Last active December 25, 2022 17:45
Raspberry Pi 4 - /boot/config.txt
dtparam=i2c=off
dtparam=i2s=off
dtparam=spi=off
dtparam=uart0=off
dtparam=uart1=off
dtparam=audio=off
dtoverlay=disable-wifi