Skip to content

Instantly share code, notes, and snippets.

View rlnorthcutt's full-sized avatar
🇺🇦

Ron Northcutt rlnorthcutt

🇺🇦
View GitHub Profile
@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);
Easily create a modal link in Drupal
p><a class="use-ajax" data-dialog-options="{&quot;width&quot;:800}" data-dialog-type="modal" href="/node/2">See node 2</a></p>
source: https://befused.com/drupal/modal
@rlnorthcutt
rlnorthcutt / gist:dff8e7df2d6336089cd2234b0109e1a5
Created July 9, 2018 17:08
Drupal 8 Media Revision Page - Config
uuid: f9c22d2e-c285-4fb9-b5a0-5dc0e492248e
langcode: en
status: true
dependencies:
module:
- media
- user
id: media_revisions
label: 'Media revisions'
module: views