Skip to content

Instantly share code, notes, and snippets.

View tomesparon's full-sized avatar

Tom Esparon tomesparon

View GitHub Profile
@tomesparon
tomesparon / install_zellij.sh
Created May 29, 2026 10:43 — forked from BaksiLi/install_zellij.sh
Install Zellij (latest release) on Linux (incl. Ubuntu) and Darwin
#!/bin/bash
# Get the architecture of the machine
arch=$(uname -m)
os=$(uname -s)
# Download the Zellij binary
if [ "$os" == "Darwin" ]; then
filename="zellij-${arch}-apple-darwin.tar.gz"
url="https://github.com/zellij-org/zellij/releases/latest/download/$filename"
@tomesparon
tomesparon / guide.md
Last active May 27, 2026 15:55
Debian TTY / Minimal on Macbook Air 2015 - Broadcom Wifi setup

For future me and others with this issue of setting up wifi on this locked down system.

Basically the linux doesnt really play nicely with the drivers and are often in disabled state on install. Sometimes it grabs the wrong driver too for this.

The only workaround I found to work is to first use a 'USB TETHERING' device (eg your android phone) and then connect to ethernet that way.

There is another layer of complexity if doing it from commandline. This is outlined below:

Commands assume that you have sbin in your PATH var. And probably doing it all in root user (su -)

@tomesparon
tomesparon / readme_itksnap_wsl2.md
Last active May 15, 2026 12:44 — forked from pangyuteng/readme.md
itksnap wsl2

ITK-SNAP in WSL2 ubuntu24.04

  • download itksnap, unzip tar at ~
tar -xvf xxx.tar.gz
  • add bin folder to PATH in .bashrc
# ██████╗ ███████╗███╗ ███╗ ██████╗ ██╗ ██╗███████╗ ██╗ ██╗██████╗
# ██╔══██╗██╔════╝████╗ ████║██╔═══██╗██║ ██║██╔════╝ ██║ ██║██╔══██╗
# ██████╔╝█████╗ ██╔████╔██║██║ ██║██║ ██║█████╗ ███████║██████╔╝
# ██╔══██╗██╔══╝ ██║╚██╔╝██║██║ ██║╚██╗ ██╔╝██╔══╝ ██╔══██║██╔═══╝
# ██║ ██║███████╗██║ ╚═╝ ██║╚██████╔╝ ╚████╔╝ ███████╗ ██║ ██║██║
# ╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝ ╚═════╝ ╚═══╝ ╚══════╝ ╚═╝ ╚═╝╚═╝
#
# ██████╗ ██╗ ██████╗ █████╗ ████████╗██╗ ██╗ █████╗ ██████╗ ███████╗
# ██╔══██╗██║ ██╔═══██╗██╔══██╗╚══██╔══╝██║ ██║██╔══██╗██╔══██╗██╔════╝
# ██████╔╝██║ ██║ ██║███████║ ██║ ██║ █╗ ██║███████║██████╔╝█████╗
@tomesparon
tomesparon / vmbackup.sh
Created March 11, 2026 16:31
KVM backup script - #libvirt #virtnbdbackup
#!/usr/bin/env bash
# Tom Esparon - 2026
# KVM backup operations cycle for active/running kvm machines(only).
#
# Backup captures:-
# File-backed disks: virtnbdbackup (stream) with lz4 compression
# LVM-backed disks (/dev/...): live lvm based snapshot -> pv -> xz -> file (once per month)
# VM XML config : saved with xmldump for LVM-backed VMs, virtnbdbackup handles file-backed VMs
#
# The first backup of every vm on every new month is forced to be full size,
@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");
}
}