Skip to content

Instantly share code, notes, and snippets.

View tomesparon's full-sized avatar

Tom Esparon tomesparon

View GitHub Profile
@tomesparon
tomesparon / usbcopy
Created October 8, 2025 15:31
robocopy off of
# Define the volume label of the USB drive
$targetLabel = "cyc"
$destinationRoot = "\\FSERVER\Archive\test" # Replace with your actual network share path
# Change filter to *.dcm if these are DICOM files
$fileFilter = "*.raw"
# Find the USB volume by label (DriveType 2 = Removable)
$usbDrive = Get-CimInstance Win32_Volume |
Where-Object { $_.Label -eq $targetLabel -and $_.DriveType -eq 2 } |
@tomesparon
tomesparon / move_to_folder.bat
Created October 8, 2025 11:44
A batch script to take in .raw files and put in folders with Initial and Surname - For CT raw - can be modified for other files with a name convention similar
@echo off
setlocal EnableExtensions EnableDelayedExpansion
cls
@pushd %~dp0
REM HOW TO USE: Either drag and drop the folder eg CRAFT onto bat and let it run, or
REM open in powershell / cmd and add the full path as first arg
REM Optional argument: source folder. Defaults to current folder.
set "SRC=%~1"
@tomesparon
tomesparon / monolithic.sh
Created September 19, 2025 08:50
RC FILES
# ~/.inputrc
"\e[A": history-search-backward
"\e[B": history-search-forward
# ~/.bashrc
# some more ls aliases
alias ll='ls -alF'
@tomesparon
tomesparon / clicknext.js
Last active December 20, 2024 10:55
bookmarklet clicker
javascript:!function(){let e=parseInt(prompt("Enter the desired page number:"));if(!isNaN(e)&&e>0){let t=0,n=function(){t<e-1&&(document.getElementById("NextPage_websys_CustomTypeItem_List").click(),t++,setTimeout(n,100))};n()}else alert("Invalid page number.")}();
@tomesparon
tomesparon / in console js
Created December 17, 2024 16:24
Click next on a page with nextpages
// Function to click the "Next" button
function clickNextPage() {
var nextButton = document.getElementById("nextpage"); // Adjust this to match the actual ID or method to find the button
if (nextButton) {
nextButton.click();
} else {
console.log("Next button not found");
}
}
@tomesparon
tomesparon / use in ISE
Created December 17, 2024 16:06
Auto clicker
# Add necessary types for mouse events
Add-Type @"
using System;
using System.Runtime.InteropServices;
public class Mouse {
[DllImport("user32.dll", CharSet = CharSet.Auto, CallingConvention = CallingConvention.StdCall)]
public static extern void mouse_event(long dwFlags, long dx, long dy, long cButtons, long dwExtraInfo);
public const int MOUSEEVENTF_LEFTDOWN = 0x02;
public const int MOUSEEVENTF_LEFTUP = 0x04;
}
@tomesparon
tomesparon / docx-specific-reg.reg
Created November 20, 2024 15:25
Add Windows context menu to convert MS Word (docx) to Markdown file to
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\SOFTWARE\Classes\SystemFileAssociations\.docx]
[HKEY_CURRENT_USER\SOFTWARE\Classes\SystemFileAssociations\.docx\shell]
[HKEY_CURRENT_USER\SOFTWARE\Classes\SystemFileAssociations\.docx\shell\Pandoc]
@=hex(2):50,00,61,00,6e,00,64,00,6f,00,63,00,20,00,74,00,6f,00,20,00,4d,00,44,\
00,00,00
"Icon"=hex(2):43,00,3a,00,5c,00,50,00,72,00,6f,00,67,00,72,00,61,00,6d,00,20,\
@tomesparon
tomesparon / readme.md
Created November 6, 2024 14:31
CLI Tools I Use ( Windows / Linux )
  • oh-my-bash
  • oh-my-posh
  • fzf
@tomesparon
tomesparon / readme.md
Created November 6, 2024 14:13
Software I Use (windows)
  • scoop.sh - Best package manager

List from scoop list

Name Version
7tt
7zip 24.08
audacity 3.6.4
#!/bin/bash
iatest=$(expr index "$-" i)
#######################################################
# SOURCED ALIAS'S AND SCRIPTS BY zachbrowne.me
#######################################################
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc