Skip to content

Instantly share code, notes, and snippets.

@felipeek
felipeek / linux-debug.md
Created August 9, 2020 00:03
How to debug the Linux Kernel using VirtualBox

Assumptions: Host machine is linux.

  1. Download virtualbox
  2. Install a linux flavour. Preference for Debian since distro-dependent commands in the following steps will be debian-dependent
  3. Run your VM.
  4. Inside VM, download last kernel code from kernel.org
  5. Extract linux src code
  6. Copy your configuration file from /boot/config-$(uname -r) to .config in the extract linux src code folder.
  7. Make sure .config has the following options: CONFIG_FRAME_POINTER=y , CONFIG_KGDB=y , CONFIG_KGDB_SERIAL_CONSOLE=y , CONFIG_KGDB_KDB=y , CONFIG_KDB_KEYBOARD=y. Change if necessary. Alternatively use make xconfig to configure in UI.
  8. Install compilation dependencies (debian: sudo apt-get install build-essential libncurses-dev bison flex libssl-dev libelf-dev)
@scanny
scanny / rst_renderer.py
Created March 2, 2015 20:36
Code to translate RestructuredText into Microsoft Word document using python-docx
# encoding: utf-8
"""
Helper objects for rendering to .docx format.
"""
from __future__ import (
absolute_import, division, print_function, unicode_literals
)