Skip to content

Instantly share code, notes, and snippets.

View vegard's full-sized avatar

Vegard Nossum vegard

View GitHub Profile
@vegard
vegard / kernel-dev.md
Last active December 10, 2024 05:01
Getting started with Linux kernel development

Getting started with Linux kernel development

Prerequisites

The Linux kernel is written in C, so you should have at least a basic understanding of C before diving into kernel work. You don't need expert level C knowledge, since you can always pick some things up underway, but it certainly helps to know the language and to have written some userspace C programs already.

It will also help to be a Linux user. If you have never used Linux before, it's probably a good idea to download a distro and get comfortable with it before you start doing kernel work.

Lastly, knowing git is not actually required, but can really help you (since you can dig through changelogs and search for information you'll need). At a minimum you should probably be able to clone the git repository to a local directory.

@vegard
vegard / gist:96918be888ef0a583ebd45fbd5cf5e97
Created August 30, 2020 12:21
You must not sleep - Arnulf Øverland, 1937
You must not sleep
Arnulf Øverland, 1937
I woke up one night from a strange dream,
it was like a voice spoke to me,
far away like an underground current -
and I sat up: What do you want with me?
- You must not sleep! You must not sleep!
@vegard
vegard / quantize-tikz.cc
Created April 15, 2020 11:34
Float to byte quantisation
#if 0
(g++-9 $0 || g++ $0) && \
./a.out > output.tex && \
pdflatex output && \
exec convert -density 400 -flatten output.pdf -resize 25% output.png
exit 1
#endif
#include <cmath>
#include <cstdio>
@vegard
vegard / keybase.md
Created April 5, 2020 21:42
keybase.md

Keybase proof

I hereby claim:

  • I am vegard on github.
  • I am vegardno (https://keybase.io/vegardno) on keybase.
  • I have a public key ASCfq_8xuGsivSrcwpwREFTqsH8l7RewZmmRChxDW5bfVAo

To claim this, I am signing this object:

@vegard
vegard / primes.py
Created September 21, 2018 07:51
Prime factorisation diagram
# -*- coding: utf-8 -*-
#
# Author: Vegard Nossum <vegard.nossum@gmail.com>
import math
import os
import sys
import cairo
@vegard
vegard / ifdef-helper.py
Last active January 27, 2017 14:30 — forked from anonymous/ifdef-helper.py
Visualise ifdef nesting for particularly nasty preprocessor spaghetti
#! /usr/bin/python
# -*- coding: utf-8 -*-
#
# Author: Vegard Nossum <vegard.nossum@oracle.com>
#
import os
import sys
import re
@vegard
vegard / art.py
Last active December 1, 2016 22:39
import math
import os
import sys
import PIL
import PIL.Image
import cairo
WIDTH, HEIGHT = 512, 512
@vegard
vegard / xml2yaml
Created November 14, 2013 21:18
Script for converting udis86 optable.xml to YAML
import sys
from lxml import etree
parser = etree.XMLParser(remove_comments=False)
tree = etree.parse('docs/x86/optable.xml', parser=parser)
root = tree.getroot()
for e in root:
if e.tag == 'instruction':
This file has been truncated, but you can view the full file.
p cnf 3168 90125
c
c Instance generated by sha1-sat
c Written by Vegard Nossum <vegard.nossum@gmail.com>
c <https://github.com/vegard/sha1-sat>
c
c command line: ./main --seed 22662 --attack preimage --rounds 16 --hash-bits 1 --cnf
c parameter seed = 22662
c sha1
c parameter nr_rounds = 16