This file contains hidden or 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
| # -*- encoding: utf-8 -*- | |
| require 'mini_magick' | |
| require 'rtesseract' | |
| require 'nokogiri' | |
| require 'nestful' | |
| require 'csv' | |
| require 'pp' | |
| class Buy360 | |
| def initialize(url='') |
This file contains hidden or 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 file echoes a bunch of color codes to the | |
| # terminal to demonstrate what's available. Each | |
| # line is the color code of one forground color, | |
| # out of 17 (default + 16 escapes), followed by a | |
| # test use of that color on all nine background | |
| # colors (default + 8 escapes). | |
| # |
This file contains hidden or 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
| #compdef fab | |
| _targets() { | |
| _describe -t commands "fabric targets" target_list | |
| } | |
| output_levels=( | |
| 'status: Status messages, i.e. noting when Fabric is done running, if the user used a keyboard interrupt, or when servers are disconnected from. These messages are almost always relevant and rarely verbose.' | |
| 'aborts: Abort messages. Like status messages, these should really only be turned off when using Fabric as a library, and possibly not even then. Note that even if this output group is turned off, aborts will still occur – there just won’t be any output about why Fabric aborted!' | |
| 'warnings: Warning messages. These are often turned off when one expects a given operation to fail, such as when using grep to test existence of text in a file. If paired with setting env.warn_only to True, this can result in fully silent warnings when remote programs fail. As with aborts, this setting does not control actual warning behavior, only whether warning messages are printed or hidden.' |
This file contains hidden or 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
| # | |
| # Bash completion for fabric | |
| # | |
| function _fab_complete() { | |
| local cur | |
| if [[ -f "fabfile.py" || -d "fabfile" ]]; then |
This file contains hidden or 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
| # -*- encoding: utf-8 -*- | |
| # author: binux<[email protected]> | |
| import re | |
| import time | |
| import json | |
| import requests | |
| class BaiduFanYiAPI(object): | |
| """ |
This file contains hidden or 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
| import os | |
| import re | |
| import socket | |
| import struct | |
| def dns_resolve(host, dnsserver): | |
| assert isinstance(host, basestring) and isinstance(dnsserver, basestring) | |
| index = os.urandom(2) | |
| hoststr = ''.join(chr(len(x))+x for x in host.split('.')) | |
| data = '%s\x01\x00\x00\x01\x00\x00\x00\x00\x00\x00%s\x00\x00\x01\x00\x01' % (index, hoststr) |
This file contains hidden or 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: $0 <max_cmd> <cmdfile/stdin> | |
| # max_cmd: 同时执行的命令数 | |
| # cmdfile/stdin: 标准输入或者命令文件,一条命令一行 | |
| set -u | |
| max_cmd=$1 | |
| cmd_file=${2:--} | |
| cur=0 | |
| line=1 | |
| for ((;;)) do |
This file contains hidden or 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
| #close the startup message | |
| startup_message off | |
| term linux | |
| setenv LC_CTYPE zh_CN.GBK | |
| setenv TERM linux | |
| #set a biger buffer | |
| #defscrollback 1024 | |
| defscrollback 2048 | |
| caption always "%{=u .r} %-w%<%{=ub .Y}%n %t%{=u .r}%+w " |
This file contains hidden or 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 sys | |
| import os | |
| import re | |
| import gevent | |
| import gevent.monkey | |
| import gevent.timeout | |
| gevent.monkey.patch_all() |
This file contains hidden or 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 | |
| # License: Public Domain. | |
| # Author: Joseph Wecker, 2012 | |
| # | |
| # Are you tired of trying to remember what .bashrc does vs .bash_profile vs .profile? | |
| # Are you tired of trying to remember how darwin/mac-osx treat them differently from linux? | |
| # Are you tired of not having your ~/.bash* stuff work the way you expect? | |
| # | |
| # Symlink all of the following to this file: | |
| # * ~/.bashrc |