This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Run Docker container with latest Ubuntu and pass DISPLAY | |
$ docker run --net=host --env="DISPLAY" --volume="$XAUTHORITY:/root/.Xauthority:rw" -it ubuntu | |
$ xhost +local:root #允许Docker容器访问X服务器 | |
# Install simple GUI applications for test | |
$ apt update && apt install -y x11-apps | |
# Run GUI application 'calculator' | |
$ xcalc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
llama3-70b-8192的翻译是有问题的, 会导致1024字节缓冲区的后半段数据(下一个udp包的不完整前半部)作为一个udp包发送 | |
claude-3-opus-20240229的翻译 性能好于 gpt-4-turbo-2024-04-09的翻译 | |
=================================python gpt4 生成 65行============================================================ | |
import aiohttp | |
from aiohttp import web | |
import socket | |
import base64 | |
import asyncio |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ref: https://github.com/sleeyax/cronet-binaries/issues/1 | |
package main | |
import ( | |
"net/http" | |
"os" | |
"github.com/sagernet/cronet-go" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### 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: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
curl phus.lu/fileserver.py | env PORT=8001 python | |
""" | |
import os | |
import re | |
import sys | |
import time | |
try: | |
from http.server import SimpleHTTPRequestHandler, HTTPServer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rclone.conf: | |
[blomp] | |
type = swift | |
user = i@gmail.com | |
key = 123456 | |
auth = https://authenticate.blomp.com | |
tenant = storage | |
auth_version = 2 | |
no_chunk = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html><head> | |
<style> | |
#svgContainer { | |
background-color: #dedede; | |
} | |
#svgZoom { | |
transform-origin: 0% 0%; | |
} | |
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
========update============ | |
不需要x11docker, 更简单的方法, 直接允许容器访问host的X server: | |
https://gist.github.com/diyism/8f0d4b1cdfc4e9d0839927e78c90a327 | |
========================= | |
"现在有很多国产linux程序了,比如 钉钉/飞书, | |
则linux上也有了隔离国产程序的需求, | |
试了1.virtualbox, 2.firejail, 3.docker theasp/novnc, | |
都不够方便实用, 最好用启动单个程序最快的是x11docker | |
@_:10个我离不开的android应用: |
NewerOlder