Skip to content

Instantly share code, notes, and snippets.

View diyism's full-sized avatar

Malcolm Ke Win diyism

View GitHub Profile
@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"
)
### 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 / 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
@diyism
diyism / rclone.conf for chunker over blomp swift.txt
Last active January 4, 2024 01:11
rclone.conf for chunker over blomp swift
rclone.conf:
[blomp]
type = swift
user = i@gmail.com
key = 123456
auth = https://authenticate.blomp.com
tenant = storage
auth_version = 2
no_chunk = true
# Install dependencies "pip install youtube_transcript_api langchain"
# Run with "OPENAI_API_KEY=xxxx python summarize.py <youtube_id>"
import sys
from youtube_transcript_api import YouTubeTranscriptApi
from langchain import OpenAI, PromptTemplate
from langchain.text_splitter import TokenTextSplitter
from langchain.prompts import PromptTemplate
@diyism
diyism / svg non-scaling-stroke.txt
Last active December 14, 2022 16:59
svg non-scaling-stroke
<html><head>
<style>
#svgContainer {
background-color: #dedede;
}
#svgZoom {
transform-origin: 0% 0%;
}
</style>
@diyism
diyism / playwright-go.txt
Last active May 29, 2023 08:03
playwright-go
# how to work in kali/debian/ubuntu22.04(jammy), ref: https://gist.github.com/diyism/4b892a4339f35561dd2ec48158a8c75d
# the playwright in playwright-go currently only supports ubuntu 20.04(focal)
$ sudo singularity build -s ubuntu_focal/ docker://ubuntu:focal
$ sudo singularity shell --writable ubuntu_focal/
$ pwd // /root
$ mkdir WorkSpace_sing_ubuntu_focal
$ cd WorkSpace_sing_ubuntu_focal
$ apt update
@diyism
diyism / x11docker (linux sanbox like android shelter app)
Last active February 18, 2023 02:39
x11docker (linux sanbox like android shelter app)
"现在有很多国产linux程序了,比如 钉钉/飞书,
则linux上也有了隔离国产程序的需求,
试了1.virtualbox, 2.firejail, 3.docker theasp/novnc,
都不够方便实用, 最好用启动单个程序最快的是x11docker
@_:10个我离不开的android应用:
1.Shelter(隔离国产应用)"
#https://github.com/mviereck/x11docker
curl -fsSL https://raw.githubusercontent.com/mviereck/x11docker/master/x11docker | sudo bash -s -- --update
@diyism
diyism / cloaky test (cbeuw Cloak + sniproxy)
Last active October 17, 2022 07:54
cloaky test (cbeuw/Cloak + sniproxy)
$ cat cloaky_server.json
{
"ProxyBook": {
"sniproxy": [
"tcp",
"127.0.0.1:443"
]
},
"BindAddr": [
"===server lan ip=========:443"