Skip to content

Instantly share code, notes, and snippets.

View alirobe's full-sized avatar

Ali Robertson alirobe

View GitHub Profile
@alirobe
alirobe / reclaimWindows10.ps1
Last active February 5, 2026 21:28
This Windows 10 Setup Script turns off a bunch of unnecessary Windows 10 telemetery, bloatware, & privacy things. Not guaranteed to catch everything. Review and tweak before running. Reboot after running. Scripts for reversing are included and commented. Fork of https://github.com/Disassembler0/Win10-Initial-Setup-Script (different defaults). N.…
###
###
### UPDATE: For Win 11, I recommend using this tool in place of this script:
### https://christitus.com/windows-tool/
### https://github.com/ChrisTitusTech/winutil
### https://www.youtube.com/watch?v=6UQZ5oQg8XA
### iwr -useb https://christitus.com/win | iex
###
### OR take a look at
### https://github.com/HotCakeX/Harden-Windows-Security
@alirobe
alirobe / channel-list.js
Created October 18, 2025 00:19
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 / 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 / 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 / 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 / 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 / PostToUrlAsJson.cs
Last active March 25, 2024 14:41
Umbraco Forms Workflow - POST to URL as JSON (with optional Bearer Access Token). Just place this file anywhere in your Umbraco+Forms project, and the dependency injection will pick it up. This will allow you to connect to Microsoft Flow or Zapier or any integration web service, from which you can send to Salesforce/Dynamics/etc.
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Dynamic;
using System.Net;
using System.Text.RegularExpressions;
using Umbraco.Core.Logging;
using Umbraco.Forms.Core;
using Umbraco.Forms.Core.Attributes;
@alirobe
alirobe / setupWindowsServer2016.ps1
Created September 15, 2017 07:37
setupWindowsServer2016.ps1
##########
# Tweaked Win10 Initial Setup Script
# Primary Author: Disassembler <disassembler@dasm.cz>
# Modified by: alirobe <alirobe@alirobe.com> based on my personal preferences.
# Version: 2.6.1, 2017-08-02
# Primary Author Source: https://github.com/Disassembler0/Win10-Initial-Setup-Script
# Tweaked Source: https://gist.github.com/alirobe/7f3b34ad89a159e6daa1/
# Tweak difference:
#
# @alirobe's version is a subset focused on safely disabling telemetry, 'smart' features, and 3rd party bloat ...
@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
{