Skip to content

Instantly share code, notes, and snippets.

View qwIvan's full-sized avatar

yang chanfa qwIvan

View GitHub Profile
@qwIvan
qwIvan / qqvdl
Created February 13, 2017 04:47 — forked from zmwangx/qqvdl
v.qq.com SHD downloader (腾讯超清视频下载) https://github.com/soimort/you-get/issues/1298#issuecomment-236489420
#!/usr/bin/env zsh
print_progress () print -R $'\e[32m'"$*"$'\e[0m' >&2
print_error () print -R $'\e[31m'"Error: $*"$'\e[0m' >&2
# Obvious parameters
vid=f00213kcpwl
defn=shd
# To be extracted from browser's network inspector
/**
* For Google Voice
* @Author zbinlin <zbinlin@outlook.com>
*/
var sleep = delay => new Promise(resolve => setTimeout(resolve, delay));
var composeClick = function x(btn) {
var rect = btn.getBoundingClientRect();
var x = rect.clientX + rect.width * Math.random();
var y = rect.clientY + rect.height * Math.random();
@qwIvan
qwIvan / log.vim
Created June 16, 2016 08:07
Logging every autocommands events in the log file
augroup EventLoggin
autocmd!
autocmd BufNewFile * call s:Log('BufNewFile')
autocmd BufReadPre * call s:Log('BufReadPre')
autocmd BufRead * call s:Log('BufRead')
autocmd BufReadPost * call s:Log('BufReadPost')
autocmd BufReadCmd * call s:Log('BufReadCmd')
autocmd FileReadPre * call s:Log('FileReadPre')
autocmd FileReadPost * call s:Log('FileReadPost')
autocmd FileReadCmd * call s:Log('FileReadCmd')
@qwIvan
qwIvan / web-servers.md
Created April 23, 2016 18:10 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@qwIvan
qwIvan / serverspeeder-all.sh
Created April 19, 2016 09:06 — forked from rptec/serverspeeder-all.sh
锐速破解版一键安装。
#!/bin/bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin
export PATH
#定义变量
#授权文件自动生成url
APX=http://soft.91yun.org/soft/serverspeeder/apx1.php
#安装包下载地址
INSTALLPACK=http://soft.91yun.org/soft/serverspeeder/91yunserverspeeder.tar.gz
# Pre-operation for some non-standard Chinese font file
Open("font_b.ttf")
SelectAll()
ScaleToEm(1024)
Generate("temp.ttf", "", 0x14)
Close()
# Open English font and merge to the Chinese font
Open("font_a.ttf")
SelectAll()
function (sInput){
var sOutput='';
for(var i=0,c=sInput.length;i<c;i++){
var nChar=sInput.charCodeAt(i);
if(nChar>=33&&nChar<=126){
sTmp=String.fromCharCode(33+(((nChar-33)+47)%94));
sOutput+=sTmp
}else{
sOutput+=sInput.charAt(i)
}
@qwIvan
qwIvan / shadowiptables.sh
Last active February 28, 2023 22:57
自动翻墙脚本,配合shadowsocks-libev的ss-redir使用,需要ipset(sudo apt-get install ipset)
#!/bin/bash
#自动翻墙脚本,配合shadowsocks-libev的ss-redir使用。需要ipset
chnroute_file=~/.chnroute
ignore_ips=(
45.32.50.160
45.127.93.239
103.214.68.175
0.0.0.0/8
10.0.0.0/8
127.0.0.0/8
@qwIvan
qwIvan / SslUtil.java
Created October 21, 2015 02:56 — forked from sharonbn/SslUtil.java
SSL/TLS connection from Eclipse Paho Java client to mosquitto MQTT broker
import java.io.*;
import java.nio.file.*;
import java.security.*;
import java.security.cert.*;
import javax.net.ssl.*;
import org.bouncycastle.jce.provider.*;
import org.bouncycastle.openssl.*;
public class SslUtil
import java.util.ArrayList;
import java.util.Collections;
/**
* 分馒头算法
* 秋香需要按照3:4:5:6的比例把馒头分给江南四大才子9527、9528、9529、9530这4人,
* 让每个人领到馒头的时间尽可能分散,两次领到馒头的时间间隔保持不变,以免出现时而吃不完、时而不够吃的情况。
*/
public class ManTouQueue {
public static void main(String[] args) {