Skip to content

Instantly share code, notes, and snippets.

View diyism's full-sized avatar

Malcolm Ke Win diyism

View GitHub Profile
@diyism
diyism / waydroid on debian x64 and armbian focal pine64.txt
Last active December 18, 2023 07:49
waydroid on debian x64 and armbian focal pine64
============================x64 debian=====================================
# upgrade kali linux kernel from 5.7 to 5.9+(download from: http://old.kali.org/kali/pool/main/l/linux/)
# sudo apt install linux-image-6.3.0-kali1-amd64
# in live iso: sudo /usr/sbin/update-initramfs.orig.initramfs-tools -c -k 6.3.0-kali1-amd64
$ sudo dpkg -i linux-image-5.9.0-kali1-amd64_5.9.1-1kali2_amd64
# install header file(download from: https://http.kali.org/kali/pool/main/l/linux/):
$ sudo dpkg -i linux-kbuild-5.9_5.9.1-1kali2_amd64.deb linux-headers-5.9.0-kali1-common_5.9.1-1kali2_all.deb linux-headers-5.9.0-kali1-amd64_5.9.1-1kali2_amd64.deb
$ git clone https://github.com/diyism/anbox-modules.git
$ cd anbox-modules
$ sudo ./INSTALL.sh
@diyism
diyism / compile termux-bootstraps.zip
Last active December 14, 2023 20:20
compile termux-bootstraps.zip
#########################################################################################
在Termux+pRoot(AnLinux, Andronix)里跑不起来dockerd进程, 也跑不了任何x64程序/命令,
用alpine-term应用(https://github.com/diyism/alpine-term 578MB,
https://github.com/sylirre/vmConsole 1.01GB)才行,
可以在它的docker里跑x86-64的docker image,用随身的arm64 android手机/平板就可以运行任何x64 docker app了
安装好后在alpine-term应用里执行sudo apk add -u go 会报错 untrsuted signature, 需要先:
sudo apk add -X https://dl-cdn.alpinelinux.org/alpine/v3.18/main -u alpine-keys --allow-untrusted
#########################################################################################
@diyism
diyism / Use your android phone as a karaoke microphone in Linux.md
Last active December 11, 2023 16:46
Use your android phone as a karaoke microphone in Linux

micclient+WoMic is close source, while Mumble is open source, so on armbian tv, I can only use Mumble+Murmurd+Plumble.

===================="mumble+murmurd"(on arm64 armbian linux tv)+plumble(on android/ios)==================== refer: https://github.com/diyism/mic_over_mumble

sudo apt install mumble mumble-server

sudo systemctl stop mumble-server.service

@diyism
diyism / singularity.txt
Last active December 11, 2023 02:33
singularity is far more easier to use than docker
#singularity is far more convenient than docker, so replace docker with singularity
#用包安装: https://sylabs.io/guides/3.3/user-guide/installation.html#install-the-debian-ubuntu-package-using-apt
#但是安装的是singularity 2.6.1, 似乎是基于python的, 没有基于go的singularity 3.8.3好用
#for kali or debian testing (http://neuro.debian.net/)
wget -O- http://neuro.debian.net/lists/bullseye.us-ca.libre | sudo tee /etc/apt/sources.list.d/neurodebian.sources.list
sudo apt-key adv --recv-keys --keyserver hkp://pool.sks-keyservers.net:80 0xA5D32F012649A5A9
sudo apt update
sudo apt install singularity-container
sudo ln -s /usr/bin/singularity /usr/bin/sing
@diyism
diyism / directly call libcronet.so from cronet-go.txt
Created December 8, 2023 03:04
directly call libcronet.so from cronet-go
ref: https://github.com/sleeyax/cronet-binaries/issues/1
package main
import (
"net/http"
"os"
"github.com/sagernet/cronet-go"
)
@diyism
diyism / run docker in huggingface with jupyter
Last active December 6, 2023 15:42
run docker in huggingface with jupyter
===========Dockerfile(password: 名字前两字数符):===========
FROM k2fsa/icefall:torch1.13.0-cuda11.6
USER root
RUN apt update -y ; apt install -y iputils-ping curl
RUN chmod -R 777 /workspace
RUN ln -s /opt/conda/lib/stubs/libcuda.so /opt/conda/lib/stubs/libcuda.so.1
ENV SHELL=/bin/bash
RUN pip install jupyterlab
RUN useradd -m -u 1000 user
### Keybase proof
I hereby claim:
* I am diyism on github.
* I am diyism (https://keybase.io/diyism) on keybase.
* I have a public key whose fingerprint is 11A9 8349 5D23 9308 4FF7 772A 098B 48D8 50FB 1759
To claim this, I am signing this object:
@diyism
diyism / fileserver.py
Created November 23, 2023 08:30
phus.lu fileserver.py
"""
curl phus.lu/fileserver.py | env PORT=8001 python
"""
import os
import re
import sys
import time
try:
from http.server import SimpleHTTPRequestHandler, HTTPServer
@diyism
diyism / blockchain_ramble.md
Last active October 29, 2023 03:15
blockchain ramble

区块链漫谈


前言

    作为一个普通程序员 或者说 普通的IT从业者,如何掌握 新技术和新思维,我认为最重要的还是勇敢, 智力的本质是勇敢, 勇敢地闯入无人之地.
    可能有很多同学对区块链的理解比我更深更广, 但是为了提高自己的认识, 我积极地收集资料准备了这次演讲,
    但是后面都是我一家之言, 谬误之处还请大家海涵, 希望抛砖引玉可以把 区块链兴趣小组搞起来.

    解释一个名词, 分布式共识货币, 或简称分布式货币, 也就是流行的"数字货币"/"加密货币",

但我觉得这些称呼都没有抓住要点, 所以我更愿意称呼"分布式货币".

@diyism
diyism / clean gist history and clean github history
Last active September 9, 2023 07:35
clean gist history (for example remove password / key /token)
===============clean gist history=====================
git clone https://gist.github.com/diyism/cbc0......
cd cbc0*
git config --global core.editor "/usr/bin/sublime -n -w"
git rebase -i --root
#replace all "pick"(except the first line) into "squash"
#save and exit
#write comment
git push -f
git log --oneline