From 0d281aac672b19f931f4ae03baf5434047217e1c Mon Sep 17 00:00:00 2001 From: seantywork Date: Wed, 17 Dec 2025 09:24:03 +0000 Subject: [PATCH] rust kern? --- 0xetc/0xrs/ksample/Makefile | 13 +++++++++ 0xetc/0xrs/ksample/rust_out_of_tree.rs | 37 ++++++++++++++++++++++++++ README.md | 22 +++++++++++++++ 3 files changed, 72 insertions(+) create mode 100644 0xetc/0xrs/ksample/Makefile create mode 100644 0xetc/0xrs/ksample/rust_out_of_tree.rs diff --git a/0xetc/0xrs/ksample/Makefile b/0xetc/0xrs/ksample/Makefile new file mode 100644 index 0000000..b46f6bc --- /dev/null +++ b/0xetc/0xrs/ksample/Makefile @@ -0,0 +1,13 @@ +# SPDX-License-Identifier: GPL-2.0 + +obj-m := rust_out_of_tree.o +KDIR ?= /lib/modules/`uname -r`/build + +default: + $(MAKE) -C $(KDIR) M=$$PWD + +modules_install: default + $(MAKE) -C $(KDIR) M=$$PWD modules_install + +clean: + $(MAKE) -C $(KDIR) M=$$PWD clean \ No newline at end of file diff --git a/0xetc/0xrs/ksample/rust_out_of_tree.rs b/0xetc/0xrs/ksample/rust_out_of_tree.rs new file mode 100644 index 0000000..3443cd8 --- /dev/null +++ b/0xetc/0xrs/ksample/rust_out_of_tree.rs @@ -0,0 +1,37 @@ +// SPDX-License-Identifier: GPL-2.0 + +//! Rust out-of-tree sample + +use kernel::prelude::*; + +module! { + type: RustOutOfTree, + name: "rust_out_of_tree", + authors: ["Rust for Linux Contributors"], + description: "Rust out-of-tree sample", + license: "GPL", +} + +struct RustOutOfTree { + numbers: KVec, +} + +impl kernel::Module for RustOutOfTree { + fn init(_module: &'static ThisModule) -> Result { + pr_info!("Rust out-of-tree sample (init)\n"); + + let mut numbers = KVec::new(); + numbers.push(72, GFP_KERNEL)?; + numbers.push(108, GFP_KERNEL)?; + numbers.push(200, GFP_KERNEL)?; + + Ok(RustOutOfTree { numbers }) + } +} + +impl Drop for RustOutOfTree { + fn drop(&mut self) { + pr_info!("My numbers are {:?}\n", self.numbers); + pr_info!("Rust out-of-tree sample (exit)\n"); + } +} \ No newline at end of file diff --git a/README.md b/README.md index c2ed8da..3afbe31 100644 --- a/README.md +++ b/README.md @@ -998,6 +998,10 @@ git commit git push -f +# git push create set to public + +git push -o repo.private=false -u origin main + # then PR # squash commits @@ -1373,6 +1377,21 @@ sudo systemctl restart nginx +``` +# CERTBOT + +```shell +# install +sudo apt update +sudo apt install python3 python3-dev python3-venv libaugeas-dev gcc +sudo python3 -m venv /opt/certbot/ +sudo /opt/certbot/bin/pip install --upgrade pip +sudo /opt/certbot/bin/pip install certbot +sudo ln -s /opt/certbot/bin/certbot /usr/bin/certbot + +# chal +sudo certbot certonly --standalone --preferred-challenges http -d hack.feebdaed.xyz -d hack.feebdaed.xyz + ``` @@ -13470,6 +13489,9 @@ export PATH="$PATH:$HOME/.cargo/bin" source .profile +# update +rustup update stable + ``` # SCRCPY ANDROID SCREEN MIRRORING -- 2.43.0