Skip to content

Instantly share code, notes, and snippets.

View alirobe's full-sized avatar
😎

Ali Robertson alirobe

😎
View GitHub Profile
@alirobe
alirobe / README.md
Last active October 12, 2026 01:46
Fix Git Bash fork errors (0xC0000142) on Windows with Mandatory ASLR

Git Bash fork errors (0xC0000142) on Windows

dofork: child -1 - forked process 50032 died unexpectedly, retry 0, exit code 0xC0000142, errno 11
/usr/bin/bash: fork: retry: Resource temporarily unavailable

Also breaks editors and AI coding agents that run commands through Git Bash.

Cause: Windows Security > Exploit protection > Force randomization for images (Mandatory ASLR)

@alirobe
alirobe / bookmarklet.js
Last active June 4, 2026 03:15
britannica octordle fix
javascript:(function() { var style = document.createElement('style'); style.type = 'text/css'; style.innerHTML = '.normal-boards{max-width:100%!important} .normal-boards>*{width: calc(100%/9 - 5px) !important} .ad-board,.adswrapper,#body>div:not(#game){display:none!important}'; document.head.appendChild(style); })();
@alirobe
alirobe / channel-list.js
Last active October 17, 2026 15:57
Extract YouTube subscription channel metadata from channel page
// goto https://www.youtube.com/feed/channels
// set to a-z and scroll all the way down until loading ends
// run in terminal:
arr = Array.from(document.querySelectorAll('ytd-channel-renderer'))
data = []
arr.forEach((item, index) => {
data.push({
title: item.querySelector('.ytd-channel-name').innerText,
handle: item.querySelector('yt-formatted-string#subscribers').innerText,
subs: item.querySelector('#video-count').innerText,
@alirobe
alirobe / backup-dataverse-environment-solutions
Last active August 14, 2025 01:26
A quick script to download all the unmanaged solutions in a D365 environment, and extracting them to folders, suitable for backing up unmanaged solutions in source control.
# Backup Solutions from Dataverse Environment
# https://gist.github.com/alirobe/17864cb8336ea9dc3d4da61fb5d6a596
### Settings ###
$skipExisting = $false # change to $true to update
### Script ###
$solutionsList = pac solution list
$solutionsList > solutions-list.txt
$firstLine = 5 # to be changed if output from pac tool changes
@alirobe
alirobe / get-sharepoint-list-json-with-comments-from-console.js
Last active September 18, 2024 03:30
grab SharePoint list items with comments
var listUrl = "https://<TENANT>.sharepoint.com/sites/site/_api/<SITE>/lists/getByTitle('<LIST>')"
var url = `${listUrl}/items?$top=5000`;
var fetchOptions = { headers: { "Accept": "application/json;odata=nometadata" } };
var response = await fetch(url, fetchOptions);
var data = await response.json();
var items = data.value;
var commentsPromises = items.map(async item => {
var commentsUrl = `${listUrl}/items(${item.Id})/Comments()`;
var commentsResponse = await fetch(commentsUrl, fetchOptions);
if (commentsResponse.ok) {
@alirobe
alirobe / pdf-ifilter-registration.reg
Created May 8, 2024 06:59
PDF IFilter Registration
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Search\Gathering Manager\Plugins]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Search\Gathering Manager\Plugins\.pdf]
"ProgId"="AcroIFilter.AcroIFilter"
"CLSID"="{E8978DA6-047F-4E3D-9C78-CDBE46041603}"
"DefaultDisabled"=dword:00000000
@alirobe
alirobe / Convert-DocumentsToMachineReadable.ps1
Created April 12, 2023 12:44
Convert-DocumentsToMachineReadable.ps1
$popplerPath = ".\poppler\bin\pdftotext.exe"
$maxDocs = 1000
$inputPath = ".\source"
$outputPath = ".\dest"
function Convert-FilesToMarkdown {
param(
[string]$inputFolderPath,
[string]$outputFolderPath
)
@alirobe
alirobe / pnp-list-copy.ps1
Last active May 22, 2024 20:59
Copy list contents between lists in SharePoint using PnP
# authored @alirobe for @sopewebtech 2022-06-17
# pnp-list-copy.ps1 : https://gist.githubusercontent.com/alirobe/4187b0f073dc2eba5207f312a01ddab6/
# this copies list values from source to target
# before using this script, create a new list 'from existing list' in the same site
# then, plug values in below and run. should work for most field types. any issues let me know.
# todo: add batching, add field types
# licensed under GPL V2
$Site = "https://notproduction.sharepoint.com/sites/not-sproket-4/"
@alirobe
alirobe / SecureMediaController.cs
Last active November 23, 2023 02:36
Secure Media Controller for Umbraco v9 Cloud
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Core.Services;
using MimeKit;
using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.IO;
namespace UmbracoProject.Controllers
{
public class SecureMediaController : Controller
{
@alirobe
alirobe / export-umbraco-redirects-for-seochecker.sql
Last active May 19, 2022 21:10
How to Migrate Umbraco Redirects into SEOChecker
SELECT replace(umbracoRedirectUrl.url, '1075/', '') as url
,umbracoNode.id
,umbracoRedirectUrl.contentKey
FROM umbracoRedirectUrl
INNER JOIN umbracoNode on umbracoRedirectUrl.contentKey = umbracoNode.uniqueID
# Run in SSMS, right click results and export to CSV. Import CSV to SEOChecker.
# NB replace 1075 with your root node ID