Skip to content

Instantly share code, notes, and snippets.

@userid
userid / chnroute_update.txt
Created September 5, 2019 03:05 — forked from lixingcong/chnroute_update.txt
chinaroute路由表更新命令
路由表使用cidrmerge进行合并
cat route.txt| cidrmerge > route_merged.txt
https://github.com/karlpilkington/cidrmerge
ChinaRoute ipv4路由表
wget -O- 'http://ftp.apnic.net/apnic/stats/apnic/delegated-apnic-latest' | awk -F\| '/CN\|ipv4/ { printf("%s/%d\n", $4, 32-log($5)/log(2)) }' > /tmp/route.txt
Adblock_china_easylist去广告:
wget -4 --no-check-certificate -O - https://easylist-downloads.adblockplus.org/easylistchina+easylist.txt | grep -E '^\|\|[^\*]*\^$' | sed -e 's:||:address\=\/:' -e 's:\^:/127\.0\.0\.1:' | sort | uniq > /tmp/adblock.conf
@userid
userid / simple-doh.c
Created September 3, 2019 09:40 — forked from bagder/simple-doh.c
libcurl example using DOH
#include <stdio.h>
#include <curl/curl.h>
int main(void)
{
CURL *curl;
CURLcode res;
curl = curl_easy_init();
if(curl) {
@userid
userid / 北京联通IPTV内网组播.m3u
Created August 6, 2019 09:46 — forked from riverscn/北京联通IPTV内网组播.m3u
北京联通IPTV内网组播地址节目表(239.2.1.1网段)
#EXTM3U name="北京联通IPTV(RTP)”
#EXTINF:-1,CCTV-1高清(1)
rtp://239.2.1.129:8000
#EXTINF:-1,CCTV-2高清(2)
rtp://239.2.1.60:8084
#EXTINF:-1,CCTV-4高清(4)
rtp://239.2.1.105:8092
#EXTINF:-1,CCTV-7高清(7)
rtp://239.2.1.61:8104
#EXTINF:-1,CCTV-9高清(9)
#!/usr/bin/env python3
#
# Dumb script to dump (some) of bcache status
# Copyright 2013 Darrick J. Wong. All rights reserved.
#
# This file is part of Bcache. Bcache is free software: you can
# redistribute it and/or modify it under the terms of the GNU General Public
# License as published by the Free Software Foundation, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
@userid
userid / douyu_new.py
Created May 31, 2018 13:31 — forked from Justsoos/douyu_new.py
斗鱼2018新api,直播流URL提取
#! /usr/bin/env python3
import re
import requests
import argparse
import time
import hashlib
import json
def get_api(url,rate):
@userid
userid / ExclamationTopology.java
Created April 18, 2016 19:39 — forked from jatrost/ExclamationTopology.java
ExclamationTopology instrumented with Metrics collection.
package storm.starter;
import backtype.storm.Config;
import backtype.storm.LocalCluster;
import backtype.storm.StormSubmitter;
import backtype.storm.metric.LoggingMetricsConsumer;
import backtype.storm.metric.api.CountMetric;
import backtype.storm.metric.api.MeanReducer;
import backtype.storm.metric.api.MultiCountMetric;
import backtype.storm.metric.api.ReducedMetric;
@userid
userid / .forked_conkyrc
Created February 24, 2016 03:49 — forked from nofxx/.conkyrc
Conky for intel X79/it87
#
# xConky settings
#
update_interval 2
total_run_times 0
net_avg_samples 1
cpu_avg_samples 2
imlib_cache_size 0
@userid
userid / ss-redir 透明代理.md
Last active September 14, 2015 04:01 — forked from wen-long/ss-redir 透明代理.md
ss-redir 透明代理.md

##ss-redir 的 iptables 配置(透明代理)

透明代理指对客户端透明,客户端不需要进行任何设置就使用了网管设置的代理规则

创建 /etc/ss-redir.json 本地监听 7777 运行ss-redir -v -c /etc/ss-redir.json

iptables -t nat -N SHADOWSOCKS
# 在 nat 表中创建新链
iptables -t nat -A SHADOWSOCKS -p tcp --dport 23596 -j RETURN
# 23596 是 ss 代理服务器的端口,即远程 shadowsocks 服务器提供服务的端口,如果你有多个 ip 可用,但端口一致,就设置这个
import urllib2
def xiami_decode(s):
s = s.strip()
if not s:
return False
result = []
line = int(s[0])
rows = len(s[1:]) / line
extra = len(s[1:]) % line
#!/usr/bin/python
# -*- coding: utf8 -*-
# Simple RSA Implementation
# Authored by Jeremy <jeremy5189(at)gmail.com>
# Reference: http://www.ruanyifeng.com/blog/2013/07/rsa_algorithm_part_two.html
from fractions import gcd
import sys