Skip to content

Instantly share code, notes, and snippets.

Avatar
🌚
🌚

MisakaMikoto-35c5

🌚
🌚
  • Earth
View GitHub Profile
View 99-ifup-wan.sh
#!/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
#!/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'
@MisakaMikoto-35c5
MisakaMikoto-35c5 / isp-filter.py
Created December 8, 2019 13:03
筛选运营商
View isp-filter.py
#!/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
#!/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
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
#!/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
#!/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
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>')