~dricottone/my-utils

ref: 598fcd5f3c9242b5f38809c982c7ca9045c33857 my-utils/README.md -rw-r--r-- 2.9 KiB
598fcd5fDominic Ricottone Added wg*, fw*, docker*, android*, pactl*, vimsplit; Update to enumerate 4 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# my-utils

A set of scripts that I use frequently. Written in a mix of shell (some POSIX sh, some bash), sed, awk, and so on. Any dependencies *beyond* the POSIX standard and inter-dependency are noted.



## Scripts

Executable |Description                                                   |Extra Dependencies
:----------|:-------------------------------------------------------------|:------------------------------------------
check-x    |Check if an X11 server is running
ctdir      |Count entries in a target directory(ies)
debom      |Remove BOM from a target file                                 |`bash`
enumerate  |Dumps HTML from an 'epub' e-book archive                      |`bash`, `zipinfo`, `unzip`, `w3m`
epub       |Rename files in current directory into sequential numbers     |`bash`
mkbak      |Create a backup of a target file                              |`bash`
mktar      |Wrapper around `tar` for easier compression                   |`bash` *
rand       |Get a random number within an inclusive range                 |`shuf`
rebom      |Add BOM to a target file                                      |
rmtar      |Delete 'tar' archive files
rmzip      |Delete 'zip' archive files
stop-at    |Re-print until a pattern is matched
tarcat     |Print contents of target archive file(s)                      |*
tarls      |Print listings of target archive file(s)                      |*
unittest   |Wrapper around Python's `unittest` module                     |`python3`, GNU or New (AT&T) `awk`
untar      |Wrapper around `tar` for easier decompression                 |*
whichcat   |Print all lines from a program
whiched    |Open a program with your editor
whichhead  |Print the first 10 lines from a program                       |`bash`
whichvi    |Open a program with your visual editor
whisper    |Wrapper around `espeak` to mirror `say` in macOS              |`espeak`
wttr       |Wrapper around `wttr` to fix double-wide runes for some fonts |`wego`

\* *While you **technically** won't run into an error, these scripts **do** expect `tar` to support Zstandard, which isn't necessarily POSIX standard.*

*All* scripts support `-h` and `--help` for printing built-in documentation.

*Almost all* scripts do nothing if no input arguments are given. (The exceptions are `whisper` and `wttr`.)



## Development

These being re-used scripts, there's been a great deal of feature creep, bikeshedding, and over-engineering. That is to say, there's a lot of uncertainty as to how *reliable* these scripts are. To mitigate these concerns, `shellcheck` is a development dependency. A test suite is in the making, and hopefully new entrants to this repository will come with tests.



## License

If you really want to use anything in this repository-and I need to stress *if you really want to*-just go right ahead. I'm licensing everything under GPL because I'd appreciate you letting me know I messed something up. But you *really* shouldn't try using anything here in production...