Skip to content

Instantly share code, notes, and snippets.

View jbrzozoski's full-sized avatar

jbrzozoski

View GitHub Profile
@jbrzozoski
jbrzozoski / pwtest.sh
Created March 3, 2019 02:43
Simple bash script to safely check passwords against the pwnedpasswords.com API
#!/bin/bash
# Get a password from the user...
while read -s -p "Enter password to check or Ctrl-C to quit: " pass2check
do
# Output a blank line to clean up output...
echo
# Get the SHA1 of the entered password...
sha1sum_output=`echo -n ${pass2check} | sha1sum`
@jbrzozoski
jbrzozoski / gsmtime.c
Last active December 6, 2020 05:28
GSM Time to Unix
#include <stdint.h>
#include <stdio.h>
#include <time.h>
#ifndef TM_YEAR_BASE
#define TM_YEAR_BASE 1900
#endif
#ifndef GSM_YEAR_BASE
#define GSM_YEAR_BASE 2000

Keybase proof

I hereby claim:

  • I am jbrzozoski on github.
  • I am jbrzozoski (https://keybase.io/jbrzozoski) on keybase.
  • I have a public key ASAUg7anK2MRYxmLqt4szmlPtVw5qefO9ms7euVBIIm2hgo

To claim this, I am signing this object:

@jbrzozoski
jbrzozoski / letter_blocks.c
Created July 5, 2019 04:00
Writing messages with kids letter blocks for fun...
#include <stdio.h>
#include <stdint.h>
#include <string.h>
/*
This was some idle programming for fun while on vacation. I was staying
at a vacation house that had a set of kids letter blocks, the sort that
are six-sided wooden blocks with a different letter on each side. I was
trying to figure out the most entertaining messages I could write with the
@jbrzozoski
jbrzozoski / smarter_c_array.c
Created March 11, 2020 15:33
Example of indexed array declarations in c
#define ERROR_ALPHA 1
#define ERROR_BETA 4
#define ERROR_GAMMA 3
#define ERROR_DELTA 2
static const char *const strerr[] = {
[ERROR_ALPHA] = "Error Alpha",
[ERROR_BETA] = "Error Beta",
[ERROR_GAMMA] = "Error Gamma",
[ERROR_DELTA] = "Error Delta",
@jbrzozoski
jbrzozoski / ignition_mqtt_subdevices.py
Created June 3, 2020 21:17
Scriptable way to find MQTT/SparkPlug sub-devices in Ignition since MQTT Engine doesn't provide a list
def findDevicesBelow(path, maxdepth):
browse_results = system.tag.browse(path, {})
for item in browse_results.getResults():
if item['name'] == 'Device Info':
device_reference = str(item['fullPath']).replace('[MQTT Engine]Edge Nodes/','').replace('/Device Info','')
print(device_reference)
if (item['hasChildren'] == True) and (maxdepth > 0):
findDevicesBelow(item['fullPath'], (maxdepth-1))
# Searching everyone:
@jbrzozoski
jbrzozoski / linux_gitconfig
Created January 28, 2021 18:36
My gitconfig template to make setting up new linux machines a little quicker
[user]
name = Set Name
email = set.email@example.com
[branch]
autosetuprebase = always
[core]
autocrlf = input
editor = nano
excludesfile = ~/.gitignore
[branch]
# Regeneratable SlickEdit Files
*.vtg
*.vpwhist
*.vpwhistu
RegEdit tweaks circa Win10 22H2:
- Set RTC to UTC (if dual-booting Linux)
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation
DWORD RealTimeIsUniversal = 1
(may act flaky if you don't disable auto-timezone and auto-sync first, although it sometimes seems
okay to turn them back on after rebooting with this setting in place?)
- Disable Cortana
HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Search

This is ultra-low-priority junk I had stuck in my head last night, and I figured writing it all down might be the best way to stop thinking about it.

One of the issues with Sparkplug B is support for systems with multiple application nodes. Specifically, in terms of coordinating BIRTH messages.

These thoughts are not compatible with Sparkplug B, but are still interesting, possibly for a future generation... I'm trying to think them through before badgering people on the committee with them.

I'm contemplating what happens if you split the variable and non-variable portions of the NBIRTH into two messages, publishing the non-variant portion persistently, and using the LWT to both announce the node has gone offline and clear the persistent publish.

Let's call the new persistent topic NSCHEMA.