Skip to content

Instantly share code, notes, and snippets.

View kwilczynski's full-sized avatar
🐧

Krzysztof Wilczyński kwilczynski

🐧
  • Yokohama, Japan
  • 16:05 (UTC +09:00)
View GitHub Profile
server_names = [
'cloudflare',
'doh-crypto-sx',
'ams-doh-nl',
# Possible issues.
# 'faelix-ch-ipv4-doh',
'doh.ffmuc.net'
]
listen_addresses = [
@avoidik
avoidik / iptables-ns.sh
Last active October 21, 2022 06:29
Linux Network Namespaces
#!/bin/bash
flag_iptables=true
flag_dry_run=true
while getopts ":nf" arg; do
case $arg in
n) # Dry-run - does not preserve iptables rules.
flag_dry_run=false
;;
// 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 September 9, 2025 09:10
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