Skip to content

Instantly share code, notes, and snippets.

@vegard
vegard / kernel-dev.md
Last active Jun 16, 2021
Getting started with Linux kernel development
View kernel-dev.md

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 Aug 30, 2020
You must not sleep - Arnulf Øverland, 1937
View gist:96918be888ef0a583ebd45fbd5cf5e97
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 Apr 15, 2020
Float to byte quantisation
View quantize-tikz.cc
#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>
View 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 Sep 21, 2018
Prime factorisation diagram
View primes.py
# -*- 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 Jan 27, 2017 — forked from anonymous/ifdef-helper.py
Visualise ifdef nesting for particularly nasty preprocessor spaghetti
View ifdef-helper.py
#! /usr/bin/python
# -*- coding: utf-8 -*-
#
# Author: Vegard Nossum <vegard.nossum@oracle.com>
#
import os
import sys
import re
View art.py
import math
import os
import sys
import PIL
import PIL.Image
import cairo
WIDTH, HEIGHT = 512, 512
@vegard
vegard / xml2yaml
Created Nov 14, 2013
Script for converting udis86 optable.xml to YAML
View xml2yaml
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':
View instance.cnf
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