Skip to content

Instantly share code, notes, and snippets.

@node
Last active December 28, 2016 09:56
Show Gist options
  • Save node/1390819 to your computer and use it in GitHub Desktop.
Save node/1390819 to your computer and use it in GitHub Desktop.
utility
- 下载整站
> 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/
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/
@node
Copy link
Author

node commented May 11, 2012

python 命令行直接处理JSON: curl http://xxxxx.com/xxx.json | python -m json.tool

python 调试 : python -m pdb myscript.py

@node
Copy link
Author

node commented Aug 6, 2015

跟有控制台输入的程序交互

!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