Skip to content

Instantly share code, notes, and snippets.

@randy3k
randy3k / jarl-external-rule.md
Last active May 21, 2026 20:56
Proposal: Jarl External Rule API (Plug-in Rules)

Proposal: Jarl External Rule API (Plug-in Rules)

This document details the design and implementation plan for adding an External Rule API to Jarl.

The goal is to allow developers to implement custom, out-of-crate linting rules in their own wrapper binaries or libraries, depending on jarl_core as a library, without modifying Jarl's internal codebase for every domain-specific rule.

This plan assumes that all external rules only offer safe fixes (or no fixes), which allows us to simplify the integration and reuse Jarl's existing configuration-level filters.


@randy3k
randy3k / processx_failure.md
Created May 4, 2026 04:26
processx Non-Blocking I/O Failure on Windows Named Pipes

Summary The R processx package is unable to perform non-blocking reads or polling on Windows Named Pipes when they are opened as external files. Functions that are intended to be asynchronous or non-blocking—specifically poll(), conn_read_chars(), and conn_read_lines()—behave as blocking calls that freeze the R session until data is available.

Environment

  • Operating System: Windows (win32)
  • Library: processx (R package)
  • Transport: Windows Named Pipes (\.\pipe\pipe_name)
  • Scenario: R connecting to a pipe created by an independent external process (e.g., a Node.js server).
@randy3k
randy3k / proxmox.sh
Created October 11, 2025 04:40
Proxmox boot up disk setup
# copy from a to b
sudo sgdisk -R /dev/sdb /dev/sda
# randomize guid
sudo sgdisk -G /dev/sdb
# inform the kernel or reboot
sudo partprobe /dev/sdb
sudo proxmox-boot-tool format /dev/sdb --force
sudo proxmox-boot-tool init /dev/sdb
@randy3k
randy3k / icloud-photos.py
Last active October 1, 2025 03:55
download icloud photos
import argparse
import os
import sys
import zoneinfo
from datetime import datetime
import shutil
import pandas as pd
from pyicloud import PyiCloudService
from pyicloud.exceptions import PyiCloudAPIResponseException

Start G-code

G90 ; use absolute coordinates
M83 ; extruder relative mode

M140 S{first_layer_bed_temperature[0]} ; set final bed temp
M104 S{first_layer_temperature[0]} ; set final nozzle temp

G28 ; home all axis
@randy3k
randy3k / x-forwarded-for.md
Last active December 3, 2024 17:57
Spoofing X-Forwarded-For
curl -H "X-Forwarded-For: 1.2.3.4" https://example.com

doesn't work for cloudflare proxied domain if it is specifically removed.

We may be still able to "workaround" it by connecting directly to the server.

curl -H "X-Forwarded-For: 1.2.3.4" --resolve example.com:443:$SERVER_IP https://example.com
@randy3k
randy3k / update-dns-v2.py
Created September 12, 2024 17:46
Cloudflare dns update
import CloudFlare
import requests
myip = requests.get('https://api.ipify.org').content.decode('utf8')
cf = CloudFlare.CloudFlare(token='<TOKEN>')
zones = cf.zones.get(params={'name': '<DOMAIN>'})
if not zones:
raise Exception("zone not found")
@randy3k
randy3k / cloudflare.ini
Created September 4, 2024 19:08
Docker setup for letsencrypt certbot cloudflare
dns_cloudflare_api_token = <CLOUDFLARE-API-TOKEN>
@randy3k
randy3k / homeassistant.conf
Last active September 16, 2024 05:12
Relying homeassistant and octoprint login errors to host rsyslog
# /etc/rsyslog.d/homeassistant.conf on client
# Enabling logging in HA
# logger:
# logs:
# homeassistant.components.http.ban: warning
if ($programname == 'homeassistant' and $msg contains 'Login attempt or request with invalid authentication') then {
$ActionQueueFileName fwdRule1
$ActionQueueMaxDiskSpace 1g
@randy3k
randy3k / netcat.txt
Last active August 25, 2024 04:01
rsyslog netcat example
# 134 = 16 * 8 + 6, i.e. facility = local0 and severity = info
echo "<134>1 - $HOSTNAME $PROGRAMNAME - - hello world" | nc -u -w 0 $DEST 514