This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import groovy.text.GStringTemplateEngine | |
def engine = new GStringTemplateEngine() | |
def pool = ['a'..'z','A'..'Z',0..9,'_'].flatten() | |
Random rand = new Random(System.currentTimeMillis()) | |
def orderidChars = (0..10).collect { pool[rand.nextInt(pool.size())] } | |
def order_id = orderidChars.join() | |
vars.put("order_id", "T_"+order_id) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Problem Statement: | |
Based on variable URL patterns extract parameters into Jmeter variables for use by Samplers that would execute later on. | |
*/ | |
// Get the input data populated | |
//Type 1: ${host}/api/c/<unified-id>/_/N-<nvalue> | |
//Type 2: ${host}/api/c/<unified-id>/_/N-<nvalue> | |
//Type 3: ${host}/api/c/<unified-id>/_/N-<nvalue>?Ns=<sortParam> {The code for this one is not present |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
columns = [("term", "word"), ("term", "phrase"), ("context", "academic"), ("context", "non-academic"), ("meaning", "short"), ("meaning", "long")] | |
df = pd.DataFrame(columns=columns) | |
df.columns = pd.MultiIndex.from_tuples(columns) | |
# To set values | |
df.loc[0, ("term", "word")] = "condescension" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
df[df['A'].str.contains("hello")] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from elasticsearch import Elasticsearch | |
from elasticsearch import helpers | |
import json | |
# Define config | |
port = 9200 | |
timeout = 5000 | |
index = "jmeter" | |
doc_type = "type" | |
size = 10000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Works in a linux environment | |
ps -ef | grep -i jupyter | awk '{print $2}' | xargs kill -9 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import json | |
import numpy as np | |
import pandas as pd | |
url = 'http://<ElasticSearch_IP_Address>:9200/_sql?format=csv' | |
headers = { | |
'Content-Type': 'application/json', | |
} | |
query = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
grep -E -o ".{0,10}pattern.{0,10}" content.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
du -h * | awk '{print $1 " " $2}' | grep -E "[0-9]+[.]?[0-9]*M" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git add `git status | grep "modified:" | awk '{print $2}'` |
OlderNewer