写了一个播放quic的脚本,其他文件单独上传
写了一个播放quic的脚本
import com.jd.forcebot.toolkit.parameterized.latest.AsciiFileAccessArbitrarily;
import com.jd.forcebot.toolkit.parameterized.latest.AsciiFileAccessCircularly;
import com.jd.forcebot.engine.groovy.Lifecycle;
import com.jd.forcebot.engine.groovy.RatePolicy;
import com.jd.forcebot.engine.groovy.TestCase;
import com.jd.forcebot.engine.groovy.TestSuite;
import java.util.concurrent.TimeUnit;
import org.junit.Assert;
import com.jd.forcebot.engine.groovy.*;
import com.jd.forcebot.toolkit.*;
import com.jd.forcebot.engine.TestUtils;
import org.junit.Assert;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;import com.alibaba.fastjson.JSON;/*
import com.jd.jsf.gd.util.Constants;
import com.jd.jsf.gd.util.JSFContext;
*/
import java.lang.String;
import java.lang.Integer;/**
* @author lmmlmm
*
*/
@TestSuite
class link {private boolean alive;public static Random random;public final Logger logger = TestUtils.LOGGER;void RunBase64Decode(String infile, String outfile) {ProcessBuilder builder = new ProcessBuilder("base64", "-d", infile);builder.redirectOutput(new File(outfile));builder.redirectError(new File(outfile+".err"));Process p = builder.start(); // may throw IOException p.waitFor()}void RunBackground(String[] proc_and_arg, String outfile) {String path = Thread.currentThread().getContextClassLoader().getResource("").getPath();System.out.println(" cmd is:" + path);ProcessBuilder builder = new ProcessBuilder(proc_and_arg);builder.directory(new File(path));builder.redirectOutput(new File(outfile));builder.redirectError(new File(outfile+".err"));Process p = builder.start(); // may throw IOExceptionalive = p.isAlive();//p.waitFor()//return alive;}void RunPs() {Process proc = Runtime.getRuntime().exec(["ps", "axu"] as String[]);BufferedReader stdInput = new BufferedReader(new InputStreamReader(proc.getInputStream()));BufferedReader stdError = new BufferedReader(new InputStreamReader(proc.getErrorStream()));String s = null;/* while ((s = stdInput.readLine()) != null) {System.out.println(s);}// Read any errors from the attempted commandwhile ((s = stdError.readLine()) != null) {System.out.println(s);}*/proc.waitFor();}void RunCmd(String runtag, String[] proc_and_args) {String path = Thread.currentThread().getContextClassLoader().getResource("").getPath();System.out.println("path ============="+path);Process proc = Runtime.getRuntime().exec(proc_and_args,null, new File(path));BufferedReader stdInput = new BufferedReader(new InputStreamReader(proc.getInputStream(),"utf8"));BufferedReader stdError = new BufferedReader(new InputStreamReader(proc.getErrorStream()));String s = "";System.out.println(runtag + " =============");while ((s = stdInput.readLine()) != null) {System.out.println(runtag+" input : "+s);}while ((s = stdError.readLine()) != null) {System.out.println(runtag+" error : "+s);}stdInput.close();stdError.close();proc.waitFor();}@TestCase(record=true,timeout=0L)void test() {try {TestUtils.transactionBegin("tuiliu");logger.error("tuiliu a");String path = Thread.currentThread().getContextClassLoader().getResource("").getPath();logger.error("path = "+path);RunCmd("pwd ", ["pwd" ] as String[]);RunCmd("who ", ["who"] as String[]);RunCmd("mkdir ", ["mkdir","test" ] as String[]);RunCmd("ls ", ["/bin/ls","-l" ] as String[]);RunCmd("cp ", ["cp","/export/forcebot_bigfile/836612/quic_jdquic_libs_centos6.tgz","." ] as String[]);RunCmd("cp ", ["cp","/export/forcebot_bigfile/836612/quic_client","." ] as String[]);RunCmd("tar ", ["tar","-xvf","quic_jdquic_libs_centos6.tgz" ] as String[]);RunCmd("press的根目录 ", ["/bin/ls","-l" ] as String[]);RunCmd("sh ", ["sh","press.sh" ] as String[]);RunCmd("ls ", ["/bin/ls","-l" ] as String[]);logger.error("tuiliu b");RunCmd("ls ", ["ls","-l" ] as String[]);logger.error("tuiliu c");if (alive == true) {TestUtils.transactionSuccess("tuiliu");logger.error("live id : {} voip_performancer success");}else{TestUtils.transactionFailure("tuiliu");logger.error("live id : {} voip_performancer failed");}TestUtils.transactionSuccess("tuiliu");} catch (Exception e) {TestUtils.transactionFailure("tuiliu");logger.error("tuiliu error");logger.error(e);e.printStackTrace();} try{Thread.sleep(300*1000);RunPs();RunCmd("for pgrep",["pgrep","press*" ] as String[]);RunCmd("for pkill",["pkill","press*" ] as String[]);RunPs();RunCmd("for pgrep",["pgrep","press*" ] as String[]);RunCmd("for pkill",["pkill","press*" ] as String[]);RunPs();RunCmd("for pgrep",["pgrep","press*" ] as String[]);} catch (Exception e) {e.printStackTrace();}
}}
没有权限的问题,以及找不到目录的解决方式
ls $(pwd)/libs
export LD_LIBRARY_PATH=$(pwd)/libs/gcc9/lib64:$LD_LIBRARY_PATH
for((i=1; i<=4; i++)) do
chmod a+x ./quic_client
nohup ./quic_client --host=11.65.168.169 --port=20000 http://11.65.184.11:8080/live/12345678.flv --disable_certificate_verification &
done
写了一个播放quic的脚本,其他文件单独上传相关推荐
- 为了帮学姐完成了钢琴家梦想,我用Python写了一个自动弹钢琴脚本,轻松弹奏出《天空之城》
人生苦短,我用Python 絮叨絮叨 效果展示 功能实现 代码实现 准备演奏 絮叨絮叨 事情是这样的,学姐马上要毕业了,前两天跟我彻夜长谈,还说自己一直有个钢琴家的梦想. 这不为了帮学姐圆梦,在我经过 ...
- 为了帮女神完成钢琴家梦想,我用Python写了一个自动弹钢琴脚本,轻松弹奏出各种钢琴曲!
事情是这样的,女神马上要毕业了,前两天跟我彻夜长谈,还说自己一直有个钢琴家的梦想. 这不为了帮女神圆梦,在我经过一番苦思冥想之后,终于用Python写了一个自动弹钢琴脚本,不会钢琴的都能成为钢琴家. ...
- java 写tb级文件_三管齐下!TB 级文件的上传性能瞬间被优化 100 倍!
作者 | 中华石杉 责编 | 伍杏玲 本文经授权转载石杉的架构笔记(ID:shishan100) 这篇文章我们来看看,世界上最优秀的分布式文件系统HDFS,是如何对超大文件的上传做性能优化的? 首先, ...
- 使用jQuery开发一个基于HTML5的漂亮图片拖拽上传web应用
昨天我们介绍了一款HTML5文件上传的jQuery插件:jQuery HTML5 uploader,今天我们将开发一个简单的叫upload center的图片上传程序,允许用户使用拖拽方式来上传电脑上 ...
- 实现一个小轮子:用AOP实现异步上传
文章来源:https://c1n.cn/2jnRk 目录 背景 代码与实现 结语 背景 相信很多系统里都有这一种场景:用户上传 Excel,后端解析 Excel 生成相应的数据,校验数据并落库. ...
- 将文件流(InputStream)写入文件 将上传文件MultipartFile写到文件
将文件流(InputStream)写入文件 方式一:不包裹Buffered(不使用缓冲) //将文件流(InputStream)写入文件 long size = 0; FileOutputStream ...
- 如何将写好的java代码制作成镜像,并上传到镜像仓库
学习docker已经有三个月了,之前总是一股脑的学,没有静下心来做整理,现在终于有时间可以好好整理三个月的学习成果了,今天就整理一下如何将写好的代码制作成镜像并将镜像上传到代码仓库. 1.代码编写 本 ...
- hdfs 多个文件合并_hadoop学习笔记3 hadoop程序将本地文件夹中多个文件,合并为一个文件并上传到hdfs中--梦飞翔的地方(梦翔天空)...
今天梦翔儿,成功实现hadoop编程,将本地文件夹中多个文件,合并为一个文件并上传到hdfs中 直接上代码:PutMerge.java import java.io.IOException; impo ...
- 判断大文件是否上传成功(一个大文件上传到ftp,判断是否上传完成)
大文件上传ftp,不知道有没有上传完成,如果没有上传完成另一个程序去下载这个文件,导致下载不完整. 判断一个文件是否上传完成的方法: /*** 间隔一段时间去计算文件的长度来判断文件是否写入完成* @ ...
最新文章
- 两数组的交集(无重复)Intersection of Two Arrays
- angular ng-href
- 2020牛客国庆集训派对day2 F题 Java大数处理
- Flex更改Image
- java多窗口,主编处理java代码怎么实现多个窗口
- 微信外卖点餐系统开发教程
- nowcoder20072 [HNOI2009]图的同构
- matlab语言定义变量类型,matlab定义变量-MATLAB,变量
- yang模型中rpc_RPC原理篇
- 网易游戏测试工程师面试小记
- centos7安装配置yum软件仓库
- laydate天蓝色的皮肤
- api.php act get api,api.php
- 如何用Python自动爬取全国30+城市地铁图数据?
- javaee学习之路(十五)JSP编程总结
- 三分钟黑掉阿里内网?他正在做的事将彻底改变现有商业模式!
- 哔哩哔哩导航背景写法
- 校园跑腿小程序怎么赚钱
- linux高dpi缩放字体锯齿,使用高DPI时如何解决IntelliJ IDEA中的字体抗锯齿问题?
- Unity 读取1-bit bmp图片文件
热门文章
- ACPI DEBUG方法
- HashMap源码注释翻译
- (原創) 如何讓ThinkPad X61在32位元Windows XP『用』到4GB記憶體? (NB) (ThinkPad) (OS) (Windows)
- pcre c语言,C/C++中的正则表达式库 - PCRE,PCRE++
- 学会以下几个软件你就学会次时代游戏模型制作了
- 英伟达这篇CVPR 2022 Oral火了!2D图像秒变逼真3D物体!虚拟爵士乐队来了!
- Python Matplotlib绘制漂亮的K线图,利用Tushare绘制K线图
- dnf机械机器人补丁_求大佬给个机器人补丁啊,看着难受→_→
- 实验一 网络扫码与网络侦查
- 【VScode】基本使用+快捷键