Skip to content

Instantly share code, notes, and snippets.

@davidwu111
davidwu111 / main.py
Last active October 1, 2024 15:35
A simply Python script to extract iPhone Live photo which is .livp format into photo only, the .heic format. There is also a .mov file for live photo which I did not extract.
import os
import zipfile
def extract_heic_from_livp(root_dir):
processed_files = 0
error_count = 0
for foldername, subfolders, filenames in os.walk(root_dir):
for filename in filenames:
@davidwu111
davidwu111 / main.py
Created May 28, 2023 03:45
A quick Python script to filter all URL, domain and domain suffixes from HAR file.
import json
from urllib.parse import urlparse
import tldextract
def extract_urls(har_file_path, url_file_path, domain_txt_file_path, suffix_txt_file_path):
with open(har_file_path, 'r', encoding='utf-8') as f:
har_data = json.load(f)
urls = []
@davidwu111
davidwu111 / steps.md
Last active May 13, 2023 12:21
Enable Openwrt using DoH with dnscrypt-proxy2

Openwrt with DoH

This article describe how to use DoH with Openwrt. Using dnscrypt-proxy 2 as up-stream DNS server and dnsmasq forward all the DNS queries to dnscrypt-proxy 2.


Installation

I do prefer to complie packages directly into Openwrt. If you prefer to install by opkg please switch to openwrt's original software feeds.

@davidwu111
davidwu111 / .config
Created November 6, 2021 06:53
ImmortalWrt Config with extra disk space, no docker
#
# Automatically generated file; DO NOT EDIT.
# OpenWrt Configuration
#
CONFIG_MODULES=y
CONFIG_HAVE_DOT_CONFIG=y
# CONFIG_TARGET_sunxi is not set
# CONFIG_TARGET_apm821xx is not set
# CONFIG_TARGET_ath25 is not set
# CONFIG_TARGET_ath79 is not set
@davidwu111
davidwu111 / .env
Last active October 4, 2023 11:22
Cloudreve Docker-compose Sample
# Required
# > PUID & PGID
CLOUDREVE_PUID=0
CLOUDREVE_PGID=0
# > Aria2
ARIA2_RPC_SECRET=&1%2Kdf3%piY$
# Optional
@davidwu111
davidwu111 / docker_openwrt_config.md
Last active March 7, 2025 07:21
Clash Docker & Openwrt 配置与踩坑记录

Clash Docker & Openwrt 配置与踩坑记录


使用Openwrt作为主路由,另一台Ubuntu 18.04主机上使用Docker运行Clash来作为网关进行转发,以达到按规则智能翻墙的目的。也是很多人提到的“旁路由”方法。

注:Openwrt可以直接编译OpenClash,我这次只是纯粹为了折腾而折腾。


@davidwu111
davidwu111 / cloudSettings
Last active November 27, 2019 02:06
vscodesync
{"lastUpload":"2019-11-27T02:06:23.362Z","extensionVersion":"v3.4.3"}