Skip to content

Instantly share code, notes, and snippets.

View libbkmz's full-sized avatar

Ilya libbkmz

View GitHub Profile
@libbkmz
libbkmz / fsm.example.rs
Created October 29, 2024 09:39
Rust pattern matching with enum equals nice FSM
match (self.state, level, diff_len) {
(INIT, HIGH, ZERO) => {
if DBG_PRINT {println!(" First LEFT part of '1' outbit");}
self.state = HIGH_LEVEL(ZERO, LEFT); // maybe should be ZERO from diff_len?
}
(INIT, HIGH, SINGLE) => {
if DBG_PRINT {println!(" Second RIGHT part of '0' outbit");}
self.add_bit_to_response(0);
self.state = HIGH_LEVEL(SINGLE, RIGHT);
}
@libbkmz
libbkmz / gist:ebb2a443d5fedf25b3cfa63bcf7c774b
Created July 19, 2024 11:41
kernel panic on pinebook a64 on version: Linux version 6.3.0-rc6+
[ 3.028798] thermal_sys: Failed to find 'trips' node
[ 3.033806] thermal_sys: Failed to find trip points for thermal-sensor id=1
[ 3.040793] sun8i-thermal: probe of 1c25000.thermal-sensor failed with error -22
[ 3.059963] sunxi-rsb 1f03400.rsb: RSB running at 3000000 Hz
[ 3.066109] axp20x-rsb sunxi-rsb-3a3: AXP20x variant AXP803 found
[ 3.072902] Unable to handle kernel paging request at virtual address e8cb07af2deeb2ab
[ 3.080832] Mem abort info:
[ 3.083622] ESR = 0x0000000096000004
[ 3.087383] EC = 0x25: DABT (current EL), IL = 32 bits
[ 3.092698] SET = 0, FnV = 0
@libbkmz
libbkmz / debian.sbookworm.6.1.0.success.boot.log
Created July 11, 2024 10:33
kernel boot log for original pinebook-a64 with https://sd-card-images.johang.se/ images of debian
[ 0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd034]
[ 0.000000] Linux version 6.1.0-22-arm64 ([email protected]) (gcc-12 (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40) #1 SMP Debian 6.1.94-1 (2024-06-21)
[ 0.000000] Machine model: Pinebook
[ 0.000000] efi: UEFI not found.
[ 0.000000] NUMA: No NUMA configuration found
[ 0.000000] NUMA: Faking a node at [mem 0x0000000040000000-0x00000000bdffffff]
[ 0.000000] NUMA: NODE_DATA [mem 0xbdbde380-0xbdbe0fff]
[ 0.000000] Zone ranges:
[ 0.000000] DMA [mem 0x0000000040000000-0x00000000bdffffff]
[ 0.000000] DMA32 empty
U-Boot SPL 2024.01-armbian (May 20 2024 - 00:42:08 +0000)
DRAM: 2048 MiB
Trying to boot from MMC1
NOTICE: BL31: v2.9(debug):armbian
NOTICE: BL31: Built : 00:41:53, May 20 2024
NOTICE: BL31: Detected Allwinner A64/H64/R18 SoC (1689)
NOTICE: BL31: Found U-Boot DTB at 0x20a7830, model: Pinebook
INFO: ARM GICv2 driver initialized
INFO: Configuring SPC Controller
INFO: PMIC: Probing AXP803 on RSB
@libbkmz
libbkmz / gist:42b922133ae9649bd3cbc4e07f64492f
Created January 3, 2024 16:57
DRAM dmidecode AX-370 Gaming K7. F51m
Handle 0x0012, DMI type 17, 92 bytes
Memory Device
Array Handle: 0x000B
Error Information Handle: 0x0011
Total Width: 64 bits
Data Width: 64 bits
Size: 32 GB
Form Factor: DIMM
Set: None
Locator: DIMM 0
@libbkmz
libbkmz / main.rs
Created November 28, 2023 00:34
Simulating worst case for linux kernel RSS memory optimisation update.
#!/usr/bin/env rust-script
//! ```cargo
//! [dependencies]
//! clap = { version = "4.4.9", features = ["std", "derive", "help"] }
//! memmap = "0.7.0"
//! procfs = { version = "0.16.0", default-features = false }
//! thousands = "0.2.0"
//! ```
///
/// This app can be executed with `rust-script` tool like this:
Compiling rustix v0.37.3
Compiling esp-idf-hal v0.40.1
Compiling esp-idf-sys v0.32.1
Compiling esp-idf-svc v0.45.0
Compiling rust-esp32-std-demo v0.29.0 (/home/user/dev/rust_esp/demo2)
error[E0432]: unresolved import `super::super::offset::libc_posix_fadvise`
--> /home/user/.cargo/registry/src/github.com-1ecc6299db9ec823/rustix-0.37.3/src/backend/libc/fs/syscalls.rs:19:5
|
19 | use super::super::offset::libc_posix_fadvise;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `libc_posix_fadvise` in `backend::offset`
@libbkmz
libbkmz / Cargo.toml
Created February 9, 2022 13:23
Simple rust wordle solver
[package]
name = "wobli"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
@libbkmz
libbkmz / CMakeLists.txt
Created January 28, 2022 13:20
CMake Error: Cannot determine link language for target "test_1_lib_js".
cmake_minimum_required (VERSION 3.8)
set(CMAKE_VERBOSE_MAKEFILE on)
project(plugin CXX)
add_executable(test test.cc)
em_link_js_library(test "lib.js")
2021-12-28 10:23:49
Full thread dump Java HotSpot(TM) 64-Bit Server VM (25.51-b03 mixed mode):
"pool-25-thread-2" #269 prio=5 os_prio=0 tid=0x0000000039a54000 nid=0x30d0 waiting on condition [0x000000009f33d000]
java.lang.Thread.State: WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x000000063c6010a0> (a java.util.concurrent.CompletableFuture$Signaller)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
at java.util.concurrent.CompletableFuture$Signaller.block(CompletableFuture.java:1685)
at java.util.concurrent.ForkJoinPool.managedBlock(ForkJoinPool.java:3320)