Skip to content

Instantly share code, notes, and snippets.

View estelsmith's full-sized avatar

Estel Smith estelsmith

View GitHub Profile
@estelsmith
estelsmith / fetch-timeout.js
Created December 7, 2023 22:05
JavaScript Fetch w/ Timeout
/**
* A wrapper around the fetch api that will abort after a configurable amount of time has passed.
*
* @param {URL|string} input
* @param {RequestInit?} init
* @param {number?} providedTimeout
* @returns {Promise<Response>}
*/
export default async function fetchTimeout(input, init, providedTimeout) {
const timeout = providedTimeout ?? config.timeouts.defaultTimeout;
@estelsmith
estelsmith / readme.md
Last active October 31, 2024 19:31
Gemini Lake Hardware-accelerated Transcoding

Gemini Lake Hardware-accelerated Transcoding

This is for a used Wyse 5070 I recently purchased, having the J5005 CPU and a huge 8 GB RAM all running on AlmaLinux 9.1. Why AlmaLinux? Because I'm partial to RHEL-based systems with its focus on stability, that's all. Unfortunately the downside is that oftentimes new software isn't readily available.

I want to unlock the ability to perform hardware-accelerated transcoding in ffmpeg so I can use it in Tdarr as a decent remote transcoding node.

Intel ARK - Pentium Silver J5005 shows that the CPU has Quick Sync Video support, and as such supports some form of hardware video acceleration.

The CPU is Gemini Lake and uses Intel UHD Graphics 605, which is Gen 9.5 according to the ffmpeg wiki. The machine should be able

@estelsmith
estelsmith / intel-media-driver-gen8-9-10-perf.patch
Last active March 6, 2023 16:06
intel-media-driver specfile for almalinux 9.1
From a3abfe783f6404de18728394caed30dc8de44147 Mon Sep 17 00:00:00 2001
From: Jay Yang <[email protected]>
Date: Mon, 9 Jan 2023 14:45:39 +0800
Subject: [PATCH] [Media Common] SW swizzling regression fix for Gen8/9/10
Signed-off-by: Jay Yang <[email protected]>
Add sw swizzling sku for Gen8/9/10, without which there will be perf
drop because mos_gem_bo_map_unsynchronized is called.
---
@estelsmith
estelsmith / intel-gmmlib.spec
Last active March 5, 2023 23:26
intel-gmmlib specfile for almalinux 9.1
%undefine __cmake_in_source_build
Name: intel-gmmlib
Version: 22.3.3
Release: 1%{?dist}
Summary: Intel Graphics Memory Management Library
License: MIT and BSD
URL: https://github.com/intel/gmmlib
Source0: %{url}/archive/%{name}-%{version}.tar.gz
@estelsmith
estelsmith / libva.spec
Last active March 6, 2023 22:59
libva specfile for almalinux 9.1
Name: libva
Version: 2.17.0
Release: 1%{?dist}
Summary: Video Acceleration (VA) API for Linux
License: MIT
URL: https://github.com/intel/libva
Source0: %{url}/releases/download/%{version}/%{name}-%{version}.tar.bz2
BuildRequires: libtool
@estelsmith
estelsmith / index.js
Created February 16, 2023 21:02
Airtable Scripting - Conditionally update records based on view
let config = input.config({
title: 'Test Script',
description: 'Updates Name & Email fields on Test records to have a generic default if they are empty.',
items: []
});
let table = base.getTable('Test');
let view = table.getView('Empty Name or Email');
let result = await view.selectRecordsAsync({
@estelsmith
estelsmith / index.js
Created February 16, 2023 21:00
Airtable Scripting - Google Natural Language Classification Test
let config = input.config({
title: 'Natural Language Classification',
description: 'Example of using Google Natural Language REST API to classify text.',
items: []
});
let apiKey = 'REDACTED'; // Provide your own API key here.
let endpoints = {
classifyText: 'https://language.googleapis.com/v1/documents:classifyText'
}
@estelsmith
estelsmith / index.js
Last active March 8, 2021 16:44
List card URLs in Trello
(() => {
const origin = window.location.origin;
const report = [];
const ignoreLists = ['Recently Released', 'Complete'];
const board = document.getElementById('board');
const lists = board.querySelectorAll('.list');
const boardName = document.querySelector('.board-header-btn-text').textContent;
@estelsmith
estelsmith / dom-router.js
Last active September 14, 2024 17:58
Stupid simple DOM-router
(function (body) {
window.util = window.util || {};
window.util.DomRouter = Object.freeze({
ENTRY_COMMON: '_common',
FUNC_INIT: 'init',
FUNC_FINISH: 'finish',
execute: function (namespace, controllerName, actionName) {
const controller = namespace[controllerName];
if (controller === undefined) return;
@estelsmith
estelsmith / README.md
Last active July 4, 2022 13:57
Attempting to do name-based FTP proxying with Traefik

This is an attempt at using TLS-SNI to provide name-based routing to independent FTP servers.

Currently it fails because, while Traefik connects to the FTP server and passes data, TLS is terminated in Traefik and the FTP server requests TLS again using 421 TLS is required, confusing the client because it's already made a TLS connection.

Not requiring TLS on the FTP server causes data-transfer connections to fail when receiving the PASV command, because the FTP server expects an unencrypted data connection, whereas the client thinks it's connected via TLS and attempts to use TLS for both the control and data connections.

Attempting to switch from TLS-termination to TLS-passthrough in Traefik results in the FTP server failing because it wasn't expecting TLS to already be set up. FTP has protocol-specific requirements for upgrading from a plaintext to TLS connection.