Skip to content

Instantly share code, notes, and snippets.

View dutchLuck's full-sized avatar

Owen Holland dutchLuck

View GitHub Profile
@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 April 17, 2025 11:44
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 Thu Apr 17 20:47:00 2025
#
# Code to graph the real-time power/energy and voltage data from a Fronius inverter
#
######################################################################################
# This code started out as AI (ChatGPT) generated code.
@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
//
@dutchLuck
dutchLuck / typos.c
Created March 31, 2024 12:13
typos word frequency count
/*
* T Y P O S . C
*
* modified version that can be compiled by gcc
* Original T Y P O S is shown in a listing found on URL
* https://archive.org/details/68micro-vol-04-num-11/page/n35/mode/1up
*/
/*************************************************************/
/* Written by: Jodie A. Zoeller, SWTPc, August 1982 */
@dutchLuck
dutchLuck / rtimeExample.c
Last active February 21, 2024 13:31
Linux man page example of using library rtime function to get time from a network server running the RFC 868 time (port 37) service.
/*
* R T I M E E X A M P L E
*
*/
/*
* Manpage example for rtime() slightly modified
* compile on Ubuntu 20.04 LTS or older LTS version
* cc -Wall -o rtimeExample rtimeExample.c
*/
@dutchLuck
dutchLuck / c4.py
Last active September 11, 2023 09:58
Retro text version of Connect 4 game.
#! /usr/bin/python3
#
# C 4
#
# This code attempts to play the game of Connect 4
# using: text mode input and output.
#
# Last edited Mon Apr 3 20:58:53 2023
#
# c4 doesn't incorporate much game awareness in