Menu Home

Geeking Out

[INFO] rand: Updates made

As some of you know, I went to a bit of effort to create a script that tries as many ways as possible to generate random numbers. Some would say I went a bit too far. Overboard. So to speak. So recently I’ve been working on rewriting my passphrase generator […]

Analysing lotto numbers

New Zealand’s first Lotto broadcast, if you were interested. So I’m at home fighting a cold. In between cups of lemon+ginger tea with a bit of honey and ingesting whatever seemingly useful drugs I can find, I decided that I needed to do something. Anything. Lying in bed all day […]

Generating lotto numbers

A client joked today about predicting lotto numbers. This post doesn’t claim to do that, obviously, but I realised that I can use my rand script to generate some random lotto numbers. Obviously the below adheres to the NZ Lotto format of 6 numbers under 40, a bonus ball under […]

Portably(ish) generating random integers

[160309/20:49][rawiri@minty ~]$ rand -h rand – generate random positive integers Optional Arguments: -c [count. Number of numbers (Default:1)] -d [debug. Tells you which processing method is used (Default:off)] -h [help] -m [minimum number (Default:1)] -M [maximum number (Default:9223372036854775807)] TL;DR: I made a script that should generate a random integer for […]

Beating the vendor by 3 weeks

So a client has a vendor supplied python script that routinely connects to said vendor’s servers and downloads files. I won’t go into too much detail, but it’s a pretty important file transfer with far reaching financial influence, and we’ll leave it exactly at that. So, as you can guess […]

Host your own shellcheck

For those of you who don’t know, is a fantastic resource for improving your shell scripts.  When I came across it, I felt that I was a pretty good scripter.  How wrong I was.  Using shellcheck has probably been the single most influential factor on my scripting since the […]

Mass-diffing files

As part of my day to day tasks, I’m auditing configuration files and tidying them up. Slowly, we’re moving towards standardised files and configuration management. The first requirement of this is gathering the existing config files into one place. You could do this with any of a number of tools, […]