Skip to content

Instantly share code, notes, and snippets.

View rlnorthcutt's full-sized avatar
🇺🇦

Ron Northcutt rlnorthcutt

🇺🇦
View GitHub Profile
@rlnorthcutt
rlnorthcutt / haproxy.cfg
Created October 7, 2025 14:53
HAProxy Full config for MCP Streaming HTTP
# /etc/haproxy/haproxy.cfg
global
log stdout format raw local0
defaults
mode http
timeout client 50000
timeout server 50000
timeout connect 5000
@rlnorthcutt
rlnorthcutt / mymodule.module
Created September 20, 2025 18:07
Drupal 10+ hook - delete (or unpublish) comment with Cyrillic characters
<?php
declare(strict_types=1);
use Drupal\Core\Entity\EntityInterface;
use Drupal\comment\CommentInterface;
/**
* Implements hook_ENTITY_TYPE_insert().
*
@rlnorthcutt
rlnorthcutt / basic.cfg
Last active May 20, 2025 19:48
Protecting Against SAP NetWeaver Vulnerability (CVE-2025-31324) with HAProxy
# Match both POST and PUT methods that could be used for uploads
acl is_upload method POST PUT
acl is_sap_uploader path -m beg /developmentserver/metadatauploader
# Block the requests
http-request deny deny_status 403 if is_upload is_sap_uploader
Add this configuration to your HAProxy frontend section that handles SAP NetWeaver traffic.
@rlnorthcutt
rlnorthcutt / devcontainer.json
Created May 9, 2025 18:58
Smallweb Devcontainer
// **What is this file?**
// This file is for use with the SmallWeb project, which is a lightweight web server
// and framework for building web applications. The purpose of this file is to
// define the development environment for a SmallWeb dev instance using
// Visual Studio Code's Remote - Containers feature.
// It specifies the configuration for the development container, including the base image,
// features, environment variables, and post-creation commands.Think of it as a recipe for
// creating a consistent and isolated development environment.
@rlnorthcutt
rlnorthcutt / gist:7eb7aeab085e4346329427091a4624f5
Created April 7, 2025 01:15
PocketBase Docs Sitemap April 2025
<?xml version="1.0" encoding="UTF-8"?>
<urlset
xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9
http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">
<url>
<loc>https://pocketbase.io/</loc>
@rlnorthcutt
rlnorthcutt / 2025-load-balancing-vmware-horizons-udp-and-tcp-02.cfg
Created April 1, 2025 19:12
HAProxy VMWare Horizons Config Example - Sample configuration using advanced options:
backend bk_horizon_tcp_blast
  server srv1 192.168.1.101:22443 check
  server srv2 192.168.1.102:22443 check
  balance source
  hash-type consistent sdbm
  hash-key addr-port
  hash-balance-factor 150
@rlnorthcutt
rlnorthcutt / 2025-load-balancing-vmware-horizons-udp-and-tcp-01.cfg
Last active April 1, 2025 19:11
HAProxy VMWare Horizons Config Example - basic configuration might look like for the custom “Blast” protocol
frontend ft_horizon_tcp_blast
bind *:22443
  default_backend bk_horizon_tcp_blast
backend bk_horizon_tcp_blast
server srv1 192.168.1.101:22443 check
server srv2 192.168.1.102:22443 check
balance source
udp-lb horizon_udp_blast
@rlnorthcutt
rlnorthcutt / test.js
Last active November 2, 2023 01:36
Test file for JSDocLite
/**
* Sample JS Library for testing JSDoc parsing.
* @module SampleJSLibrary
*/
/**
* A constant value representing the library version.
* @const {string} VERSION
* @desc The version of the library.
*/
@rlnorthcutt
rlnorthcutt / utility.js
Created September 14, 2023 14:17
Test of utility library without export
/**
* Get unique values from an array of objects based on a specified field.
*
* @param {Array} data - The array of objects to extract unique values from.
* @param {string} field - The field in each object to extract unique values from.
* @returns {Array} An array containing unique values from the specified field.
*/
function getUniqueValues(data, field) {
// Check if 'data' is an array and 'field' is a string
if (!Array.isArray(data) || typeof field !== 'string') {
<?php
use Drupal\Component\Utility\NestedArray;
if (empty($extra[0])) {
throw new \Exception("Please supply the id of the node you want to export to CDF.");
}
$node = \Drupal::entityTypeManager()->getStorage('node')->load($extra[0]);
$wrapper = new \Drupal\depcalc\DependentEntityWrapper($node);