r shiny using system command error - r

When I am trying to use the below code in RStudio I am getting error.
Code:
system(paste("sshpass -v -f -N -o StrictHostKeyChecking=no -i '<Path>/id_rsa.ppk' -L 3306:localhost:3306 root#127.0.0.1 sleep 20"))
Warning:
running command 'sshpass -v -f -N -o StrictHostKeyChecking=no -i '<Path>/id_rsa.ppk' -L 3306:localhost:3306 root#127.0.0.1 sleep 20' had status 127
How can I resolve the above issue in R?

Related

Command pabot not found in docker version of Robotframework browser

I'm trying to run Pabot / robot framework-browser script in Docker.
I have tryed to use command:
docker run --rm -v "$(pwd):/test" --ipc=host --user pwuser --security-opt seccomp=Docker/seccomp_profile.json -e "enviroment=***" -e "ROBOT_THREADS=10" -e PABOT_OPTIONS="--testlevelsplit" marketsquare/robotframework-browser:latest bash -c "pabot . -i smoke --outputdir /test/output /test"
Result: bash: pabot: command not found
Whats wrong in that syntax??
If i use "robot -i Smoke --outputdir /test/output /test"" then execution works ok (no errors).
I checked and confirmed that the image does not have pabot installed. You can build an image locally with docker build -f Dockerfile ..
Here is an example of the execution with that image, but installing missing dependencies:
sudo docker run --rm -v $(pwd)/atest:/atest -v /tmp:/tmp -e "ROBOT_THREADS=10" -e PABOT_OPTIONS="--testlevelsplit" --ipc=host --user pwuser --security-opt seccomp=seccomp_profile.json marketsquare/robotframework-browser:latest bash -c "pip install robotframework-pabot psutil && pabot --outputdir /tmp/test/output atest/test"

SSH to a server from Jenkins and run shell commands

All,
I am trying to run multiple shell commands on a remote server through Jenkins
I have tried the below code with Execute Shell, plugin
sudo su
ssh -o StrictHostKeyChecking=no -i /home/ec2-user/card.pem ec2-user#10.205.75.204 cat /home/ec2-user/testfile.txt
the problem with this is i can only run one command , for more than 1 I need to run
sudo su
ssh -o StrictHostKeyChecking=no -i /home/ec2-user/card.pem ec2-user#10.205.75.204 cat /home/ec2-user/testfile.txt
ssh -o StrictHostKeyChecking=no -i /home/ec2-user/card.pem ec2-user#10.205.75.204 rm -rf /home/ec2-user/testfile.txt
how can we achieve running mutiple commands like this?
Hey # Siraj Syed check following example:
String commandToRun = 'cat /home/ec2-user/testfile.txt; rm -rf /home/ec2-user/testfile.txt'
// pipeline step
sh "ssh -o StrictHostKeyChecking=no -i /home/ec2-user/card.pem ec2-user#10.205.75.204 /bin/bash -c '\"${commandToRun}\"'"
Can you just do:
ssh -o StrictHostKeyChecking=no -i /home/ec2-user/card.pem ec2-user#10.205.75.204 "cat /home/ec2-user/testfile.txt; rm -rf /home/ec2-user/testfile.txt"

Explain plan statement in DB2 not working using shell script

I have used the below statement in my script to get the explain plan for a stored procedure but its throwing error
a=`db2 -x "SELECT current timestamp FROM sysibm.sysdummy1"`
c=`echo $a|cut -d"." -f1-2`
time_new="'$c%'"
db2exfmt -d ${DATABASE} -e ${DATABASE} -g -l -n -s ${SCHEMA_NAME} -o SP_explain_plan_${TIMESTAMP}.out -w ${time_new} -# 0 -v %
Its not able to read the timestamp correctly. Can someone help

rsync unexplained error (code 129)

I am trying to rsync the data from one server to another, and approximately ~1.1T of data, but when am doing rsync I am getting following exception in the middle of transfer terminating the process.
rsync error: unexplained error (code 129) at rsync.c(541) [sender=3.0.7]
nohup rsync -r -t -v -o -g -p -c -l -z /source/images/ranker root#xx.xxxx.xxx.xx:/mnt/source/images &

How to redirect gcc errors to a file in Unix?

I tried following this but that doesn't work in Unix.
I've been running this command :
gcc temp.c -o temp.o 2> err.txt
And got the following error:
gcc: 2: No such file or directory
Any ideas what that shouldn't work? Maybe because I’m using it over a Unix server?
In tcsh you don't use 2> to redirect stderr, you use >& that will redirect both stdout and stderr. If you want to redirect them separately, have a look at this quick guide.
Redirecting stderr using 2> in tsch is not possible, but here are 2 work arounds
bash -c "gcc temp.c -o temp.o 2> err.txt" #if bash or sh is available
(gcc temp.c -o temp.o > /dev/null) > & err.txt
Yours:
gcc temp.c -o temp.o 2> err.txt
you sure mean:
gcc -o temp.o temp.c 2> err

Resources