Skip to content

Instantly share code, notes, and snippets.

View wen-long's full-sized avatar
☘️
wish to be lucky

wen-long

☘️
wish to be lucky
View GitHub Profile
@wen-long
wen-long / fh.only_dns.pac.js
Created December 4, 2016 10:46
公司里用的 pac,只用 dns 判断
var JP4 = 'https jp4.60in.com:443'
var wcn2 = 'https wcn2.avpn.cc:44300'
var guonei = wcn2;
var guowai = JP4;
var list = [
[16777472, 4294967040],
[16777728, 4294966784],
[16779264, 4294965248],
@wen-long
wen-long / fh.pac.js
Created December 4, 2016 10:39
公司里用的 pac
var JP4 = 'https jp4.60in.com:443'
var wcn2 = 'https wcn2.avpn.cc:44300'
var guonei = wcn2;
var guowai = JP4;
var list = [
[16777472, 4294967040],
[16777728, 4294966784],
openssl genrsa -out key.pem 2048
openssl req -new -x509 -key key.pem -out cert.pem -days 1095
cat key.pem cert.pem > stunnel_wenlong.oyeddns.com.pem
cp stunnel.conf stunnel_wenlong.oyeddns.com.conf
nano stunnel_wenlong.oyeddns.com.conf
sudo killall stunnel4
sudo stunnel4 stunnel_wenlong.oyeddns.com.conf
sudo proxychains4 /usr/sbin/squid -N
@wen-long
wen-long / update.php
Created January 14, 2016 15:07 — forked from lifesign/update.php
纯真数据库自动更新
<?php
/*
纯真数据库自动更新原理实现
示例代码使用php实现,从copywrite.rar中读取解密需要的一个key,然后解密qqwry.rar头0x200字节数据,随后使用zlib解压数据即可得到qqwry.dat文件
通过此代码的实现,你应该可以自行实现一个纯真数据库更新工具。copywrite.rar中还有一些更多的数据,没有一一列出,比如版本号、qqwry.rar文件大小。
collect from https://github.com/shuax/QQWryUpdate/blob/master/update.php
*/
$copywrite = file_get_contents("http://update.cz88.net/ip/copywrite.rar");
$qqwry = file_get_contents("http://update.cz88.net/ip/qqwry.rar");
@wen-long
wen-long / iOSAutoLayoutDebug
Last active September 7, 2015 10:25 — forked from xNekOIx/iOSAutoLayoutDebug
iOS AutoLayout debug
po [[UIWindow keyWindow] _autolayoutTrace] // prints layouts ambiguity
po [view constraintsAffectingLayoutForAxis:0] // horizontal
po [view constraintsAffectingLayoutForAxis:1] // vertical
[view hasAmbiguousLayout] // BOOL
[view exerciseAmbiguityInLayout] // visualizing ambiguity
viewController.extendedLayoutIncludesOpaqueBars = NO;
viewController.automaticallyAdjustsScrollViewInsets = NO;
viewController.edgesForExtendedLayout = UIRectEdgeNone;
@wen-long
wen-long / serial.m
Last active September 3, 2015 16:30 — forked from markd2/serial.m
Playing with NSPropertyListSerialization
#import <Foundation/Foundation.h>
// clang -g -Wall -fobjc-arc -framework Foundation -o serial serial.m
static id makePlistObjects (void) {
NSMutableDictionary *top = [NSMutableDictionary dictionary];
[top setObject: @"Hi I'm a string" forKey: @"string"];
[top setObject: [NSNumber numberWithInt: 23] forKey: @"number"];
@wen-long
wen-long / nali-update.sh
Last active November 18, 2019 03:44
QQWry.Dat is the ip database from http://www.cz88.net/ the website which offers the original code seems won't update any more and the download link refers to another obsolete website original script was from https://www.surfchen.org/nali but it was obsolete because the download link https://chenze.name/wenjian/QQWry.Dat offers an obsolete file a…
#!/bin/sh
qqwry_dat_url="http://update.cz88.net/soft/setup.zip";
qqwry_dat_local_path="/usr/local/share/QQWry.Dat"
curl=`which curl`
wget=`which wget`
workdir="/tmp/QQWry/"
zipname="QQWry.setup.zip"

E 信按需连接并发送通知给手机

exin_ontime.sh 如下

#! /bin/sh
export PATH="/bin:/usr/bin:/sbin:"$PATH
while true
do
    count=`cat /tmp/dhcp.leases | wc  -l`
    echo $count