Skip to content

Instantly share code, notes, and snippets.

View mingyang91's full-sized avatar
🎯
Go for broke

Ming Yang mingyang91

🎯
Go for broke
View GitHub Profile

Safeguarding Your Mnemonic Phrase: A Comprehensive Guide

Your mnemonic phrase is the master key to your cryptocurrency wallets and digital assets. Securing it against unauthorized access is paramount. This guide will walk you through encrypting your mnemonic using RSA encryption with OpenSSL, ensuring it remains confidential and secure.

Table of Contents

  1. Introduction
  2. Prerequisites
  3. Step-by-Step Instructions
  • Step 1: Generate an RSA Private Key with a Passphrase
@mingyang91
mingyang91 / os.obj
Created October 29, 2024 07:39
decompile assembly kernel
target/riscv64gc-unknown-none-elf/release/os: file format elf64-littleriscv
Disassembly of section .text.entry:
ffffffff80200000 <_start>:
ffffffff80200000: 1141 add sp,sp,-16
ffffffff80200002: 80201137 lui sp,0x80201
ffffffff80200006: 1102 sll sp,sp,0x20
use std::time::Duration;
use axum::{response::IntoResponse, routing::get, Router};
use tokio::time::sleep;
#[tokio::test]
async fn http() {
let app = Router::new().route("/", get(method_router));
let listener = tokio::net::TcpListener::bind("0.0.0.0:3000").await.unwrap();
use std::borrow::Borrow;
use std::collections::{HashMap, HashSet};
use std::hash::Hash;
use std::num::NonZeroUsize;
use std::str::FromStr;
use std::sync::{Arc, Weak};
use bitcoin::util::key;
use lru::{LruCache};
use rgb_lib::bdk::keys::bip39::{Language, Mnemonic};
use rgb_lib::bdk::keys::{DerivableKey, ExtendedKey};
@mingyang91
mingyang91 / bullet.rs
Last active February 28, 2024 14:44
Object Pool for Godot
impl ReuseObject for Bullet {
fn init(&mut self) {
}
fn prepare(&mut self) {
if self.state != State::Init {
self.state = State::Init;
self.base_mut().set_process(true);
@mingyang91
mingyang91 / compare_concurrency_control.kt
Last active December 22, 2023 08:01
Compare concurrency control in Coroutine VS Reactive VS VirtualThread(a.k.a Loom)
package org.example
import kotlinx.coroutines.*
import kotlinx.coroutines.channels.Channel
import kotlinx.coroutines.flow.*
import kotlinx.coroutines.sync.Semaphore
import kotlinx.coroutines.sync.withPermit
import org.openjdk.jmh.annotations.*
import java.util.concurrent.TimeUnit
@mingyang91
mingyang91 / chat.md
Created September 13, 2023 09:21
Chat with GPT(New Bing)

Me:

this is my dockerfile, could you please tell me why the OS cannot find libpython so?

# Build stage
FROM rust:bookworm as builder

# Install python3.11 and build dependencies
RUN apt-get update
RUN apt-get install -y software-properties-common
#RUN add-apt-repository ppa:deadsnakes/ppa
package lsbf.fm;
import java.util.Optional;
public class Tree {
public static void main(String[] args) {
Node<Integer> root = new Node<>(5);
root = new Node<>(5, Optional.of(new Node<>(1)), Optional.of(new Node<>(10)));
System.out.println(root.getLeft().get().getValue());
System.out.println(root.getRight().get().getValue());
@mingyang91
mingyang91 / ICRP phatom voxel to fluka.ipynb
Last active January 23, 2023 13:30
P110 & P143, translate from fortran version
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mingyang91
mingyang91 / immutable-avl.rs
Last active September 21, 2023 10:09
Immutable AVL tree
#![feature(let_else)]
use std::cmp::Ordering;
use std::fmt::{Display, Formatter};
use std::sync::Arc;
pub enum Root<K, V> {
Empty,
More(Arc<Node<K, V>>)
}