Last active
December 28, 2016 09:56
-
-
Save node/1390819 to your computer and use it in GitHub Desktop.
utility
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
- 下载整站 | |
> wget -r -p -np -k http://xxoo.com | |
注释: -r 递归, -p 下载网页关联的其他资源,-np 不搜索上层目录, -k 绝对链接转为相对链接 | |
其他参数: | |
◆-b:后台下载,Wget默认的是把文件下载到当前目录。 | |
◆-O:将文件下载到指定的目录中。 | |
◆-P:保存文件之前先创建指定名称的目录。 | |
◆-t:尝试连接次数,当Wget无法与服务器建立连接时,尝试连接多少次。 | |
◆-c:断点续传,如果下载中断,那么连接恢复时会从上次断点开始下载。 | |
- 查看版本相关 | |
> uname -a | |
> lsb_release -a | |
> ls /proc/*info | |
/proc/buddyinfo /proc/cpuinfo /proc/meminfo /proc/slabinfo /proc/zoneinfo | |
> whoami | |
> whereis xxoo | |
> which xxoo | |
> id | |
> who | |
> write xxoo | |
> wall | |
更多常用命令: http://linux.chinaitlab.com/special/linuxcom/ |
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
jo - json output for shell https://github.com/jpmens/jo | |
jq is a lightweight and flexible command-line JSON processor. https://stedolan.github.io/jq/ |
通过命令将临时内容分享到外网 http://dpaste.de/about/
API
#!/usr/bin/env python import urllib import urllib2 import sys def paste_code(): request = urllib2.Request( 'http://dpaste.de/api/', urllib.urlencode([('content', ''.join(sys.stdin.readlines()))]), ) response = urllib2.urlopen(request) print response.read()[1:-1] if __name__ == '__main__': paste_code()
Save this script in /usr/local/bin/dpaste and chmod +x ..filepath.
Usage: cat foo.txt | dpaste
python 命令行直接处理JSON: curl http://xxxxx.com/xxx.json | python -m json.tool
python 调试 : python -m pdb myscript.py
跟有控制台输入的程序交互
!python.exe
import subprocess
halls = subprocess.Popen([r'D:\Workspace\TexturePacker\bin\TexturePacker.exe'], stdin=subprocess.PIPE, stdout=subprocess.PIPE)
result = halls.communicate(input=r'agree')[0]
print halls.returncode
print halls.communicate()
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Python 相关工具安装
easy_install
pip
install others