Skip to content

Instantly share code, notes, and snippets.

#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/sched.h>
#include <linux/cred.h>
static char* user_string;
static int __init my_init(void)
{
#include <linux/kernel.h> // for printk
#include <linux/module.h> // for init_module and exit_module
#include <linux/keyboard.h> // for register_keyboard_notifier and unregister_keyboard_notifier
#include <linux/sched.h> // for current
// flag to track whether the string has been entered
static bool string_entered = false;
// callback function for keyboard events
static int keyboard_notifier_callback(struct notifier_block *nb, unsigned long code, void *_param)
@dzaczek
dzaczek / kdbxbond.c
Created December 6, 2022 21:16
Kernel module test
#include <linux/kernel.h> // for printk
#include <linux/module.h> // for init_module and exit_module
#include <linux/keyboard.h> // for register_keyboard_notifier and unregister_keyboard_notifier
// flag to track whether the string has been entered
static bool string_entered = false;
// callback function for keyboard events
static int keyboard_notifier_callback(struct notifier_block *nb, unsigned long code, void *_param)
{
@dzaczek
dzaczek / life.go
Created December 6, 2022 20:34
gameof life
package main
import (
"fmt"
"github.com/nsf/termbox-go"
)
const (
width = 60
height = 20
sudoroot@pihole:~# sqlite3 /etc/pihole/gravity.db "SELECT address FROM adlist ;"
http://hole.cert.pl/domains/domains_hosts.txt
https://blocklistproject.github.io/Lists/abuse.txt
https://blocklistproject.github.io/Lists/ads.txt
https://blocklistproject.github.io/Lists/fraud.txt
https://blocklistproject.github.io/Lists/malware.txt
https://blocklistproject.github.io/Lists/piracy.txt
https://blocklistproject.github.io/Lists/scam.txt
https://blocklistproject.github.io/Lists/tracking.txt
https://osint.digitalside.it/Threat-Intel/lists/latestdomains.txt
### Keybase proof
I hereby claim:
* I am dzaczek on github.
* I am dzaczek (https://keybase.io/dzaczek) on keybase.
* I have a public key ASARWaNv4rqY4t7oYsYKuhIE3y46LYHpleJjkpRSsNAiVQo
To claim this, I am signing this object:
lspci -k | grep -iEA5 'vga|display|3d'
@dzaczek
dzaczek / sudoku.py
Created March 30, 2020 20:26
sudoku
#!/usr/bin/python3.7
import numpy as np
import os
import time
#grid=[ [0,0,0,2,6,0,7,0,1],[6,8,0,0,7,0,0,9,0],[1,9,0,0,0,4,5,0,0],[8,2,0,1,0,0,0,4,0],[0,0,4,6,0,2,9,0,0],[0,5,0,0,0,3,0,2,8],[0,0,9,3,0,0,0,7,4],[0,4,0,0,5,0,0,3,6],[7,0,3,0,1,8,0,0,0] ]
#grid=np.zeros((9, 9))
#World's hardest sudoku
grid=[[8,0,0,0,0,0,0,0,0],[0,3,6,0,0,0,0,0,0],[0,7,0,0,9,0,2,0,0],[0,5,0,0,0,7,0,0,0],[0,0,0,0,4,5,7,0,0],[0,0,0,1,0,0,0,3,0],[0,0,1,0,0,0,0,6,8],[0,0,8,5,0,0,0,1,0],[0,9,0,0,0,0,4,0,0]]
print(np.matrix(grid))
hass --script auth -c /config change_password <user> <password>
@dzaczek
dzaczek / example5
Last active September 25, 2019 14:24
#!/bin/bash
#ulstrafast lan scanner
#https://consolechars.wordpress.com/2017/03/27/devtcp-forgotten-linux-delicacy/
iph="192.168.8."
scan (){
timeout 3 bash -c "echo >/dev/tcp/$iph$2/$1" 2>/dev/null && echo "$iph$2 $1"
}
echo "PORT HOST"
for ihost in {1..254}; do
for port in {22,80,8080,3389,443,53,67,68}; do