This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get_sub_time_paths(folder, root_vpath): | |
""" 迭代查找整个子目录,找出所有的子文档的路径 """ | |
result = [] | |
for obj in folder.values(True, False): | |
dc = obj.metadata | |
if isinstance(obj, Folder): | |
result.extend(get_sub_time_paths(obj, root_vpath)) | |
elif isinstance(obj, Page): | |
result.append(( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Shadowsocks 启动脚本 | |
# insserv -v -d /etc/init.d/shadowsocks | |
===================== | |
#!/bin/sh | |
### BEGIN INIT INFO | |
# Provides: shadowsocks | |
# Required-Start: $local_fs $remote_fs $network $syslog | |
# Required-Stop: $local_fs $remote_fs $network $syslog |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
######################################################################## | |
# | |
# Usage: via-ssh.sh [-v] [-d] [USER@]SERVER[:PORT] | |
# | |
# -v Provide verbose output. | |
# -d Send all UDP on the DNS port 53 to 127.0.0.1. | |
# USER User name to use for SSH; default is current user. | |
# SERVER Server to use for SSH. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Shadowsocks 启动脚本 | |
insserv -v -d /etc/init.d/shadowsocks | |
#!/bin/sh | |
### BEGIN INIT INFO | |
# Provides: shadowsocks | |
# Required-Start: $local_fs $remote_fs $network $syslog | |
# Required-Stop: $local_fs $remote_fs $network $syslog | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>KeepAlive</key> | |
<true/> | |
<key>OnDemand</key> | |
<false/> | |
<key>Label</key> | |
<string>com.tang.shadowsocks.startup</string> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -x | |
if [ -z "$1" ]; then echo Argument needed. >&2; exit 1; fi | |
if [ -z "$(pidof redsocks)" ]; then echo Redsocks requied >&2; exit 2; fi | |
DEF_IF="$(/sbin/route -n |awk '/^0.0.0.0/{print $8}')" | |
if [ -z "$DEF_IF" ]; then echo Cannot get default interface >&2; exit 3; fi | |
echo "Starting tunnel to $1..." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import re | |
import urllib | |
import math | |
import subprocess | |
def external_cmd(cmd): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[unix_http_server] | |
file=/tmp/supervisor.sock ; (the path to the socket file) | |
[supervisord] | |
logfile=/tmp/supervisord.log ; (main log file;default $CWD/supervisord.log) | |
logfile_maxbytes=50MB ; (max main logfile bytes b4 rotation;default 50MB) | |
logfile_backups=10 ; (num of main logfile rotation backups;default 10) | |
loglevel=info ; (log level;default info; others: debug,warn,trace) | |
pidfile=/tmp/supervisord.pid ; (supervisord pidfile;default supervisord.pid) | |
nodaemon=false ; (start in foreground if true;default false) | |
minfds=1024 ; (min. avail startup file descriptors;default 1024) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# This hook is run after a new virtualenv is activated. | |
# setup python interpretor and sitepackages | |
# for Sublime Text's SublimeCodeIntel plugin. | |
# codeintel looks in the root of any folder opened via `subl foldername` | |
# for project/.codeintel/config | |
# put the project directory | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
cat << EOF | |
/* | |
* Proxy Auto-Config file generated by autoproxy2pac | |
* Rule source: http://autoproxy-gfwlist.googlecode.com/svn/trunk/gfwlist.txt | |
* Last update: Sat, 16 Jun 2012 16:35:28 GMT | |
*/ | |
OlderNewer