Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AI Scripts

Small scripts written with an AI for my own machine, shared as they are.

Each does one thing, asks before it destroys anything, and is written to be read: the comment block at the top of every file explains why the code does what it does. That block is also the --help output, so the documentation cannot drift out of sync with the code.

Full write-ups with worked examples: weblio.no/ai-scripts

Not maintained

These are published as-is. I will not be fixing bugs, answering issues or shipping new versions.

That is fine, because you do not need me. Download the file, open it in Claude, ChatGPT or any other AI, and ask for what you want: "add a date to the filename", "swap zstd for gzip", "make it write to two disks". Everything is heavily commented precisely so an AI, or you, can read it and understand what is going on. That is how these were written in the first place.

Fork it and make it yours.

The scripts

Backup and restore

backuptousb Packs folders onto an external disk as one compressed archive per folder. Solves the problem where 50,000 small files crawl at 2 MB/s on a disk that can do 100+, because each file costs an open/write/close round-trip. Progress bar with ETA, skips node_modules and .git, and an interrupted run never destroys the archive you already had (it writes to .partial and renames only on success).
extracttodisk Unpacks the archives again. Before writing anything it reads the archive index, compares it against what is on disk, and shows you exactly which existing files would be overwritten. Then you choose: overwrite, extract to a fresh folder, or skip. Non-interactive runs always take the safe option.

Both copy themselves next to the data on every run, so a backup disk always carries the tool that restores it.

cd ~
./backuptousb myproject/ notes.txt     # one archive per source
./extracttodisk myproject.tar.zst      # unpack it again
./backuptousb -h                       # full documentation

Boot media

isotousb.sh Writes an ISO to a USB stick the way Etcher does: raw byte copy, forced flush, then a read-back that byte-compares against the source. That last step is what catches dying or counterfeit sticks, and it is exactly what plain dd skips. Lists removable/USB disks only, so the system disk is never offered. Requires you to type the disk size to confirm. Detects Windows ISOs and hands those to WoeUSB, and reports whether the ISO carries a signed Secure Boot shim.
sudo ./isotousb.sh path/to/image.iso

This erases an entire disk. There is no undo. Read the file before you run it.

Browser

dom-debug-collector.user.js Tampermonkey userscript. Alt-click the elements that look wrong, press one key, and the whole CSS context lands on your clipboard as Markdown: computed styles, which rules matched and from which stylesheet, plus the ancestors above. Paste it into an AI chat instead of describing a layout bug in words. Ctrl+Shift+D / F / G dump 1 / 5 / 12 levels. MIT licensed.

Requirements

Bash scripts: Linux, bash, tar, and zstd (or switch to gzip in the config block). No installation, no dependencies beyond what a Linux machine already has, nothing running in the background.

Userscript: Tampermonkey in Firefox or Chrome.

Before you run any of this

These scripts write to disk. Read the file, or ask an AI to explain it, before running anything you downloaded from the internet, from here or anywhere else. The comments tell you which safety rails exist and why, so you can see what is safe to change and what is there for a reason.

Licence

dom-debug-collector.user.js is MIT (see the header in the file). The bash scripts are free to use, modify and share with no conditions attached.

About

Small Linux and browser scripts written with an AI. Backup to USB, safe restore, ISO to bootable USB, and a DOM/CSS collector for pasting into AI chats. Unmaintained by design: fork it and let an AI adapt it.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages