Skip to content

Instantly share code, notes, and snippets.

# /etc/config/dhcp
# example config of how to use odchp instead of dnsmasq for ipv4
config odhcpd 'odhcpd'
# this tells openwrt to use odchpd instead of dnsmasq
option maindhcp '1'
# ensure the directory exists or the lease
# file won't be written and will fail silently
option leasefile '/tmp/odhcp-leases'
option leasetrigger '/usr/sbin/odhcpd-update'
@youxiaojie
youxiaojie / gist:86cd86a19ceb457be56ff70de0a00492
Created January 9, 2021 15:19
Replace <asm/uaccess.h> with <linux/uaccess.h> globally
Replace <asm/uaccess.h> with <linux/uaccess.h> globally
This was entirely automated, using the script by Al:
PATT='^[[:blank:]]*#[[:blank:]]*include[[:blank:]]*<asm/uaccess.h>'
sed -i -e "s!$PATT!#include <linux/uaccess.h>!" \
$(git grep -l "$PATT"|grep -v ^include/linux/uaccess.h)
to do the replacement at the end of the merge window.
@youxiaojie
youxiaojie / doh.sh
Last active May 19, 2020 11:45 — forked from dtmsecurity/doh_test.sh
DNS over HTTPS (DoH) Resolver GET Test Script
#!/bin/bash
svrlst="dns.google.com cloudflare-dns.com 1.1.1.1 1.0.0.1 9.9.9.9 dns9.quad9.net dns10.quad9.net dns.quad9.net doh.cleanbrowsing.org dns.dnsoverhttps.net doh.crypto.sx doh.powerdns.org doh.securedns.eu doh.ibr.cs.tu-bs.de doh.eieidns.com doh.blahdns.com doh.de.blahdns.com doh.defaultroutes.de doh.bugdns.com doh.datt.pw doh.ntu.ssooss.win dns.dns-over-https.com dns.rubyfish.cn doh.qis.io public.dns.iij.jp dns.nextdns.io"
for server in $svrlst
do
printf "===START $server===\n"
#ping -c 4 $server
curl -k -H "accept: application/dns-json" "https://$server/dns-query?name=example.com&type=AAAA"
printf "\n===old $server/resolve===\n"
curl -k -H "accept: application/dns-json" "https://$server/resolve?name=example.com&type=AAAA"
printf "\n===END $server===\n"
@youxiaojie
youxiaojie / bj-unicom-iptv.m3u
Created November 22, 2019 16:49 — forked from sdhzdmzzl/bj-unicom-iptv.m3u
北京联通iptv列表
#EXTM3U name="bj-unicom-iptv"
#EXTINF:-1,天津卫视高清
rtp:///239.3.1.141:1234
#EXTINF:-1,爱上4K
rtp:///239.3.1.236:2000
#EXTINF:-1,山东教育
rtp:///239.3.1.52:4120
import os
import struct
import marshal
import zlib
import sys
import imp
import types
class CTOCEntry:
def __init__(self, position, cmprsdDataSize, uncmprsdDataSize, cmprsFlag, typeCmprsData, name):
@youxiaojie
youxiaojie / dnsmasq-gfwlist.py
Created January 14, 2017 15:45 — forked from lanceliao/dnsmasq-gfwlist.py
将gfwlist转换成带ipset的dnsmasq规则,适用于OpenWrt智能上网
#!/usr/bin/env python
#coding=utf-8
#
# Generate a list of dnsmasq rules with ipset for gfwlist
#
# Copyright (C) 2014 http://www.shuyz.com
# Ref https://code.google.com/p/autoproxy-gfwlist/wiki/Rules
import urllib2
import re