Skip to content

Instantly share code, notes, and snippets.

View smarigowda's full-sized avatar
🎯
Focusing

Santosh Marigowda smarigowda

🎯
Focusing
  • UK
View GitHub Profile
browser.execute("arguments[0].scrollIntoView();", $(selector))
@smarigowda
smarigowda / awkForDateTimeRange
Created April 28, 2017 14:37
awkForDateTimeRange
#!/usr/bin/awk -f
# Formats the timestamp as a number, so that higher numbers represent
# a later timestamp. This will not handle the time zone because date
# can't handle the o'clock notation. I hope all your timestamps use the
# same time zone, otherwise you'll have to hack support for it in here.
# 28/Apr/2017:13:15:16
# date -d '28 Apr 2017 13:15:16' +%d%b%Y:%H:%M:%S
function datefmt(d) {
@smarigowda
smarigowda / LinixCommands
Created April 28, 2017 09:28
LinuxCommands
// link sublime to command line
ln -s "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" /usr/local/bin/sublime
@smarigowda
smarigowda / soastavalidation.js
Created January 23, 2017 15:41
SOASTA CloudTest Validation Scripts
var message = $context.currentItem;
var statusCode = message.getResponse(message.RESPONSE_HTTP_STATUSCODE);
//$context.result.postMessage($context.result.LEVEL_INFO, 'Output.... ' + statusCode);
if ( statusCode != '200' ) {
result = false;
} else {
result = true;
}
@smarigowda
smarigowda / DOCKERCommands
Created December 21, 2016 17:15
DOCKERCommands
docker images | tail -n +2 | awk '{ print $1 ":" $2}' | xargs docker rmi
@smarigowda
smarigowda / jmeter_cloud_setup_using_docker_and_weave
Last active September 23, 2016 15:13
JMeter Cloud Setup Using Docker and Weave
-- JMeter Cloud Setup Using Docker and Weave --
-----------------------------------------------
# Create three docker hosts for jmeter servers
# Use Virtual Box
docker-machine create --driver virtualbox jmServer1
docker-machine create --driver virtualbox jmServer2
docker-machine create --driver virtualbox jmServer3
# open three terminals
@smarigowda
smarigowda / jmetersnippets.java
Last active August 29, 2015 14:18
JMeter Snippets
-- run only once for each thread
if( ${__counter(TRUE)} == 1 ){
print("MyPrint :: This is run once per thread" );
}
-- if condition can take a variable
-- ex ${any_variable}
-- JSR223 Post Processor
-- user of vars.get and prev
@smarigowda
smarigowda / jmetercloud
Last active August 29, 2015 14:18
jmeterCloud
# prerequisites
# ubuntu + docker + docker-machine + digital ocean cloud
-- create a docker host for jmeter-server
JMETER_SERVER_ID=1
docker-machine create --driver digitalocean --digitalocean-access-token $DOTOKEN jmeter-server${JMETER_SERVER_ID}
-- create a docker host for jmeter-client
docker-machine create \
--driver digitalocean \
@smarigowda
smarigowda / dockercmds.sh
Last active September 18, 2016 16:58
Docker
-- Docker machine commands
docker-machine
docker-machine ls
docker-machine -v
docker-machine env
docker-machine env staging
$(docker-machine env staging) -- sets the environment variables
or
eval "$(docker-machine env staging)" -- load the Machine configuration into your shell
@smarigowda
smarigowda / nodejs_jenkins.js
Created March 5, 2015 14:21
A node.js code for using Jenkins REST APIs
var request = require('request');
var fs = require('fs');
var unzip = require('unzip2');
var fstream = require('fstream');
// var handler = function (error, response, body) {
// if (!error && response.statusCode == 200) {
// console.log(body) // Show the HTML for the Google homepage.
// }
// }