Skip to content

Instantly share code, notes, and snippets.

View dutchLuck's full-sized avatar

Owen Holland dutchLuck

View GitHub Profile
@dutchLuck
dutchLuck / Package.swift
Last active March 15, 2026 11:58
A Swift program using the Fixed precision Decimal package to read one or more CSV files and output Basic Statistics for each column of data with better than double precision accuracy.
// swift-tools-version: 5.9
import PackageDescription
let package = Package(
name: "fdbs",
platforms: [.macOS(.v12)],
dependencies: [
.package(url: "https://github.com/apple/swift-argument-parser", from: "1.2.0")
],
targets: [
@dutchLuck
dutchLuck / multifloat.jl
Created March 10, 2026 11:43
Variant of the Julia script "bfbs.jl" that uses MultiFloat instead of BigFloat to speed up calculations, but still retains more precision than Float64
#! /usr/bin/env julia
#
# M U L T I F L O A T . J L
#
# Multi Float Basic Statistics
#
# multifloat.jl last updated on Tue Mar 10 20:52:50 2026 by O.H. as 0v01
#
# Descendant of bfbs.jl 0v11, but adapted to use the MultiFloat package
# and its Float64x4 type for high precision calculations. It is a testbed
@dutchLuck
dutchLuck / network_scan.py
Last active February 16, 2026 08:36
Python script to leverage ping and arp to discover IP to ID/name association via known MAC addresses on the local network when DHCP shifts IP around and local DNS is dodgy.
#!/usr/bin/env python3
#
# N E T W O R K _ S C A N . P Y
#
# network_scan.py last edited on Wed Feb 16 19:26:35 2026 as 0v8
#
# Ping scan the local network for devices with known MAC addresses
# and record their IPv4 addresses and ping status. The results are
# displayed in two tables, one sorted by device name and the other
@dutchLuck
dutchLuck / csvstats.py
Created July 24, 2025 10:16
Output the basic descriptive stats for one or more CSV data files containing one or more columns of numbers.
#! /bin/python
#
# C S V S T A T S . P Y
#
# Output the basic stats for one or more data files containing
# one or more columns of numbers. If there are multiple columns
# of numbers then they must be separated by a comma. Comments
# are allowed in the data files if the comments are started with
# a # (i.e. hash character).
#
@dutchLuck
dutchLuck / analyse_csv.go
Last active July 18, 2025 10:23
Display the basic statistics of Comma Separated Value data from one or a number of files using the golang stat package.
//
// A N A L Y S E _ C S V . G O
//
//
//
// Display basic statistics of one or more columns of numbers separated by commas
// in one or more files.
//
@dutchLuck
dutchLuck / froniusPV_graph.py
Last active January 4, 2026 10:25
Python script to graph the real-time power/energy and voltage data from a Fronius inverter
#! /bin/python
#
# F R O N I U S P V _ G R A P H . P Y
#
# Last Modified on Fri Jan 04 21:23:30 2026 as version 0v12
#
# Code to graph the real-time data from a Fronius Primo inverter.
#
# Graphs Output AC Voltage and Output AC Power by default and the
# user can select alternate data to graph via command line options.
@dutchLuck
dutchLuck / checkReportedMacOS_ping_short-comings.sh
Created November 27, 2024 09:32
Shell script to check on the short-comings of the MacOS ping utility and its associated man-page that have been reported to Apple through Feedback Assistant
#! /bin/sh
#
# This shell script allows a quick check on whether Apple have done
# anything about the feedback on the short-comings of MacOS ping.
#
# Needs to have a target that responds to ICMP requests (i.e. ping request).
# In my case my local router (192.168.1.1) responds to ICMP requests apart from
# MASK_REQ. Edit "LOCAL_IP_ROUTER" value to suit a different network setup.
#
LOCAL_IP4_ROUTER=192.168.1.1
@dutchLuck
dutchLuck / try_1_utf8_char.rs
Last active February 22, 2025 06:12
Try a quick test of a sequence of bytes specified on the command line to produce a UTF-8 character
//
// T R Y _ 1 _ U T F 8 _ C H A R
//
// try_1_utf8_char.rs last edited on Sat Feb 22 16:09:31 2025
//
// Display a character from the UTF-8 bytes (or Unicode code point) specified
// on the command line.
//
// N.B. 1. The quickest and easiest access to similar, and probably
// better, functionality as this rust code is to use the following
@dutchLuck
dutchLuck / head_tail_file.md
Last active October 19, 2024 10:32
Read and output up to 1000 (UTF-8) characters from either the head or tail of a file or from stdin if no file is specified:

This "head_tail_file" gist is a contrived example of a command line utility facilitating AI code generation experimentation.

@dutchLuck
dutchLuck / file_byte_display.rs
Last active September 30, 2024 12:51
Another (very simple) file byte display/dump command line utility in the Rust language, largely produced by CopilotAI from newbie queries.
//
// F I L E _ B Y T E _ D I S P L A Y
//
// File Byte display
//
// Display the bytes in a small file, or the first 1000 bytes
// of a larger file.
//
// Warning: lacks adequate command line parameter checking
//