Warning
请在系统更新/出厂设置后食用。
将设备连接至电脑,打开Settings -> General -> About -> Copyrights and License, 翻到最底部可以看到系统root密码。
在电脑上使用 ssh [email protected]
进行连接,下列说明均基于已连接到的前提。
from typing import final | |
import parsy as p | |
whitespace = p.regex(r"\s*") | |
comment = p.regex(r"//.*") | |
def lexeme(parser: p.Parser): | |
return parser << (whitespace | comment) |
# udpchk.py - simple tool to test UDP support of SOCKS5 proxy. | |
# Copyright (C) 2016-2017 Zhuofei Wang <[email protected]> | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); you may not | |
# use this file except in compliance with the License. You may obtain a copy | |
# of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# | |
# Unless required by applicable law or agreed to in writing, software |
"""A module for serving static files with URL rewriting support. | |
Module Overview: | |
This module provides the RewrittenStaticFiles class, an extension of Starlette's StaticFiles that supports URL rewriting. | |
The class is designed to serve static files from a specified directory or packages and to apply rewrite rules in case a requested | |
file is not found (HTTP 404). Rewrite rules are defined as a dictionary where keys are patterns (either wildcard strings or compiled | |
regular expressions) and values are target paths. If a request initially results in a 404 error, the class will attempt to match | |
the path against the rewrite rules and serve the corresponding rewritten file if found. | |
Examples: |
import hashlib | |
import zipfile | |
import zlib | |
from base64 import b64decode | |
from dataclasses import dataclass | |
from io import BytesIO | |
from pathlib import Path | |
from typing import IO, Literal, Optional | |
from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes |
# stage for building scrcpy | |
FROM ubuntu:latest AS builder | |
RUN apt-get update && \ | |
apt-get install -y --no-install-recommends \ | |
curl gcc git pkg-config meson ninja-build libsdl2-dev ca-certificates \ | |
libavcodec-dev libavdevice-dev libavformat-dev libavutil-dev \ | |
libswresample-dev libusb-1.0-0-dev libswscale-dev libvncserver-dev && \ | |
apt-get clean && \ | |
rm -rf /var/lib/apt/lists/* |
""" | |
Generate iCalendar file for BUPT class schedule. | |
Usage: | |
python this_file.py <username> <password> | |
Note: | |
1. You need to install the following packages: | |
- httpx | |
- ics |
Warning
请在系统更新/出厂设置后食用。
将设备连接至电脑,打开Settings -> General -> About -> Copyrights and License, 翻到最底部可以看到系统root密码。
在电脑上使用 ssh [email protected]
进行连接,下列说明均基于已连接到的前提。
import ast | |
BAD_ATS = { | |
ast.Attribute, | |
ast.Subscript, | |
ast.comprehension, | |
ast.Delete, | |
ast.Try, | |
ast.For, | |
ast.ExceptHandler, |
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build-env | |
RUN apt-get update && \ | |
apt-get install -y --no-install-recommends git && \ | |
git clone https://github.com/LagrangeDev/Lagrange.Core /app | |
WORKDIR /app | |
RUN dotnet publish Lagrange.OneBot/Lagrange.OneBot.csproj \ | |
--self-contained \ | |
-p:PublishSingleFile=true \ |