转换空之文库(轻国阅读Android)sln文档格式为txt Script to convert Sora.SLNovel to txt
- 使用方法
- 安装Python并下载 slnovel_to_txt.py 到任意文件夹中
import pexpect # download from https://github.com/pexpect/pexpect | |
def remote_ssh_cmd(ip, cmd, user="root", passwd=""): | |
ssh = pexpect.spawn('ssh %s@%s "%s"' % (user, ip, cmd)) | |
r = '' | |
try: | |
i = ssh.expect(['password: ', 'continue connecting (yes/no)?']) | |
if i == 0 : | |
ssh.sendline(passwd) | |
elif i == 1: |
# -*- coding: utf-8 -*- | |
HOSTS = """ | |
# 将gfw hosts内容粘贴到这里 | |
""" | |
BLACK_LIST = """com.co.jp | |
akamaihd.net | |
angrybirds.com |
#!/bin/bash | |
IMOUTO_HOST="https://www.dropbox.com/sh/lw0ljk3sllmimpz/AAC-n6LmtWbdlKQRbdEa0QUoa/imouto.host.7z?dl=1" | |
# download hosts file | |
curl -L -o imouto.host.7z ${IMOUTO_HOST} | |
# unzip | |
./7za x imouto.host.7z imouto.host.txt | |
awk '{ if (NR==1) sub(/^\xef\xbb\xbf/,""); print }' imouto.host.txt > imouto.host.txt |
# -*- coding: utf-8 -*- | |
## | |
## dump object to string | |
## | |
# XXX - ''.join([(len(`chr(x)`)==3) and chr(x) or '.' for x in range(256)]) | |
__vis_filter = """................................ !"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[.]^_`abcdefghijklmnopqrstuvwxyz{|}~.................................................................................................................................""" | |
def hexdump(buf, length=16): | |
"""form dpkt: Return a hexdump output string of the given buffer.""" |
###################################### | |
# Common Static library Makefile | |
###################################### | |
TARGET := libCocoaHTTPServer.a | |
SRC_DIR := Core Core/Categories Core/Mime Core/Responses Extensions/WebDAV \ | |
Vendor/CocoaAsyncSocket Vendor/CocoaLumberjack Vendor/CocoaLumberjack/Extensions | |
HEADER_DIR := include/ | |
# > make clean && make && make headers |
GET /?qt=cen&b=12376380.95%2C3574010.31%3B12376380.95%2C3574010.31&l=12&ie=utf-8&oue=1&res=api&callback=BMap._rd._cbk50813 HTTP/1.1 | |
Host: api.map.baidu.com | |
Connection: keep-alive | |
Accept: */* | |
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.111 Safari/537.36 | |
Referer: http://api.map.baidu.com/lbsapi/getpoint/index.html | |
Accept-Encoding: gzip, deflate, sdch | |
Accept-Language: zh-CN,zh;q=0.8,en;q=0.6 | |
Cookie: BAIDUPSID=B43CC9CA4D0E53EA8F712095BDAE5BB3; BDUSS=zl6MHBXYlZEZFRwSGlkallzeExVbENGQi1PcXFxbXdhNW05Yng2a01IcTlFLU5VQVFBQUFBJCQAAAAAAAAAAAEAAACK0zQHdXBiaXQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAL2Gu1S9hrtUV; BAIDUID=DE16C72A2F375E80190C332AC83BF0E0:SL=0:NR=10:FG=1; cflag=65279%3A2 |
#/bin/bash | |
killall itnl 2>&1 > /dev/null | |
itnl --tunnel & | |
expect -c " | |
set timeout 30 | |
spawn ssh -p2022 root@127.0.0.1 | |
expect { | |
\"*yes/no*\" {send \"yes\r\"; exp_continue} |
[url "git@github.com:"] | |
# Always use GitHub SSH protocol to push. | |
# Allows use of git:// for public repositories with push access | |
#pushInsteadOf = git://github.com/ | |
pushInsteadOf = https://github.com/ | |
[url "https://github.com/"] | |
# Use HTTP for GitHub instead of git:// or git@ | |
# Enable this in networks where git:// or git@ are blocked. | |
#insteadOf = git://github.com/ | |
#insteadOf = git@github.com: |
-module(cmd). | |
%% https://kisao.wordpress.com/2013/12/16/how-to-run-a-system-command-in-erlang/ | |
-export([run/1, run/2, test/0]). | |
run(Cmd) -> | |
run(Cmd, 5000). | |
run(Cmd, Timeout) -> | |
Port = erlang:open_port({spawn, Cmd},[exit_status]), |