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
  • 13:33 (UTC +12:00)
View GitHub Profile
@roblogic
roblogic / msys2-setup.md
Last active March 26, 2024 19:20
MSYS2 first time setup

MSYS2 is a minimalist linux/unix shell environment for Windows.

Quote: "A modern replacement for MSYS bringing recent versions of the GNU toolchains, Git and other common Unix command line tools to the Windows platform"

1. Install

Do all the steps listed here: http://msys2.github.io/
(troubleshooting guide here: https://github.com/msys2/msys2/wiki/MSYS2-installation )

2. Set up proxies

@roblogic
roblogic / vimrc
Last active March 20, 2018 04:10
My `vimrc` used with gVim on Windows. Resides in `C:\Program Files\Vim\`
set nocompatible
behave mswin
" Appearance
"
set synmaxcol=999 "turn off syntax when line is too long
colorscheme wombat
highlight Cursor guibg=lightgreen guifg=black
set guifont=Fira\ Mono\ Medium:h10
"set guifont=InputMonoCompressed:h10
@roblogic
roblogic / SysEnv.ahk
Created November 21, 2016 01:51
Editing Windows PATH with AutoHotKey
#SingleInstance, Force
#NoEnv ; somewhat ironic...
; this won't work in vista/7 if it's not run as an administrator.
; i'm too lazy to request it manually so the easiest way is to
; compile this script, and then under Compatibility tab in the
; compiled exe's Properties select "Run as Administrator"
RegRead, P, HKLM, SYSTEM\CurrentControlSet\Control\Session Manager\Environment, PATH
@roblogic
roblogic / percentiles.sh
Last active December 4, 2019 11:11 — forked from stig/percentiles.sh
Print percentiles for list of data points
#!/bin/sh
# Exit immediately on error
set -e
# set -x
# Create temporary file
FILE=$(mktemp /tmp/$(basename $0).XXXXX) || exit 1
# Sort entries
@roblogic
roblogic / stats.sh
Last active October 26, 2017 05:49
Print basic statistics for numeric data input to stdin
#!/bin/sh
# thanks to http://unix.stackexchange.com/a/13779/62529
sort -n | awk '
BEGIN {
c = 0;
sum = 0;
}
$1 ~ /^[0-9]*(\.[0-9]*)?$/ {
a[c++] = $1;
sum += $1;
@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 / jstats.sh
Created April 27, 2017 00:00
Parse Jmeter output, get performance stats from `stats.sh` and `percentiles.sh`
#!/bin/sh
# Parse jmeter output and get various stats
usage="jstats.sh <jmeter-csv-output-file>"
[ $1 ] || { echo "$usage" ; exit 1 ; }
jfile=$1
ut1=`sed -n '2p' $jfile | cut -c -10`
ut2=`tail -1 $jfile | cut -c -10`
t1=`date --date="@$ut1" +"%y%m%d.%H%M%S"`
t2=`date --date="@$ut2" +"%y%m%d.%H%M%S"`
@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 / tracelog
Last active October 16, 2017 04:46
Trace process thread in a log file
#!/bin/sh
# test script
# trace Web Service logic by process id
# e.g. paxservices-CEB2.0-1435811146723-211
USAGE='Usage: tracelog <logfile_name> <process_id>'
[ $2 ] || { echo $USAGE ; echo ; exit ; }
LOGFILE_NAME=$1
PROCESS_ID=$2
@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" "$@" &