Skip to content

Instantly share code, notes, and snippets.

anandsunderraman

Block or report user

Report or block anandsunderraman

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@anandsunderraman
anandsunderraman / troubleshootingSSLTrustStoreCommands.txt
Last active Oct 9, 2019
Troubleshooting trust store issues and ssl
View troubleshootingSSLTrustStoreCommands.txt
#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>
View arrayToCSV.js
//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 / mapping.txt
Created Apr 19, 2019
Request Body Mapping for AWS API Gateway for form url encoded
View mapping.txt
#set($inputRoot = $input.path('$'))
#set($tokens = $inputRoot.split('&'))
client_secret=SECRET&$tokens[0]&$tokens[1]&$tokens[2]&$tokens[3]
@anandsunderraman
anandsunderraman / Readme.md
Created Dec 11, 2018
Apache Active MQ Local Setup
View Readme.md

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 / mongoQuery.js
Last active Nov 19, 2018
Mongo db multiple groupBy
View mongoQuery.js
//given a set of documents
var db = [
{
"store": {
"storeId": "1",
"storeName: "A"
},
"audit": {
"createdBy": "ME"
}
@anandsunderraman
anandsunderraman / introrx.md
Created Jun 6, 2018 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
View introrx.md
@anandsunderraman
anandsunderraman / curl.md
Created Mar 2, 2018 — forked from subfuzion/curl.md
curl POST examples
View curl.md

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 / promisedRequest.js
Last active Oct 19, 2016
Node.js request with Q promises
View promisedRequest.js
//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 / regex
Created Oct 3, 2014
Regex to replace commas between double quotes
View regex
("[^",]+),([^",]+),([^"]*")
$1$2$3
View setPostParams.groovy
//set sessionToken with jwt token to post request
testRunner.testCase.getTestStepByName("TestStep").testRequest.params.setPropertyValue('requestParameterName','requestParameterValue');
You can’t perform that action at this time.