Skip to content

Instantly share code, notes, and snippets.

View roblogic's full-sized avatar
💭
probably playing code golf

Rob Papesch roblogic

💭
probably playing code golf
  • Auckland, NZL
  • 05:10 (UTC +13:00)
View GitHub Profile
@roblogic
roblogic / jtlmin.sh
Created April 5, 2017 06:19
Jmeter log processing script (probably obsolete)
#!/bin/sh
# jtlmin.sh :
# JMeter log processing script
# Collects & Averages throughput data using 1-minute increments
# Requires CSV-formatted log from JMeter "Simple Data Writer".
#
# Version Date Author Comment
# 2.0 2009-02-17 R. Papesch Refined awk procedure, renamed variables
# 1.0 2006-11-28 R. Papesch
@roblogic
roblogic / getxml.sh
Last active April 27, 2017 03:23
Extracts XML from application log to a file.
#!/bin/sh
[ $1 ] || { echo "Usage: getxml <redacted-app-logfile>" ; exit 1 ; }
[ -f $1 ] || { ls $1 ; exit 1 ; }
eventlog=$1
# determine input type and output file name
string0="LoggerMessageProcessor - Outbound message before validation: "
string1="LoggerMessageProcessor - CustomerProfileEvent Message: "
baseline_events=`zgrep -m 1 "$string0" $eventlog|wc -l|awk '{print $1}'`
@roblogic
roblogic / get_issuu.rb
Created May 16, 2017 08:42
Ruby script: download document JPGs from ISSUU
#-------------------------------------------------
# get_issuu.rb - retrieve all jpg's for a document
#-------------------------------------------------
# 1. Open the issuu.com document in your web browser, as usual
# example: http://issuu.com/iwishart/docs/thedivinity
# 2. Read the document page count; set variable $PAGES below
# 3. From browser menu, choose View > Source
# 4. Do a text search for "documentId"
# 5. Copy string such as "081230122554-f76b0df1e7464a149caf5158813252d9"
@roblogic
roblogic / getmsg.sh
Created May 18, 2017 00:31
Parse XML of known structure and print selected data on 1 line. Good for analysis of several XMLs from a file.
#!/bin/sh
# get interesting fields from the published XML and print it on one line
[ $1 ] || { echo "usage: getmsg.sh <input-xml-file>" ; exit 1 ; }
[ -f $1 ] || { ls $1 ; exit 1 ; }
inputxml=$1
echo "CustomerPub XML message contents:"
while read line ; do
echo "$line" | xmllint --format - \
| awk -F'ns2:Domain>|ns2:Name>|ns2:ValueBefore:>|ns2:ValueAfter>|ns3:AttributeValue>|ns2:EventTime>' '{print $2}' \
| grep . | tr '\n' ' ' | sed 's/<\///g'
@roblogic
roblogic / autozip
Last active May 25, 2017 04:06
Zip the output from a custom test framework (soapUI + groovy + excel spreadsheets, you don't wanna know...)
#!/bin/sh
# autozip.sh
# Tidies up SoapUI xml results. Archives approx 9000 files/minute.
# identify the unique pattern (RUN_ID) for an execution run
ls -1 *ExecReport* | grep -v Latest | sed 's/^.*ExecReport-//;s/.htm//' | cut -c -12 | while read RUN_ID
do
# figure out a name for the zip file
PREFIX=`ls *ExecReport-$RUN_ID* | awk -F. '{print $1}' | head -1`
SUFFIX=`ls *ExecReport-$RUN_ID* | awk -F[.-] '{print $(NF-1)}' | head -1`
@roblogic
roblogic / gvim
Created May 8, 2017 22:28
Launch windows gVim from MSYS2 shell
start /c/Progra~1/Vim/vim80/gvim.exe -c "set ff=unix" "$@" &
@roblogic
roblogic / vim on windows.md
Last active July 19, 2017 01:02
Notes to self, some common vim use cases
@roblogic
roblogic / Scientist.sh
Last active August 9, 2017 00:23
Bash version of github's "Scientist"
#!/bin/sh
# Scientist.sh
# Sends Production data from host930, to ClaimPoints *TEST* URL
# ClaimPoints experiment inspired by GitHub (mind blown!)
# http://githubengineering.com/move-fast/
# http://githubengineering.com/scientist/
#set -x
USAGE='Usage : ./CPTtestrun.sh <ClaimPoints-XML-File>
Example : ./CPTtestrun.sh host930.accrualservices-CPT1.6-2016111715