Skip to content

Instantly share code, notes, and snippets.

@daweimau
daweimau / add_split_csv_command.sh
Last active September 2, 2024 05:12
Run this to get the `split_csv` command. Usage: `split_csv your_file_name.csv 3000` where `3000` is optional batch size (defaults to 2000)
mkdir -p ~/.scripts && cat << 'EOF' > ~/.scripts/csv_splitter.sh
#!/bin/bash
# Check if a filename was provided
if [ -z "$1" ]; then
echo "Usage: $0 filename.csv [maxrows]"
exit 1
fi
# Input file from argument
@daweimau
daweimau / rename_for_plex.ps1
Last active November 2, 2023 09:53
A Windows powershell script to rename many files (within subfolders)
# I recommend commenting out the `Rename-Item` line and testing, before you actually bulk rename anything
# Recurse from the active directory
Get-ChildItem '.' -Recurse | ForEach-Object {
# Don't rename folders, just files
if ($_ -is [System.IO.FileInfo]) {
# The original filepath (full path)
$oldpath = $_.FullName
This is a "privacy policy" for use in testing & development apps.
If you arrived here from an app in the real world, that is probably a mistake: please let the app developer know.