Skip to content

Instantly share code, notes, and snippets.

View peterdk's full-sized avatar

Peter de Kraker peterdk

View GitHub Profile
@peterdk
peterdk / orange pi rv2 ubuntu 25.04 clean install instructions.md
Last active July 31, 2025 09:24
Install clean Ubuntu Server 25.04 from official Ubuntu sources on the OrangePi RV2

Install clean Ubuntu Server 25.04 from official Ubuntu sources on the OrangePi RV2

Introduction

I got a Orange Pi RV2 recently, and it only was supplied with a pre-build Ubuntu Server image from a Chinese website. I did not like that too much. It also used Chinese mirrors, and I prefer to have full control over my install. This guide shows you how to build / install Ubuntu Server 25.04 from the official RISCV Ubuntu install media and the provided kernel sources for the RV2.

Approach

  • Build kernel .deb files (using a Ubuntu 22.04 x86 VM)
  • Install Ubuntu 25.04 RISCV using a RISCV VM and a NVME drive that we will use with the RV2.
  • Install kernel deb files, manage the DTB properly, configure some needed stuff
@peterdk
peterdk / 3 - find the min.rb
Last active December 11, 2015 21:48
My O(K) solution for hackercup 2013, qualification round, problem 3: find the min. Ran in 0.3 seconds on my core 2 duo macbook, using Ruby 1.9.3 =update= Unfortunately the code is not fully correct. It failed on 1/20 cases.
require 'set'
def find_min_better3(a,b,c,r,k,n)
m = []
m << a
(k - 1).times do |k|
m << ((b * m[k] + c) % r)
end