Skip to content

Instantly share code, notes, and snippets.

@anandsunderraman
anandsunderraman / setPostParams.groovy
Created October 1, 2014 18:47
SoapUI set post parameters
//set sessionToken with jwt token to post request
testRunner.testCase.getTestStepByName("TestStep").testRequest.params.setPropertyValue('requestParameterName','requestParameterValue');
@anandsunderraman
anandsunderraman / regex
Created October 3, 2014 02:38
Regex to replace commas between double quotes
("[^",]+),([^",]+),([^"]*")
$1$2$3
@anandsunderraman
anandsunderraman / promisedRequest.js
Last active October 19, 2016 14:03
Node.js request with Q promises
//import the http library
var http = require('http'),
//npm install q before requiring it
Q = require('q');
//a js object with options
var googleNewsOptions = {
hostname: 'ajax.googleapis.com',
path: '/ajax/services/search/news?v=1.0&q=nodejs',
method: 'GET'
@anandsunderraman
anandsunderraman / curl.md
Created March 2, 2018 05:13 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@anandsunderraman
anandsunderraman / introrx.md
Created June 6, 2018 17:26 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@anandsunderraman
anandsunderraman / mongoQuery.js
Last active November 19, 2018 20:42
Mongo db multiple groupBy
//given a set of documents
var db = [
{
"store": {
"storeId": "1",
"storeName: "A"
},
"audit": {
"createdBy": "ME"
}
@anandsunderraman
anandsunderraman / Readme.md
Created December 11, 2018 18:18
Apache Active MQ Local Setup

Apache ActiveMQ Local Setup for MaC

Installation

brew install apache-activemq

Setup

Modify the the activemq.xml located at /usr/local/Cellar/activemq/5.15.8/libexec/conf (general installation location) to have the following xml snippet

This will enable us to access the activemq use the JMXToolBox

@anandsunderraman
anandsunderraman / mapping.txt
Created April 19, 2019 11:55
Request Body Mapping for AWS API Gateway for form url encoded
#set($inputRoot = $input.path('$'))
#set($tokens = $inputRoot.split('&'))
client_secret=SECRET&$tokens[0]&$tokens[1]&$tokens[2]&$tokens[3]
@anandsunderraman
anandsunderraman / arrayToCSV.js
Created September 23, 2019 20:16
Robo 3T array to csv
//function to print CSV from an array for robomongo
//place this in .robomongorc.js which should be present in your home directory
//inspired by https://github.com/Studio3T/robomongo/wiki/How-to-export-to-CSV
function toCSV(array) {
let deliminator = ',';
let textQualifier = '\"';
let headers = [];
var data = {};
var count = -1;
@anandsunderraman
anandsunderraman / troubleshootingSSLTrustStoreCommands.txt
Last active October 9, 2019 20:39
Troubleshooting trust store issues and ssl
#inspects what is present in the truststore
keytool -list -v -keystore <truststorefile>
#gets certificate of a host via command line
openssl s_client -connect <host>:<port> | tee <cert-contents>
#import certificate into trust store
keytool -import -alias <alias> -file <cert-to-import> -storetype JKS -keystore <truststorefile>