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
  • 15:35 (UTC +12:00)
View GitHub Profile
@roblogic
roblogic / vim on windows.md
Last active July 19, 2017 01:02
Notes to self, some common vim use cases
@codeinthehole
codeinthehole / boo
Created April 15, 2016 08:20
Notifier script to use with long-running commands
#!/usr/bin/env bash
#
# Show an OSX alert
#
# This is useful when used in conjunction with a long-running script. Use this script to
# get a notification when te long-running script finishes.
#
# Eg:
#
# $ ./someprocess ; boo
# roll 2d6+3
function roll {
local match total
local -a rolls
if ! [[ "$1" =~ '([0-9]+)d([0-9]+)(\+[0-9]+)?' ]]; then
echo "usage: roll 2d6+3" 1>&2
return 1
fi
@gustavohenrique
gustavohenrique / soap-curl-shell
Created June 11, 2013 19:24
SOAP request using curl
# request.xml
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wst="http://sensedia.com/repository/wstoolkit">
<soapenv:Header>
<wsse:Security soapenv:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<wsse:UsernameToken wsu:Id="UsernameToken-1">
<wsse:Username>system</wsse:Username>
<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">manager</wsse:Password>
<wsse:Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">DWk64SMfJ6RxHAKgPRGtPA==</wsse:Nonce>
<wsu:Created>2013-04-17T18:36:54.013Z</wsu:Created>
</wsse:UsernameToken>
@roblogic
roblogic / Compare distributions with Gnuplot.md
Last active May 26, 2020 03:22
How to get response time distributions from Jmeter data, and plot the data to compare performance.

Comparing Response Distributions with Gnuplot

Bash script to get Response data

Analyse Jmeter CSV output using jstats2. The response values are in tmp files. Get frequency of response times into .dat files, using uniq and awk per below...

$ uniq -c /tmp/jstats2.1hASD | awk '{print $2, $1}' | sort -n > FPE10-50k-24May-freq.dat
$ uniq -c /tmp/jstats2.lJAVX | awk '{print $2, $1}' | sort -n > FPE11a-GetJourneys-freq.dat
$ uniq -c /tmp/jstats2.lEV2M | awk '{print $2, $1}' | sort -n &gt; FPE11b-JourneyKnown-freq.dat
@KarlMrax
KarlMrax / Killing Time's Sprint.md
Last active December 24, 2020 05:24
Killing Time's Sprint

The warship looked about its internal systems. All was ready; any further delay would constitute prevarication. It turned itself about, facing back the way it had come. It powered up its engines slowly to accelerate gradually, sleekly away into the void. As it moved, it left the skein of space behind it seeded with mines and hyperspace-capable missiles. They might only remove a ship or two even if they were lucky, but they would slow the rest down. It ramped its speed up, to significant engine degradation in 128 hours, then 64, then 32. It held there. To go any further would be to risk immediate and catastrophic disablement.

It sped on through the dark hours of distance that to mere light were decades, glorying in its triumphant, sacrificial swiftness, radiant in its martial righteousness.

@dajare
dajare / time2base36.sh
Last active January 3, 2021 18:25
Shell script to convert unix timestamp to base36 (alphanumeric, lowercase)
#!/bin/bash
# takes unix timestamp and converts to base36
# ht: https://en.wikipedia.org/wiki/Base36#bash_implementation
value=$(date +%s)
result=""
base36="0123456789abcdefghijklmnopqrstuvwxyz"
while true; do
result=${base36:((value%36)):1}${result}
if [ $((value=${value}/36)) -eq 0 ]; then

notes of things i learn while watching destroy all software

##das-0001-statistics-over-git-repositories

  • git rev-list HEAD -- takes the ref (in this case HEAD) and crawling backwards. so the most recent commit will appear first
    • to reverse (have most recent be first) git rev-list --reverse HEAD oldest -> newest
  • xargs
    • takes multiline output and joins them with a space
    • e.g.

$ echo '1

@jgrahamc
jgrahamc / airwolf.bas
Created May 9, 2017 18:00
AppleSoft BASIC program used in Airwolf S02E03 "Moffett's Ghost"
1 PP=2
10 HOME
12 PRINT
20 A$ = "0123456789ABCDEF"
30 FOR I = 1 TO 19
31 IF I = 9 THEN GOSUB 1000
40 L$ = ""
45 FOR J = 1 TO 9
50 L1 = INT ( RND (1) * 15 ) + 1: L2 = INT ( RND (1) * 15 ) + 1
60 L$ = L$ + MID$ (A$,L1,1) + MID$(A$,L2,1) + ": "
@roblogic
roblogic / jstats2
Last active July 20, 2021 09:11
jstats2 - Parse Jmeter output (csv), compute statistics about the test execution and response times.
#!/bin/bash
# Parse jmeter output and get various stats
# Hat-tip to 'stig', https://git.io/vFmeI
set -e # Exit immediately on error
# set -x # Debug
usage="jstats2 <jmeter-csv-output-file>"
[ $1 ] || { echo "$usage" ; exit 1 ; }
JFILE=$1
# Show timestamp info