Skip to content

Instantly share code, notes, and snippets.

View NF1198's full-sized avatar

Nicholas Folse NF1198

  • Albuquerque, NM
View GitHub Profile
@NF1198
NF1198 / fast-dot-com-test.sh
Last active October 26, 2025 08:36
Tests fast.com from bash
#!/usr/bin/env bash
# fast-curl.sh — FAST.com-style download test using curl
#
# Behavior (STDOUT vs STDERR):
# • Default (silent): step-named progress to STDERR; final summary line to STDOUT:
# "(<city>, <CC>) <hostname> — <XX.XX> Mbps"
# • --verbose: detailed diagnostics to STDERR (warmup details, per-stream speeds, etc.);
# final summary line to STDOUT (same as silent).
# • --smokeping: step-named progress to STDERR; STDOUT prints one numeric Mbps value per stream
# (no units/labels), suitable for SmokePing multi-sample ingestion.
@NF1198
NF1198 / Database
Last active October 25, 2025 14:10
Smokeping Config
*** Database ***
step = 60
pings = 10
# consfn mrhb steps total
AVERAGE 0.5 1 1008
AVERAGE 0.5 12 4320
MIN 0.5 12 4320
#!/bin/bash
# Colors
BOLD="\033[1m"
BLUE="\033[1;34m"
CYAN="\033[1;36m"
YELLOW="\033[1;33m"
MAGENTA="\033[1;35m"
WHITE="\033[1;37m"
DARKRED="\033[0;31m"
#!/bin/bash
# Colors
BOLD="\033[1m"
BLUE="\033[1;34m"
CYAN="\033[1;36m"
YELLOW="\033[1;33m"
MAGENTA="\033[1;35m"
WHITE="\033[1;37m"
DARKRED="\033[0;31m"
@NF1198
NF1198 / Hermes32.txt
Last active September 6, 2025 07:15
Hermes32 Hashing Function for Excel
MIT License
Copyright (c) 2025 Nicholas Folse
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@NF1198
NF1198 / timer.cpp
Created January 19, 2023 03:01
Timer Class for Arduino or other Embedded System
/*
* Copyright (c) 2022, 2023 Nicholas Folse
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
use std::sync::mpsc::SendError;
use std::sync::mpsc::{self};
use std::thread;
use std::time::Duration;
#[derive(Debug)]
enum MonitorCommand {
Stop,
}
#
# process_handler.py
# Copyright 2020 Nicholas Folse <[email protected]>
#
# This module defines a subprocess handler capable of managing
# multiple simultaneous subprocess.Popen calls. Results of each subprocess
# are processed in parallel. Each subprocess is injected with a line handler
# which is responsible for handling input from each call. Line handlers
# are called as line_handler(proc, line). If multiple handlers are injected for
# a given subprocess, the output of a handler is passed as the input to the next
@NF1198
NF1198 / README.md
Last active August 27, 2023 11:11
Simultaneously read from multiple subprocesses in Python 3 using {select, threads} (select, epoll, thread, subprocess, PIPE)

Reading from multiple subprocesses in Python: epoll vs threads

The following performance results were generated using a 2300 line file with output piped directly to a file instead of the console. (All awk delays were set to 0 for the benchmark) Processor Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz, 1992 Mhz, 4 Core(s), 8 Logical Processor(s)

The epoll solution is the clear winner, but is only available on Unix and Linux.

Approach 1: epoll

  • real 0m24.954s
@NF1198
NF1198 / tag_db.sql
Last active January 19, 2023 04:17
A simple tag database with logging backed by MySQL
-- --------------------------------------------------------
-- Host: 127.0.0.1
-- Server version: 10.4.6-MariaDB - mariadb.org binary distribution
-- Server OS: Win64
-- HeidiSQL Version: 10.2.0.5611
-- Author: Nicholas Folse
-- Copyright (c) 2020-2023 Nicholas Folse
-- --------------------------------------------------------