Skip to content

Instantly share code, notes, and snippets.

View dutchLuck's full-sized avatar

Owen Holland dutchLuck

View GitHub Profile
@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
@dutchLuck
dutchLuck / gps_server.bas
Last active November 7, 2017 12:25
Test the feasibility of remotely obtaining GPS information from an Android phone with RFO BASIC! interpreter installed
REM Start of BASIC! Program
prgName$="GPS Server"
prgVer$="2"
! Set Update interval to 2 sec & Server port to 52345
intrvl=2000
srvrSckt=52345
!
verNum=val(version$())
GPS.open stts, intrvl
if stts <> 1
@dutchLuck
dutchLuck / helloSensors.bas
Created November 7, 2017 09:33
List the sensors available on an Android phone using the RFO BASIC! interpreter
REM Start of BASIC! Program
print "Hello world, courtesy of Basic! version " version$()
REM
print "Sensor List ";
sensors.list sensorarray$[]
array.length size,sensorarray$[]
print "(";
print format$("##",size);
print " item";
if size <> 1 then print "s";