3 ms·
I routinely turn any task I need to do more than three times into a script that automates it. I've published a couple of these, like - This pair of scripts fo
by yellowapple 2y ago
I routinely turn any task I need to do more than three times into a script that automates it. I've published a couple of these, like
- This pair of scripts for starting an RDP session with a resolution matching the size of the current window (from back when I was using herbstluftwm): https://gist.github.com/YellowApple/6e6134b7493485aa3e56f2556506b1d2 https://gist.github.com/YellowApple/6e6134b7493485aa3e56f255...
- This script for running Windows programs in a specified Proton-managed Wine prefix (though nowadays there are better tools for this): https://gist.github.com/YellowApple/8f91daf000153195e643e8d721e734d0 https://gist.github.com/YellowApple/8f91daf000153195e643e8d7...
- This script that populates ID3 tags for MP3 files I've downloaded (via youtube-dl or yt-dlp or whatever) based on their filenames and folder structure (so that I can easily play what I want from a USB stick plugged into my truck's head unit): https://gist.github.com/YellowApple/7b9cc54cf6fbc20bf79cf2408b7f550d https://gist.github.com/YellowApple/7b9cc54cf6fbc20bf79cf240...
but a lot of them I've never gotten around to uploading, and most are buried away on old machines (or backups thereof) or lost forever on employer-owned machines that got presumably wiped after I left.
This post did, however, inspire me to go back through some of those backups and look through some of those scripts. Some results after a few minutes of spelunking and reminiscing:
- A couple Perl scripts that would convert hex digits into eight-dot Braille characters (to represent a fictional country's number system, back when I was actively roleplaying on NationStates.org as a teenager)
- A trio of Perl scripts to turn CSVs into SQL insert/update/upsert statements (possibly related to the time I accidentally blew away some of a prior employer's production data; we couldn't bring down the whole DB to do a normal SQL Server restore, so instead I pulled up the CSV dumps of the relevant table (for our ETL pipeline) and used those to build the necessary inserts/updates to restore what got deleted)
- A one-liner `tr '\r' '\n' < $1 > $2` called "mac2unix" because I was trying to import a CSV into SQLite for some analysis but the sender created it on a Mac and of course the default spreadsheet app still uses lone carriage returns for linebreaks like it's nineteen-eighty-fucking-nine
- Another one-liner `exec xdg-open "$@"` called "open" (don't remember why; maybe because people kept sending me shell scripts written on Macs?)
- A whole bunch of other little scripts to populate toolbars from my herbstluftwm-using days
- A bunch of scripts to generate ZPL code to print various labels on Zebra thermal printers