Skip to content

Instantly share code, notes, and snippets.

@codexss
codexss / openwrt hosts update cronjob
Last active December 25, 2015 13:51
openwrt-hosts-update-cronjob
0 4 * * * /usr/bin/wget -O- 'http://adaway.org/hosts.txt' > /etc/h0sts/adaway
0 4 * * * /usr/bin/wget -O- 'http://pgl.yoyo.org/adservers/serverlist.php?hostformat=hosts&showintro=0&mimetype=plaintext' > /etc/h0sts/yoyo
<?php
if (isSet($_GET["host"]))
{
$host = $_GET["host"];
$ip = gethostbyname($host);
if ($ip != $host) die ($ip);
}
echo "0.0.0.0";
?>
@codexss
codexss / delete_screen_weibo.js
Created January 17, 2016 23:15 — forked from mariotaku/README.md
删除当前屏幕所有微博
var http = new XMLHttpRequest();
var anchors = document.getElementsByTagName("div");
for (i = 0; i < anchors.length; i++) {
var mid = anchors[i].getAttribute("mid");
if (mid) {
console.log("Deleting " + mid);
var url = "/aj/mblog/del?ajwvr=6";
var params = "mid=" + mid;
http.open("POST", url, false);
//Send the proper header information along with the request
@codexss
codexss / china-unicom-cdn.md
Created January 18, 2016 11:04 — forked from lovemyliwu/china-unicom-cdn.md
使用联通cdn加速下载

120.52.72.*/original-uri

ip 地址获取脚本

window.success = [];
function test() {
    for(var idx=1;idx<255;idx++){
        var el = document.createElement('img');
        el.src = '//120.52.72.' + idx + '/41.media.tumblr.com/5cb6715c800c5b00969f33c162b317d1/tumblr_nzjh7dPKcD1ssbwqro1_540.png';
#smartproxy config file
#字符’#’用于注释
#参数每行一条,参数名称和值之间用空格分隔,使用”name value1 value2 … valueN”格式。
#同一参数名称可以在多行出现,系统会将其值自动合并成一个数组。
#TAG:session_name
#设置VPN连接会话名称。默认值:无。非必须。
session_name smartproxy
#TAG:welcome_info
#设置VPN连接后的欢迎信息。默认值:无。非必须。
welcome_info Welcome to smartproxy!
// ==UserScript==
// @name Change to MAC OS User-Agent for v.qq.com
// @version 1.0
// @description Uses MAC OS user agent, so v.qq.com can be html5 Played
// @include *://v.qq.com
// @copyright 2016, Lentin
// @user-agent Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3) AppleWebKit/537.75.14 (KHTML, like Gecko) Version/7.0.3 Safari/7046A194A
// ==/UserScript==
#!/bin/sh
server_IP=12.34.56.78
curl 'http://ftp.apnic.net/apnic/stats/apnic/delegated-apnic-latest' | grep ipv4 | grep CN | awk -F\| '{ printf("%s/%d\n", $4, 32-log($5)/log(2)) }' > chnroute.txt
iptables -t nat -N SHADOWSOCKS >/dev/null 2>&1 &
iptables -t nat -A SHADOWSOCKS -d $server_IP -j RETURN
iptables -t nat -A SHADOWSOCKS -d 0.0.0.0/8 -j RETURN
iptables -t nat -A SHADOWSOCKS -d 10.0.0.0/8 -j RETURN
// ==UserScript==
// @name Always google dot com
// @description Find and replace Google DOT Country-TLD to Google DOT com
// @namespace https://greasyfork.org/en/users/2871-spacedingo
// @version 1.06
// @include http*://*.google.*
// @exclude http*://*.google.com/*
// @exclude *://*/_/chrome/newtab*
// @grant none
// @run-at document-start
#全局指令
LoadModule ssl_module /usr/lib/apache2/modules/mod_ssl.so
LoadModule substitute_module /usr/lib/apache2/modules/mod_substitute.so
#虚拟主机的指令*
SSLProxyEngine On
ProxyPass / https://username.wordpress.com/
ProxyPassReverse / https://username.wordpress.com/
ProxyPassReverseCookieDomain .wordpress.com yourdomain.sample
AddOutputFilterByType INFLATE;SUBSTITUTE;DEFLATE text/html text/xml
Substitute s|//username.wordpress.com|//yourdomain.sample|i
adb shell appops set com.tencent.mm OP_READ_PHONE_STATE ignore
adb shell appops set com.tencent.mm COARSE_LOCATION ignore
adb shell appops set com.tencent.mm FINE_LOCATION ignore
adb shell appops set com.tencent.mm RUN_IN_BACKGROUND ignore