Thursday, October 31, 2013

Executing Linux commands from Windows Command Prompt using Putty/Plink



Download PUTTY : http://the.earth.li/~sgtatham/putty/latest/x86/putty-0.63-installer.exe

  1. Install PuTTY
  2. Set the environment variables path for PuTTY: {install dir}/PuTTY
    • My Computer --> Right Click --> Properties --> Advanced System Settings --> Environment Variables
  3. Auto login command:
    • plink.exe -ssh <username>@<ip address> -pw <password>
    • plink.exe -ssh root@xxx.xxx.xx.xx -pw password
  4. Auto login and invoke a terminal command: 
    • plink.exe -ssh <username>@<ip address> -pw <password> "<terminal command>"
    • plink.exe -ssh root@xxx.xxx.xx.xx -pw password "nmon -f -s10 -c 360"


Thursday, October 24, 2013

JMeter - Creating date time string using javaScript & Beanshell


For MM/DD/YYYY date string use the below functions

1. using javaScript function:
${__javaScript(var d=new Date(); var date=d.getDate(); var
month=d.getMonth()+1; $DATE=(month<10?"0"+month:month) + "/" +
(date<10?"0"+date:date) + "/" + d.getFullYear();,DATE)}

Thus __javaScript() allows multiple lines of code as long as they are
separated by ";"

2. or using BeanShell
${__BeanShell(new java.text.SimpleDateFormat("MM/dd/yyyy").format(new
Date()))}



For MM/DD/YYYY date time string use the below functions

1. or using BeanShell
${__BeanShell(new java.text.SimpleDateFormat("MM/dd/yyyy HH:mm:ss").format(new
Date()))}

Reference:http://osdir.com/ml/jakarta.jmeter.user/2004-11/msg00024.html