Skip to content

Instantly share code, notes, and snippets.

@flashlab
flashlab / README.md
Created March 16, 2025 03:19
Simple curl file(s) uploading backend with php and nginx

Features

Upload file(s) with curl using the PUT or POST method

Support for specific path: https://curl.abc.com/subfolder/filename Auto-create folders if they don't exist Returns JSON with path, filename, size, and MD5

Delete file or folder with curl using the DELETE method

@flashlab
flashlab / baiduOCR.py
Created January 20, 2025 09:30
baidu OCR (text or table)
# encoding:utf-8
# https://console.bce.baidu.com/ai/#/ai/ocr/overview/index
# pip3 install requests pillow
import io
import os
import sys
import requests
import base64
import time
@flashlab
flashlab / worker.js
Last active March 7, 2024 01:50
simple cf worker to proxy jellyfin plugin repository
export default {
async fetch(request, env, ctx) {
ctx.passThroughOnException();
const url = new URL(request.url);
const uri = url.pathname.slice(1);
if (request.method != "GET" || uri.length < 3 || uri.indexOf('.') == -1 || uri == "favicon.ico" || uri == "robots.txt") {
return new Response('', { status: 405 })
} else {
if (!uri.startsWith('http')) uri = 'https://' + uri;
if (uri.endsWith('/manifest.json')) {
@flashlab
flashlab / dtjek
Last active February 6, 2024 06:48 — forked from westh/dtjek
🥞 a small distributed DNS checker – much like dnschecker.org but in your terminal, you could put it in /usr/local/bin or somewhere for easy access
#!/bin/bash
servers=(
"Cloudflare:1.1.1.1"
"Google:8.8.8.8"
"DNSpod:119.29.29.29"
"Aliyun:223.5.5.5"
"114:114.114.114.114"
"baidu:180.76.76.76"
"CNNIC:1.2.4.8"
@flashlab
flashlab / worker.js
Created November 13, 2023 08:57
cf simple worker to make tg/wx/dingding notice for qbittorrent
/**
* cf simple worker to make tg/wx/dingding notice for qbittorrent.
*
* - Required variables:
* - SITE_LIST - e.g. {"hdh": "https://xxx.org/torrents.php?search=", "ttg": "https://xxx.im/browse.php?search_field="}
* - QBIT - link for qbit webui
* - TG_HOST - "https://api.telegram.org/"
* - TG_TOKEN - botxxx:xxxx
* - TG_CHAT_ID
* - WX_HOST - "https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key="
@flashlab
flashlab / tile.sh
Last active February 4, 2025 10:45
genereate video contact sheet by ffmpeg
#!/bin/sh
#===============================================================================
# tile-thumbnails
# create an image with thumbnails from a video
# modified from https://github.com/NapoleonWils0n/ffmpeg-scripts/blob/master/tile-thumbnails, adapte for jellyfin docker
#===============================================================================
# dependencies:
# ffmpeg ffprobe awk