bash usopp.sh proxy.txt
remember update proxy.txt.
| # coding=utf-8 | |
| import subprocess | |
| import json | |
| import os | |
| import time | |
| JQ_BIN_LINUX = '/usr/bin/jq' | |
| JQ_BIN_MAC = '/usr/local/bin/jq' |
| IMAGE_DIR=/Users/example/Dropbox/Public/upload_dropbox/temp | |
| URL_PREFIX=http://example.qiniudn.com/upload_dropbox/temp | |
| FILE_NAME=paste_`date '+%Y-%m-%dT%H:%M'`.png | |
| pngpaste $IMAGE_DIR/$FILE_NAME | |
| echo -n "" |
| 1/5 * * * * DEVICE="wlan0"; SUB_DOMAIN="eth0-pi"; BASE_DOMAIN="example.com"; DOMAIN="$SUB_DOMAIN.$BASE_DOMAIN"; DOMAIN_ID="11111111"; RECORD_ID="22222222"; TOKEN="33333,44444444444444444444444444444444"; IP=`ip addr | grep $DEVICE: -A 2 | grep inet | awk '{print $2}' | awk -F '/' '{print $1}'`; C_IP=`dig $DOMAIN | grep "^$DOMAIN" | awk '{print $5}'`; [ "$IP" = "$C_IP" ] && exit 0; [ -z $IP ] && exit 0; curl https://dnsapi.cn/Record.Modify -d "domain_id=$DOMAIN_ID&record_id=$RECORD_ID&sub_domain=$SUB_DOMAIN&record_type=A&record_line=默认&value=$IP&login_token=$TOKEN&format=json" |
| # coding=utf-8 | |
| import csv | |
| import argparse | |
| import itertools | |
| from collections import OrderedDict | |
| import sys | |
| from datetime import datetime, timedelta, time | |
| from dateutil import relativedelta | |
| from dateutil.parser import parse |
| # coding=utf-8 | |
| from __future__ import print_function, unicode_literals | |
| import re | |
| def convert_named_group_to_position_based_group(regex, replacement): | |
| position_based_regex = regex | |
| position_based_replacement = replacement | |
| named_groups = [x[3:-1] for x in re.findall(r'(\?P<[a-z_]+>)', regex)] |
| # -*- coding: UTF-8 -*- | |
| import sys | |
| import struct | |
| import codecs | |
| PinYinDic = [ | |
| "a", | |
| "ai", | |
| "an", | |
| "ang", |
| # coding=utf-8 | |
| import csv, codecs, cStringIO | |
| class UTF8Recoder: | |
| """ | |
| Iterator that reads an encoded stream and reencodes the input to UTF-8 | |
| """ | |
| def __init__(self, f, encoding): | |
| self.reader = codecs.getreader(encoding)(f) |
| # coding=utf-8 | |
| import csv | |
| import codecs | |
| import cStringIO | |
| import sys | |
| class UTF8Recoder: | |
| """ |
| # 15. 等级丰度曲线 | |
| # 根据 name 返回 color, lty | |
| get_line_type = function(name) { | |
| if (length(grep('-1$', name)) > 0) { | |
| color <- 1 | |
| } else if (length(grep('-2$', name)) > 0) { | |
| color <- 2 | |
| } else if (length(grep('-3$', name)) > 0) { |