Skip to content

Instantly share code, notes, and snippets.

View diyism's full-sized avatar

Malcolm Ke Win diyism

View GitHub Profile
@diyism
diyism / build_waydroid_v5.sh
Created June 11, 2022 10:35 — forked from cniw/build_waydroid_v8.sh
Build Waydroid for Debian or Ubuntu based distro v5
#!/bin/bash
# script name: build_waydroid_v5.sh
# description: Build Waydroid for Debian or Ubuntu based distro v5
# upstream : https://gist.github.com/cniw/98e204d7dbc73a3fa1bf61629b2a2fc1
# author : Wachid Adi Nugroho <[email protected]>
# date : 2022-05-11
NC='\033[0m'
RED='\033[1;91m'
GREEN='\033[1;92m'
# 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 / docker-run-gui-app.sh
Last active November 15, 2024 18:13
[Docker] Run GUI application inside Docker container
# Run Docker container with latest Ubuntu and pass DISPLAY
$ xhost +local:root #先允许Docker容器访问host的X服务器
$ docker run --net=host --env="DISPLAY" --volume="$XAUTHORITY:/root/.Xauthority:rw" -it ubuntu
# Install simple GUI applications for test
$ apt update && apt install -y x11-apps
# Run GUI application 'calculator'
$ xcalc
# -*- coding: utf-8 -*-
# Make by x:@BoxMrChen and windsurf ai
import asyncio
import base64
import json
import io
import os
import sys
import pyaudio