使用 ipset -R
OR iptables-restore
添加规则
优先使用 ipset
, 其在流量转发时匹配效率相对 iptables
要高
测试 ss-rules
在 ignore.list
包含 4747
条 IP 的执行用时:
# time /usr/bin/ss-rules -c $CONFIG -i $IGNORE
#!/bin/bash | |
yum -y install gcc gcc-c++ m4 make automake libtool gettext openssl-devel pkgconfig perl-libwww-perl perl-XML-Parser curl curl-devel libevent-devel libevent libidn-devel zlib-devel | |
yum -y update | |
cd /root | |
wget https://downloads.sourceforge.net/project/transmissionbt/intltool-0.40.6.tar.gz | |
wget https://downloads.sourceforge.net/project/transmissionbt/libevent-2.0.14-stable.tar.gz | |
wget https://transmission.cachefly.net/transmission-2.84.tar.xz |
function ip2long(IP) { | |
var i = 0; | |
IP = IP.match(/^([1-9]\d*|0[0-7]*|0x[\da-f]+)(?:\.([1-9]\d*|0[0-7]*|0x[\da-f]+))?(?:\.([1-9]\d*|0[0-7]*|0x[\da-f]+))?(?:\.([1-9]\d*|0[0-7]*|0x[\da-f]+))?$/i); | |
if (!IP) { | |
return false; | |
} | |
IP[0] = 0; | |
for (i = 1; i < 5; i += 1) { | |
IP[0] += !!((IP[i] || '').length); | |
IP[i] = parseInt(IP[i]) || 0; |
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Document</title> | |
</head> | |
<body> | |
<textarea id="css" style="margin: 2px; width: 400px; height: 429px;"></textarea> | |
<textarea id="rules" style="margin: 2px; width: 400px; height: 429px;"></textarea> | |
<button id="submit">submit</button> |
:: 启动后需要保留窗口, 关闭窗口则结束进程 | |
aria2c --conf-path=aria2.conf -D |
<?php | |
$ip_ads = array( | |
array(16777472, 16778239), | |
array(16779264, 16781311), | |
array(16785408, 16793599), | |
array(16842752, 16843007), | |
array(16843264, 16859135), | |
array(16908288, 16909055), | |
array(16909312, 16910335), | |
array(16910592, 16941055), |
#!/bin/bash | |
# Shell script to backup MySql database. | |
# Usage: dbbackup db_name / dbbackup "db_name1 db_name2 db_name3" | |
# -------------------------------------------------------------------- | |
MyUSER="user" # USERNAME | |
MyPASS="pwd" # PASSWORD | |
MyHOST="localhost" # HOSTNAME | |
# Backup Dest directory, change this if you have someother location |
(function ($) { | |
// 根据当前页面编码进行URL编码 | |
$.urlEncode = function(s) { | |
var a, u; | |
a = document.createElement('a'); | |
a.href = '/?_=' + s; | |
u = a.href.slice(a.href.indexOf('/?_=') + 4); | |
return encodeURIComponent(u).replace(/%25([0-9A-F]{2})/gi, '%$1'); | |
}; | |
// 添加 localParam 方法 URL编码使用 $.urlEncode |
0000000000000000000000000000011111111111111111000000001000000000000000100000000101111111111111010000000010111111111111101000000001011011111111110100000000101110111111111010000000010111101111111101000000001011101111111110100000000101101110000111010000000010111111111111101000000001011111111111110100000000101111111111111010000000010000000000000001000000001111111111111111100000000000000000000000000000 | |
0000110000111100001100000000011000111111000110000000000100011111100010000000000011001111110011000000000001111111111111100000000000001111111111000000000000000011111111000000000000000011111111110000000000001111111111111111000000000000111111111100000000000000011111111110000000000000111111111111110000000000011011111111011000000000001000111111000100000000001100000110000011000000000110000000000001100000 |
// 所有方法都在最后返回当前元素(包括appendTo和prependTo) | |
// 可以使用链式写法 | |
// append方法 向匹配的元素内部追加内容 | |
// 参数可以是字符串或者是使用createElement()方法创建的DOM对象 | |
Node.prototype.append = function(ele) { | |
if (typeof ele === 'string') { | |
var t = document.createElement('div'); | |
t.innerHTML = ele; | |
while (t.firstChild) { |