Skip to content

Instantly share code, notes, and snippets.

View easternnl's full-sized avatar

easternnl easternnl

View GitHub Profile
@easternnl
easternnl / add_milliseconds.pl
Created October 18, 2019 06:25
Working with milliseconds if the perl library does not support it https://stackoverflow.com/a/18101550
use Time::HiRes qw(time);
use POSIX qw(strftime);
my $t = time;
my $date = strftime "%Y%m%d %H:%M:%S", localtime $t;
$date .= sprintf ".%03d", ($t-int($t))*1000; # without rounding
print $date, "\n";
@easternnl
easternnl / Prestashop.jmx
Created October 7, 2019 05:53
Prestashop with JMeter
<?xml version="1.0" encoding="UTF-8"?>
<jmeterTestPlan version="1.2" properties="5.0" jmeter="5.1.1 r1855137">
<hashTree>
<TestPlan guiclass="TestPlanGui" testclass="TestPlan" testname="Prestashop" enabled="true">
<stringProp name="TestPlan.comments"></stringProp>
<boolProp name="TestPlan.functional_mode">false</boolProp>
<boolProp name="TestPlan.tearDown_on_shutdown">true</boolProp>
<boolProp name="TestPlan.serialize_threadgroups">false</boolProp>
<elementProp name="TestPlan.user_defined_variables" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
<collectionProp name="Arguments.arguments">
@easternnl
easternnl / RemoteLoadGen.cmd
Created October 4, 2019 09:05
RemoteLoadGen.cmd
@echo off
rem JMeter start script on remote Agulhas server
rem
rem Depending on the name of the script it will run on that host
rem
rem Usage: %~n0 [JMETER FOLDER] [JMETER SCRIPT.jmx] [extra1] [extra2] [...]
rem
for /f "tokens=2 delims==" %%a in ('wmic OS Get localdatetime /value') do set "dt=%%a"
@easternnl
easternnl / EasternRegQuery.ps1
Created October 1, 2019 05:43
EasternRegQuery.ps1
function Get-RegValue([String] $KeyPath, [String] $ValueName) {
(Get-ItemProperty -LiteralPath $KeyPath -Name $ValueName).$ValueName
}
$regpath = $args[0]
$regs = @()
foreach ($property in (Get-Item $regpath).property)
{
@easternnl
easternnl / ListAllProperties.groovy
Created September 17, 2019 07:16
List all properties of an object in Groovy
log.info( eciRequest.properties.collect({it}).join(' \n'))
@easternnl
easternnl / JMeter pacing example.md
Last active October 18, 2019 11:25
JMeter pacing example

Use in milliseconds the following constructions:

pacing

or

pacing_min pacing_max

@easternnl
easternnl / sed.sh
Created August 20, 2019 11:36
Use perl to edit in files
perl -pi -e 's/foo/bar/g' file.txt
@easternnl
easternnl / setupPythonModule.cmd
Created August 19, 2019 07:49
Setup Python Module manual
REM Download modules from https://pypi.org/
set olddir=%cd%
tar -xvzf %1.tar.gz
move %1 "C:\Users\oosth14\AppData\Local\Programs\Python\Python37-32\Lib\site-packages\"
cd "C:\Users\oosth14\AppData\Local\Programs\Python\Python37-32\Lib\site-packages\%1"
python setup.py install
cd %olddir%
@easternnl
easternnl / setup for installing Virtual User Generator - Analysis and Fiddler.cmd
Last active October 8, 2021 06:57
Setup for installing Virtual User Generator - Analysis and Fiddler
@rem Create by Erik van Oost for version PC/LR 12.55
@if not exist C:\temp mkdir C:\temp
@echo %~f0
@set scriptpath=%~f0\..\
@echo Extracting setup files with 7Zip
%scriptpath%7z.exe x %scriptpath%SetupVugen.exe -oC:\temp\SetupVugen -y
%scriptpath%7z.exe x %scriptpath%SetupAnalysis.exe -oC:\temp\SetupAnalysis -y
@echo Installing prerequisites for Vugen
@easternnl
easternnl / regex
Last active May 2, 2019 08:29
Regex to capture all text between the two double quote's. Escaped double quotes will not match as end character, but included in capture
The following Regex:
"((?:\\"|[^"])*)"
Will match everything in between double quotes, and skip the escaped double quotes. Try your self at https://regex101.com/r/sbukHC/1
<a
id="link-cms-page-4-2"
class="cms-page-link"
href="http://server:8080\"/en/content/4-about-us"
title="Learn more about \"erik\""