Skip to content

Instantly share code, notes, and snippets.

View pdp7's full-sized avatar
💭
Linux on RISC-V

Drew Fustini pdp7

💭
Linux on RISC-V
View GitHub Profile
@vegard
vegard / kernel-dev.md
Last active May 3, 2024 04:55
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.

@kyledrake
kyledrake / ferengi-plan.txt
Last active April 6, 2024 00:30
How to throttle the FCC to dial up modem speeds on your website using Nginx
# The blog post that started it all: https://neocities.org/blog/the-fcc-is-now-rate-limited
#
# Current known FCC address ranges:
# https://news.ycombinator.com/item?id=7716915
#
# Confirm/locate FCC IP ranges with this: http://whois.arin.net/rest/net/NET-165-135-0-0-1/pft
#
# In your nginx.conf:
location / {
@walkermatt
walkermatt / debounce.py
Created June 4, 2012 21:44
A debounce function decorator in Python similar to the one in underscore.js, tested with 2.7
from threading import Timer
def debounce(wait):
""" Decorator that will postpone a functions
execution until after wait seconds
have elapsed since the last time it was invoked. """
def decorator(fn):
def debounced(*args, **kwargs):
def call_it():
@davidzchen
davidzchen / sample-linux.c
Last active January 19, 2024 21:20
Sample C code using the Linux kernel coding style
/*
* Sample file using the Linux kernel coding convention.
*
* https://www.kernel.org/doc/Documentation/CodingStyle
*
* General rules:
* - Indents are tabs and must be 8 spaces wide.
* - Each line must be at most 80 characters long.
* - Use C-style comments.
* - File names should be lower-case.c
anonymous
anonymous / sources.list
Created November 11, 2015 14:50
BeagleBone Black: Tor exit node config
# path of this file: /etc/apt/sources.list
deb http://ftp.us.debian.org/debian/ jessie main contrib non-free
#deb-src http://ftp.us.debian.org/debian/ jessie main contrib non-free
deb http://ftp.us.debian.org/debian/ jessie-updates main contrib non-free
#deb-src http://ftp.us.debian.org/debian/ jessie-updates main contrib non-free
deb http://security.debian.org/ jessie/updates main contrib non-free
#deb-src http://security.debian.org/ jessie/updates main contrib non-free
@nickoe
nickoe / build_tips_for_kicad.txt
Last active December 16, 2021 14:25
Build tips for kicad
CC="distcc gcc" CXX="distcc g++" cmake .. -DKICAD_USE_OCC=ON -DwxWidgets_CONFIG_EXECUTABLE=$(which wx-config-gtk3) -DCMAKE_INSTALL_PREFIX=/tmp/kicad/usr/local
-DwxWidgets_CONFIG_EXECUTABLE=$(which wx-config-gtk3) -DCMAKE_INSTALL_PREFIX=/tmp/kicad/usr/local
Using ninja with multi config, see https://cmake.org/cmake/help/v3.17/generator/Ninja%20Multi-Config.html
CC="distcc gcc" CXX="distcc g++" cmake .. -DKICAD_USE_OCC=ON -DwxWidgets_CONFIG_EXECUTABLE=$(which wx-config-gtk3) -DCMAKE_INSTALL_PREFIX=/tmp/kicad/usr/local -DCMAKE_DEFAULT_BUILD_TYPE=Release -G"Ninja Multi-Config
-DCMAKE_EXE_LINKER_FLAGS=-fuse-ld=gold
Use this one:
[238]HELLO! BOOT0 is starting!
[241]BOOT0 commit : 27369ab
[243]set pll start
[245]periph0 has been enabled
[248]set pll end
[250][pmu]: bus read error
[252]board init ok
[254]DRAM only have internal ZQ!!
[257]get_pmu_exist() = -1
[260]ddr_efuse_type: 0x0
@mwelling
mwelling / README.txt
Created August 29, 2018 03:23
Epaper driver usage for OHSummit badge
The above code assumes that you have the driver code for the display and font built-in.
See pull request:
https://github.com/acamilo/micropython/pull/1
It also assumes that you have loaded the happy180.bmp onto the filesystem of the module.
The bitmap was taken from here:
https://github.com/ayoy/micropython-waveshare-epd/blob/master/epd/gfx/happy180.bmp
Index Register BeagleBone Blue rev A2 PocketBeagle 0 (Name) 1 2 3 4 5 6 7 ZCZ/BSP BSM
1 800 P8.25 / eMMC d0 -eMMC_DAT0 gpmc d0 mmc 1 d0 - - - - - gpio 1.00 U7 R3
2 804 P8.24 / eMMC d1 -eMMC_DAT1 gpmc d1 mmc 1 d1 - - - - - gpio 1.01 V7 R2
3 808 P8.05 / eMMC d2 -eMMC_DAT2 gpmc d2 mmc 1 d2 - - - - - gpio 1.02 R8 R1
4 80C P8.06 / eMMC d3 -eMMC_DAT3 gpmc d3 mmc 1 d3 - - - - - gpio 1.03 T8 T3
5 810 P8.23 / eMMC d4 -eMMC_DAT4 gpmc d4 mmc 1 d4 - - - - - gpio 1.04 U8 T2
6 814 P8.22 / eMMC d5 -eMMC_DAT5 gpmc d5 mmc 1 d5 - - - - - gpio 1.05 V8 T1
7 818 P8.03 / eMMC d6 -eMMC_DAT6 gpmc d6 mmc 1 d6 - - - - - gpio 1.06 R9 P4
8 81C P8.04 / eMMC d7 -eMMC_DAT7 gpmc d7 mmc 1 d7 - - - - - gpio 1.07 T9 R4
9 820 P8.19 MPWM_3 gpmc d8 lcd d23 mmc 1 d0 mmc 2 d4 pwm 2 out A pru mii 0 txclk - gpio 0.22 U10 T4