Skip to content

Instantly share code, notes, and snippets.

View paranlee's full-sized avatar
🐧
Run RISC-V run!

Paran Lee paranlee

🐧
Run RISC-V run!
View GitHub Profile
@a4lg
a4lg / openocd-unmatched-u7.cfg
Last active April 17, 2023 08:27
HiFive Unmatched + OpenOCD configuration (four U74 cores only; no flash configured)
adapter speed 10000
adapter driver ftdi
ftdi_device_desc "Dual RS232-HS"
ftdi_vid_pid 0x0403 0x6010
ftdi_layout_init 0x0008 0x001b
ftdi_layout_signal nSRST -oe 0x0020 -data 0x0020
set _CHIPNAME riscv
transport select jtag
@jgru
jgru / dump_pmem.sh
Last active August 3, 2022 12:45
Script to dump the process memory of a given process on a Linux system to a file
#!/bin/sh
#
# Version dump_proc_mem 0.0.1
# Author Jan Gru
# Copyright Copyright (c) Jan Gru
# License GNU General Public License
# Checks, if root permissions
if [ $(id -u) -ne 0 ]
then echo "Error: needing root permissions!" >&2
@chrizchow
chrizchow / Makefile
Last active December 23, 2023 13:24
Linux Minimal ioctl Network Device Example
KDIR := /home/chriz/repositories/WSL2-Linux-Kernel/
obj-m += chriz_ioctl_kernel.o
all:
$(MAKE) -C $(KDIR) M=$(PWD) modules
gcc -o chriz_ioctl_user chriz_ioctl_user.c
clean:
rm -rf *.o *.ko *.mod.* *.cmd .module* modules* Module* .*.cmd .tmp*
@pdp7
pdp7 / BeagleV Fedora boot log.txt
Last active November 19, 2023 13:22
BeagleV Fedora boot log
\00\00bootloader version:210209-4547a8d
ddr 0x00000000, 1M test
ddr 0x00100000, 2M test
DDR clk 2800M,Version: 210206-12505b0
2 1 0
bootloader.
OpenSBI v0.8
____ _____ ____ _____

ELF Format Cheatsheet

Introduction

Executable and Linkable Format (ELF), is the default binary format on Linux-based systems.

ELF

Compilation

@x0nu11byt3
x0nu11byt3 / elf_format_cheatsheet.md
Created February 27, 2021 05:26
ELF Format Cheatsheet

ELF Format Cheatsheet

Introduction

Executable and Linkable Format (ELF), is the default binary format on Linux-based systems.

ELF

Compilation

// Test case for OP_SPLICE short read issue. Most systems may require the open
// file limit to be raised (4096, which is probably still within the hard limit,
// should be enough).
//
// This tries to read from a file called '20k', which I generated with the
// following:
// `dd if=/dev/random of=20k bs=1k count=20`
#define _GNU_SOURCE
#include <errno.h>
@MaskRay
MaskRay / mallocng.md
Last active September 30, 2025 05:40
musl mallocng

Introduced in musl v1.2.1. Design goal: "Strong hardening against memory usage errors by the caller, including detection of overflows, double-free, and use-after-free, and does not admit corruption of allocator state via these errors."

context

// Singleton: ctx
struct malloc_context {
  uint64_t secret;
#ifndef PAGESIZE
  size_t pagesize;
@niw
niw / README.en.md
Last active August 28, 2025 18:24
How to run Windows 10 on ARM or Ubuntu for ARM64 in QEMU on Apple Silicon Mac

How to run Windows 10 on ARM or Ubuntu for ARM64 in QEMU on Apple Silicon Mac

Here is easy steps to try Windows 10 on ARM or Ubuntu for ARM64 on your Apple Silicon Mac. Enjoy!

NOTE: that this is current, 10/1/2021 state.

Running Windows 10 on ARM

  1. Install Xcode from App Store or install Command Line Tools on your Mac
@NULLx76
NULLx76 / openssl.sh
Created September 15, 2020 22:37
OpenSSL generate ed25519 and RSA
# Generate ed25519 privkey
openssl genpkey -algorithm ed25519 -out privkey.pem
# export its pubkey
openssl pkey -in privkey.pem -pubout -out pubkey.pem
# Generate RSA privkey
openssl genrsa -des3 -out private.pem 2048
# export its pubkey
openssl rsa -in private.pem -outform PEM -pubout -out public.pem