scripts

My personal collection of scripts
git clone git://src.gearsix.net/scripts
Log | Files | Refs | Atom | README | LICENSE

commit 677e0b48f3eae061996bc64d516cab48c03b97f3
parent 5d3ed94ed550c21f58636b1845704717af112689
Author: gearsix <gearsix@tuta.io>
Date:   Fri, 26 Aug 2022 10:56:39 +0100

updated doc

Diffstat:
MCOPYING | 2+-
MREADME.md | 65++++++++++++++++++++++++++++++++++++-----------------------------
2 files changed, 37 insertions(+), 30 deletions(-)

diff --git a/COPYING b/COPYING @@ -1,5 +1,5 @@ MIT License -Copyright (c) 2020 GeaRSiX +Copyright (c) 2022 GeaRSiX Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: diff --git a/README.md b/README.md @@ -18,8 +18,11 @@ I use most of these scripts for convenience and to save on typing. More recently I've been making an effort to learn PowerShell as I tend to use windows a fair bit too, so there are a few one-off scripts used for that too. +- **nix/** - Scripts for POSIX (Unix, MacOS, Linux, etc) machines. Mostly written in `sh` and `bash`. +- **win/** - Scripts for Windows. Using `PowerShell` +- **any/** - Scripts for multiple environments (mostly `Python`). -## installing (unix only) +## ./install.sh (posix only) I've created an install script (bash) to help with selecting the scripts you want to install. @@ -40,63 +43,67 @@ I've created an install script (bash) to help with selecting the scripts you wan -h, --help print this dialog -## uninstalling - -I'm planning to add an uninstall bash script too, currently you'll have to manually delete all the files added for now though. - - ## notes I've added `-h` options to all the scripts. Personally find `grepf` and `while-true` to by the most frequently used. + ## windows (powershell) scripts - **random** - a script I use to select a random item in a directory. -- **zip27z** - converts all .zip files in current directory to .7z +- **zipto7z** - converts all .zip files in current directory to .7z. + + +## any + +- *d2h* - convert decimal numbers to hexadecimal. +- *h2d* - convert hexadecimal numbers to decimal. +- *jiggle* - move the mouse 1px every minute - keep the screen awake. + -## unix (shell) scripts +## posix scripts -Some are bash-only, I make an effort to keep to **sh** when I can though - for compatibility across unix(-like)s. +I make an effort to keep to **sh** when I can - for compatibility-sake. **strings & numbers** Scripts related to string parsing/manipulation -- *strindex* - print the index (starting from 0) of the first character in substring $1 found in string $2 -- *grepf* - find all files in dir $1, that conatin string $2. -Useful for debugging somebody else's code in a terminal. -- *randstr* - generate a random string -- *d2h* - convert decimal numbers to hexadecimal +- *strindex* - print the index (from 0..n) of the first character in substring $1 found in string $2. +- **grepf** - find all files in dir $1, that conatin string $2. I use this one a lot. +- *randstr* - generate a random string. **file management** -- *backup* - cp input files $@ from `filename` to `filename.bak` (mv with `-m`) -- *catrm* `rm -i` but with the option to cat the file +- *backup* - cp input files $@ from `filename` to `filename.bak` (mv with `-m`). +- *catrm* - `rm -i` but with the option to cat the file. - *flac2mp3* - converts .flac files $@ to .mp3. Requires ffmpeg. -- *openurl* - xdg-open all links found in files $@ -- *mkdcp* - make directory $1 and copy files into it ($2..$n) +- *openurl* - xdg-open all links found in files $@. +- *mkdcp* - make directory $1 and copy files into it ($2..$n). - *mkdmv* - make directory $1 and move files into it ($2..$n) -- *mkdnvim* - make directory $1, touch file $2 and open file $2 in nvim -- *mkdtouch* - make a directory $1, touch files in it ($2..$n) +- *mkdnvim* - make directory $1, touch file $2 and open file $2 in $EDITOR. +- *mkdtouch* - make a directory $1, touch files in it ($2..$n). **tooling** -- *pyserve* - shorthand for `python3 -m http.server --directory $1` -- *git-cfg* - shorthand for setting git config --local user.name $1 && git config --local user.email $2 +- **pyserve** - shorthand for `python3 -m http.server --directory $1`. +- *git-cfg* - shorthand for calling `git config --local user.name $1 && git config --local user.email $2`. - You can also use it for setting global config using `-g` -- *git-clone-bulk* - clone a list of git repositories -- *git-pull-all* - pull all remote branches from the current upstream -- *gobuild* - build a go module in all available output formats, useful for releases -- *preview-md* - convert a markdown file $1 to html, open if $2 == "-o" or "--open". Uses cmark by default, set conversion tool and default output destination in src. -- *compress-pdf* - compress a .pdf file $1, requires _ghostscript_ (_gs_) +- *git-clone-bulk* - clone a list of git repositories. +- *git-pull-all* - pull all remote git branches from the current upstream. +- *gobuild* - build a go module in all available output formats, useful for releases. +- *preview-md* - convert a markdown file $1 to html, open if $2 == "-o" or "--open". + - Uses cmark by default, set conversion tool and default output destination in src. +- *compress-pdf* - compress a .pdf file ($1), requires *ghostscript* (*gs*). **misc** -- *shush* - echo output of $@ to null +- *shush* - run $@ in the background and hide output. - *pomodoro* - a [pomodoro](https://en.wikipedia.org/wiki/Pomodoro_Technique) timer. -- *while-true* - clear the terminal, run $1 sleep ($2 || 1 sec), repeat forever (Ctrl+C to cancel) +- **while-true** - clear the terminal, run $1 sleep ($2 || 1 sec), repeat forever (Ctrl+C to cancel). +- *onfilech* - stat a file ($1) every 10 seconds, if the output changes, run a command ($2...$n). **depreciated**