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
  • 23:49 (UTC +09:00)
View GitHub Profile
@kwilczynski
kwilczynski / patch.diff
Created May 4, 2021 00:15
systemd 246 systemd-rfkill fix
diff --git a/src/rfkill/rfkill.c b/src/rfkill/rfkill.c
index 5019828..e2b9773 100644
--- a/src/rfkill/rfkill.c
+++ b/src/rfkill/rfkill.c
@@ -1,4 +1,4 @@
-/* SPDX-License-Identifier: LGPL-2.1+ */
+/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <fcntl.h>
#include <linux/rfkill.h>
@kwilczynski
kwilczynski / extconf.rb
Last active June 12, 2021 19:58
Custom Ruby type check to fix problem with JRuby and TruffleRuby
# frozen_string_literal: true
require 'mkmf'
dir_config('test')
create_header
create_makefile('test')
@quillaja
quillaja / arena.go
Created March 31, 2021 06:18
go memory arena
package arena
// #include <malloc.h>
import "C"
import (
"runtime"
"unsafe"
)
// Arena memory allocator gets a large chunk of memory from the system at once
@kwilczynski
kwilczynski / script.sh
Created March 23, 2021 10:35
Dump ad list (ad blocking list), whitelist and blacklist from Sqlite database on Pi Hole
sqlite3 gravity.db.backup -header -csv 'select * from adlist' > adlist.csv
sqlite3 gravity.db.backup -header -csv 'select * from vw_whitelist' > whitelist.csv
sqlite3 gravity.db.backup -header -csv 'select * from vw_blacklist' > blacklist.csv
@kwilczynski
kwilczynski / script.sh
Last active June 24, 2024 00:16
Build Coccinelle
export PATH='/usr/local/bin:/usr/local/sbin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin'
cd ..
python3 -m venv coccinelle
cd -
. bin/activate
make clean
./autogen
@kwilczynski
kwilczynski / script.sh
Last active June 24, 2024 00:16
Build smatch
make clean
export PATH='/usr/local/bin:/usr/local/sbin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin'
make PREFIX='/usr' -j$(nproc)
make DESTDIR='/tmp/smatch' PREFIX='/usr' install
@kwilczynski
kwilczynski / dnscrypt-proxy.toml
Last active June 18, 2021 13:29
Pi-Hole with dnscrypt-proxy using DoH with anonymous forwarders running under Docker with docker-compose on Raspberry Pi.
server_names = [
'cloudflare',
'doh-crypto-sx',
'ams-doh-nl',
# Possible issues.
# 'faelix-ch-ipv4-doh',
'doh.ffmuc.net'
]
listen_addresses = [
@kwilczynski
kwilczynski / gist:0eaf0bcc7022fa2625c8cf3825085318
Created March 21, 2021 09:36
Disable dhclient listening on IPv6 on Debian or Ubuntu
allow-hotplug eth0
iface eth0 inet manual
up /sbin/dhclient -4 -v -i -pf /run/dhclient.${IFACE}.pid \
-lf /var/lib/dhcp/dhclient.${IFACE}.leases \
-I ${IFACE}
down /sbin/dhclient -4 -v -i -pf /run/dhclient.${IFACE}.pid \
-lf /var/lib/dhcp/dhclient.${IFACE}.leases \
-I ${IFACE} \
-r
@pdp7
pdp7 / beaglev.dts
Last active March 25, 2021 08:26
Example device tree (to show the compatible strings currently being used in development)
/dts-v1/;
#include "starfive_vic7100_clk.dtsi"
#include <dt-bindings/starfive_fb.h>
/ {
#address-cells = <2>;
#size-cells = <2>;
compatible = "sifive,freedom-u74-arty";
model = "sifive,freedom-u74-arty";
root@pve:~# gcc -Wall -I./Projects/Personal/Other/pciutils/lib -L./Projects/Personal/Other/pciutils/lib -Wall -g gpioke.c -lpci -lz -ludev -lresolv
root@pve:~# ./a.out
[*] Checking for a ICH0..ICH5 system
[*] GPIOBASE=00000000, GC=00
[-] GPIOBASE not implemented at 0058
[*] Checking for a ICH6..ICH9 or Series 5..9 PCH system
[*] GPIOBASE=00000000, GC=00
[-] GPIOBASE not implemented at 0048
[*] Checking for a Series 10 PCH system
[*] Cannot find D31:F1, assuming it is hidden by firmware