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
  • 10:31 (UTC +09:00)
View GitHub Profile
// Based on https://github.com/ericwbailey/millennials-to-snake-people.
function walkTextNodes(rootNode) {
let walker = document.createTreeWalker(rootNode, NodeFilter.SHOW_TEXT,
function(node) {
if (node.textContent.length === 0) {
return NodeFilter.FILTER_SKIP;
}
return NodeFilter.FILTER_ACCEPT
},
@kwilczynski
kwilczynski / script.sh
Last active June 24, 2024 00:48
Build cppcheck
make clean
export PATH='/usr/local/bin:/usr/local/sbin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin'
make DESTDIR='/tmp/cppcheck' MATCHCOMPILER=yes HAVE_RULES=yes FILESDIR='/usr/share/cppcheck' CXXFLAGS='-O2 -DNDEBUG -Wall -Wno-sign-compare -Wno-unused-function' -j$(nproc) install
OR
sudo make MATCHCOMPILER=yes HAVE_RULES=yes FILESDIR='/usr/share/cppcheck' CXXFLAGS='-O2 -DNDEBUG -Wall -Wno-sign-compare -Wno-unused-function' -j$(nproc) install
@kwilczynski
kwilczynski / script.sh
Last active November 2, 2021 15:39
Build sparse
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/sparse' PREFIX='/usr' install
@terjanq
terjanq / secdriven.md
Last active July 21, 2024 16:33
A TL;DR solution to Security Driven by @terjanq

A TL;DR solution to Security Driven by @terjanq

For this year's Google CTF, I prepared a challenge that is based on a real-world vulnerability. The challenge wasn't solved by any team during the competition so here is the proof that the challenge was in fact solvable! :)

The goal of the challenge was to send a malicious file to the admin and leak their file with a flag. The ID of the file was embedded into the challenge description (/file?id=133711377731) and only admin had access to it, because the file was private.

Disclamer: The write-up is written on airplane therefore the quality of it is poor, mostly to showcase the required steps to solve the challenge

@peterpme
peterpme / home-assistant-os-kvm-linux.sh
Last active March 17, 2023 22:10
Home Assistant OS with Ubuntu 20.04 (Linux) using KVM and Nortek USB for Z-Wave / ZHA
## Home Assistant OS (Latest as of July 17th, 2021)
## Installation using Ubuntu 20.04 Server and KVM
## Thanks to:
# https://gist.github.com/dsbaars/82a31303f50da08edb422fdc15031257
# https://community.home-assistant.io/t/install-home-assistant-os-with-kvm-on-ubuntu-headless-cli-only/254941
# /var/lib/libvirt/images/hassos-vm
## Everything lives here
mkdir -vp /var/lib/libvirt/images/hassos-vm && cd /var/lib/libvirt/images/hassos-vm
Install the "xdotool" utility as usual on Ubuntu, then go to "/lib/systemd/system-sleep"
directory and create a small shell script called "capslock" with the following content:
#!/bin/sh
case "$1" in
post)
/usr/bin/logger -t suspend -s 'Resetting CapsLock key'
/usr/bin/xdotool --clearmodifiers --delay 500 --repeat 2 Caps_Lock
;;
@aojea
aojea / README.md
Last active December 2, 2024 16:20
Run Kubernets conformance tests
@kwilczynski
kwilczynski / nginx-log.service
Created June 12, 2021 19:56
A dummy systemd Unit to fix Nginx error_log problem even when /dev/null path is set
[Unit]
Description=Dummy unit to create log directory for Nginx
After=network.target
[Service]
Type=oneshot
ExecStart=/bin/mkdir -p /var/log/nginx
ExecStart=/bin/chown root:adm /var/log/nginx
ExecStart=/bin/chmod 755 /var/log/nginx
@kwilczynski
kwilczynski / content.js
Last active May 13, 2023 09:09
Simple Chrome extension that replaces Git commit IDs and URL with proper links
var textAreasCount = 0;
var linesCount = 0;
var linesReplaced = 0;
var linesSkipped = 0;
var start = performance.now();
function formatMilliseconds(ms) {
return Number.parseFloat(ms.toFixed(3))
@siraben
siraben / projects-leaving-freenode.md
Last active March 31, 2023 18:13
List of projects and channels that have left or stayed on Freenode

Note: due to volume, this has been moved to https://github.com/siraben/freenode-exodus

Projects and channels that have left Freenode

This is a (necessarily incomplete) list of projects and channels that have decided to permanently move out of Freenode to https://libera.chat (unless stated otherwise). Please reach out below or on IRC if there's additions or corrections.

Sources are mostly comments I've seen on HN, various IRC channels and web searches.