View 99-ifup-wan.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
INTERNAL_IPV6_ADDRESS_RANGE=2001:db8::/64 | |
TARGET_INTERFACE=wan | |
REAL_INTERFACE=pppoe-$TARGET_INTERFACE | |
if [ "${INTERFACE}" = "$TARGET_INTERFACE" ]; then | |
case "${ACTION}" in | |
ifup|ifupdate) | |
ip route del default dev $REAL_INTERFACE proto static metric 0 |
View qb-ban-thunder.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
import requests, json, time | |
class Worker: | |
API_PREFIX = 'http://10.0.2.1/qbittorrent' | |
HTTP_AUTH_ENABLED = True | |
HTTP_AUTH_USERNAME = 'yjsnpi' | |
HTTP_AUTH_PASSWORD = '1145141919810893' |
View isp-filter.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
# Data Source: https://iptoasn.com/ | |
# Format: range_start range_end AS_number country_code AS_description | |
# Split: \t | |
def data_reader(filename): | |
filepipe = open(filename, 'r', encoding='utf-8') | |
data_str = filepipe.read() | |
filepipe.close() |
View simple-tcp-server.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
# Source: https://python3-cookbook.readthedocs.io/zh_CN/latest/c11/p02_creating_tcp_server.html | |
import socket | |
import random | |
import threading | |
from socketserver import ThreadingTCPServer | |
from socketserver import StreamRequestHandler, TCPServer |
View centos7-install-cde.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wget -O /etc/yum.repos.d/dcantrel-cde-epel-7.repo https://copr.fedorainfracloud.org/coprs/dcantrel/cde/repo/epel-7/dcantrel-cde-epel-7.repo | |
yum update -y | |
yum install cde -y | |
yum -y groupinstall "X window system" | |
echo -e '\n\nTERM=linux' >> /etc/bashrc | |
systemctl set-default graphical | |
systemctl enable dtlogin | |
systemctl start dtlogin |
View openwrt-dnsmasq-chinalist-updater.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
DNS=114.114.115.115 | |
wget -O /etc/dnsmasq.d/accelerated-domains.china.conf --no-check-certificate \ | |
https://raw.githubusercontent.com/felixonmars/dnsmasq-china-list/master/accelerated-domains.china.conf | |
wget -O /etc/dnsmasq.d/apple.china.conf --no-check-certificate \ | |
https://raw.githubusercontent.com/felixonmars/dnsmasq-china-list/master/apple.china.conf |
View fakebash.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import time | |
class FakeFileType: | |
def __init__(self, permission, user, group, size, create_time): | |
self.PERMISSION = permission | |
self.USER = user | |
self.GROUP = group | |
self.SIZE = size |
View pixiv_guest_spider.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
import urllib | |
from urllib import request | |
class PixivSpider: | |
IMAGE_PATTERN = re.compile(r'src="http[s]://[\w\d\-\_\.]{4,255}/\w/600x600/img-master/img/\d{4}/\d{2}/\d{2}/\d{2}/\d{2}/\d{2}/\d+_p0_master1200.jpg" alt="[^"]+"') | |
TAGS_PATTERN = re.compile(r'<ul class="inline-list"><li class="tag">.+</li></ul>') | |
TAG_PATTERN = re.compile(r'class="text">[^<>]+</a>') |