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
1.查看主机网卡流量 | |
#!/bin/bash | |
#!/bin/bash | |
#network | |
#Mike.Xu | |
while : ; do | |
time='date +%m"-"%d" "%k":"%M' | |
day='date +%m"-"%d' | |
rx_before='ifconfig eth0|sed -n "8"p|awk '{print $2}'|cut -c7-' |
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
//重设response | |
response.reset(); | |
//设置要下载的文件content-Type | |
response.setContentType("application/x-msdownload"); | |
//设置下载文件的名字 | |
String fileName = (new File(filePath)).getName(); | |
response.addHeader("Content-Disposition", "attachment; filename="+fileName); | |
//获取文件输入流 | |
FileInputStream fileIn = new FileInputStream(filePath); | |
//获得输出流 |