Skip to content

Instantly share code, notes, and snippets.

View Programator2's full-sized avatar
😃
Happy

Roderik Ploszek Programator2

😃
Happy
  • Slovak University of Technology in Bratislava
  • Slovakia
View GitHub Profile
@Programator2
Programator2 / debugging_linux_kernel.md
Last active March 7, 2024 08:44
This gist is a tutorial on how to debug Linux kernel inside VirtualBox on Windows host system using another Linux virtual machine

How to debug Linux kernel on Windows

This tutorial shows how to debug Linux kernel on a Windows operating system using another virtual machine with a Linux on it. Virtual machines will be connected by a serial port provided by VirtualBox using a named pipe on a Windows host system.

Prerequisites

  • Physical computer with Windows operating system. This tutorial uses Windows 10, but any recent version of Windows (8, 8.1) should suffice. We will refer to this computer as the host system.
@Programator2
Programator2 / join_files.py
Last active December 8, 2018 09:11
This script is useful if you have files that were somehow splitted (DVR recorders do this) and you want to join them back into one file. Simply fill out string OUTPUT_FILENAME and tuple of INPUT_FILES with files you want to join and run the script.
OUTPUT_FILENAME = ''
INPUT_FILES = (
'',
)
with open(OUTPUT_FILENAME, 'bw') as output:
print(f'Opened {OUTPUT_FILENAME} for writing')
for path in INPUT_FILES:
with open(path, 'br') as f:
@Programator2
Programator2 / windows_boot_recovery.md
Last active November 6, 2023 08:59
This gist shows how to recover Windows 10 boot problems after cloning a harddrive (error code 0xc000000e)

Prerequisites

This guide applies to UEFI systems with GPT drives. It was tested on Windows 10 April 2018 edition, but it should also work on Windows 8 and newer releases (maybe even 7).

The problem

Occurs after an original drive from which the system drive was cloned is connected to the system at boot.

Error code 0xc000000e with message The boot selection failed because a required device is inaccessible.

@Programator2
Programator2 / init.el
Last active March 21, 2023 10:59
Programator2's Emacs config
;;; init.el --- Personal EMACS config by Programator2 -*- lexical-binding: t; -*-
;; Copyright (C) 2018-2023 Roderik Ploszek
;; Author: Roderik Ploszek <roderik.ploszek@gmail.com>
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
#!/usr/bin/python3
from subprocess import run, PIPE, Popen, CalledProcessError
from sys import exit
from os import chdir
def main():
# TODO CHANGE PATH TO MEDUSA
chdir('/home/user/medusa')
try:
@Programator2
Programator2 / class.c
Last active July 14, 2020 22:20
Refactoring of class.c
/* vrati offset (u_int16_t), alebo -1 ak chyba */
/*
cinfo v constablovi uchovava pointer
cinfo_size uchovava pocet u_int32_t-bitovych slov od cinfo_offset
*/
int _class_alloc_cinfo(u_int16_t cinfo_size, uintptr_t *cinfo_mask, u_int16_t cinfo_offset)
{
int i;
for(i=0; i < cinfo_size && i < sizeof(cinfo_mask) * 8; i++) {
@Programator2
Programator2 / google-meet-attendance.js
Created September 30, 2020 10:40
Script for getting a list of people attenting Google Meet virtual conference
// Very dirty script. But much better for me than some non-working addons.
// After pasting it into a file I run it through > sort | uniq > attendance.txt
function isElementAtBottom(element) {
return Math.abs(element.scrollHeight - element.scrollTop - element.clientHeight) < 10;
}
people = "";
pane = document.getElementsByClassName("HALYaf tmIkuc s2gQvd KKjvXb")[0];
if (pane.length == 0) {