{"id":13567649,"url":"https://github.com/monking/shell-utilities","last_synced_at":"2025-04-04T02:32:29.024Z","repository":{"id":145936252,"uuid":"230822159","full_name":"monking/shell-utilities","owner":"monking","description":"A few shell scripts budded off from my own dotfiles repo.","archived":false,"fork":false,"pushed_at":"2024-11-04T20:23:37.000Z","size":129,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-11-04T21:27:58.333Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/monking.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-12-30T00:50:50.000Z","updated_at":"2024-11-04T20:23:41.000Z","dependencies_parsed_at":"2023-06-26T01:45:53.540Z","dependency_job_id":"8af57654-533c-4f55-b855-256cf3046280","html_url":"https://github.com/monking/shell-utilities","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monking%2Fshell-utilities","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monking%2Fshell-utilities/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monking%2Fshell-utilities/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monking%2Fshell-utilities/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/monking","download_url":"https://codeload.github.com/monking/shell-utilities/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223083018,"owners_count":17084801,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T13:02:37.799Z","updated_at":"2025-04-04T02:32:29.009Z","avatar_url":"https://github.com/monking.png","language":"Shell","funding_links":[],"categories":["Shell"],"sub_categories":[],"readme":"# shell-utilities\n\nThese are extracts from my homespun scripts which I've prepared for general use\nby anyone.\n\n- [`canon`](./canon): recursively resolve any symlinks to get the \"canonical\" path\n- [`date-week`](./date-week): Wrapper for GNU date which parses ISO Week dates (e.g. '2025W023').\n- [`git-branch-grep`](./git-branch-grep): grep branches, returns the best match, or gives feedback when it fails\n- [`git-todo`](./git-todo): search for _new_ notes in source code (compared with a \"main\" git branch)\n- [`sumdir`](./sumdir) \u0026 [`checkdir`](./checkdir): generate \u0026 verify hashes for files, with good defaults (uses `.SUM*` files)\n- [`tree-tab`](./tree-tab): transform [`tree`](https://oldmanprogrammer.net/source.php?dir=projects/tree) output to tab-indented list\n- [`youtube-playlist-sync`](./youtube-playlist-sync): Mirror a YouTube playlist as a `.m3u8` file, using `yt-dlp` (or `youtube-dl`)\n\n…and more [outdated scripts](#outdated-scripts-sunsetting)\n\n## `sumdir`+`checkdir`\n\nCall `sumdir` to calculate hash/checksum values for files in a directory.  \nThen call `checkdir` in that same directory to verify files, and list changed/mismatched files.\n\nNOTE: The output of `sumdir` is also intended to be generic, so that you can use other commands besides `checkdir` to verify the sums files (sha256sum/shasum/b2sum/…). The relevant command is included in a comment at the top of the output file's contents, for the user's future reference.\n\n### sumdir\n\n```\nUSAGE: sumdir [OPTIONS] [PATH...]\nPURPOSE: Coordinates the generation and output of many checksums.\n\nOPTIONS:\n  -h,--help,help\n      Show this help\n  \n  -a CMD\n      Hashing algorithm to use. Currently supported: 'sha256', 'b2'. env: SUMDIR_ALGORITHM.\n  \n  -r                \n      into directory. env: SUMDIR_SHOULD_RECURSE\n  \n  -L                \n      symlinks. env: SUMDIR_SHOULD_DEREFERENCE\n  \n  -1,--single\n      Remove existing *SUM* SUMFILEs in this directory (trash-cli, falls back to rm). Only this directory, even with -r. env: SUMDIR_SHOULD_SINGLE_HASH_FILE\n  \n  -o,--out TEMPLATE\n      Output file name template. See 'TEMPLATES' below for substitution patterns. env: SUMDIR_OUTPUT_FILE_TEMPLATE\n  \n  -l                \n      hostname and PWD in output SUMFILE. Affected by -L. env: SUMDIR_SHOULD_INCLUDE_LOCATION_IN_OUTPUT\n  \n  -z,--tz TZ\n      Set timezone for timestamp; default 'UTC'. env: SUMDIR_TIMEZONE\n  \n  -f,--dateformat\n      Set format for timestamp (per GNU coreutils date). env: SUMDIR_DATE_FORMAT\n  \n  -v,--verbose[=N]  \n      the detail of the info output to STDERR. env: SUMDIR_VERBOSE\n  \n  -x,--exclude PATTERN\n      Exclude files by name, per find '! -name PATTERN'. env: SUMDIR_LIST_EXCLUDE_NAME\n  \n  -X,--exclude-path PATTERN\n      Exclude files by name, per find '! -path PATTERN'; usually of form '*PATTERN*'. env: SUMDIR_LIST_EXCLUDE_PATH\n  \n  --length N        \n      length in bits (b2sum only). Digests appear 1/4 this length in hexadecimal.\n                      Default and maximum is 512 (for an output 128 chars long).\n                      This is the same as setting the env var SUMDIR_LIST_B2_OPTS='--length:N'.\n       env: SUMDIR_LIST_%A_OPTS, where %A is the algorithm in upper case (SHA256 or B2).\n  --\n      After this, all further arguments are passed to 'find'\n  \n  --bk\n      Same as -f '%d..%ASUM'\n  \n  --version\n      Output version information\n\nDESCRIPTION:\n  If no PATH is specified, the current directory ($PWD) is used.\n  \n  If no SUMFILE is specified, .*SUM* and *SUM* is globbed, and the newest one is used.\n  \n  TEMPLATES\n   The following strings are substituted for dynamic values:\n   '%d' or '{}'  =\u003e  Datetime as formatted by -f\n   '%a'  =\u003e  Algorithm ('sha256', 'b2', …)\n   '%A'  =\u003e  Algorithm uppercase ('SHA256', 'B2', …)\n   \n  \n  ENVIRONMENT VARIABLES\n   *_SHOULD_* options expect 'true' or 'false' values.\n   *_LIST_* options must be colon-separated like PATH.\n  \n   You may set any of the options above by using the following environment variables.\n   They are shown here with their default values, if available.\n   SUMDIR_ALGORITHM='sha256'\n   SUMDIR_DATE_FORMAT='+%Y%m%dT%H%M%SZ'\n   SUMDIR_LIST_EXCLUDE_NAME='.DS_Store:.thumbnails'\n   SUMDIR_LIST_EXCLUDE_PATH='*/.git/*:*/node_modules/*'\n   SUMDIR_LIST_B2_OPTS\n   SUMDIR_LIST_SHA_OPTS\n   SUMDIR_OUTPUT_FILE_TEMPLATE='.SUM%A--%d'\n   SUMDIR_SHOULD_DEREFERENCE='false'\n   SUMDIR_SHOULD_INCLUDE_LOCATION_IN_OUTPUT='false'\n   SUMDIR_SHOULD_RECURSE='false'\n   SUMDIR_SHOULD_SINGLE_HASH_FILE='false'\n   SUMDIR_TIMEZONE='UTC'\n   SUMDIR_VERBOSE='0'\n\nEXAMPLES:\n  $ sumdir -r -o ./externalDrive-%d /mnt/externalDrive\n    # Sum files from a different location, and save output in the current directory.\n```\n\u003csmall\u003e^ output from `sumdir --help` from v0.1.7 2024-12-26\u003c/small\u003e\n\n### checkdir\n\n```\nUSAGE: checkdir [OPTIONS] [SUMFILE…]\n\nOPTIONS:\n  --help|help|-h  Show this help.\n  --version       Show the script version.\n  -a ALG          Set encryption algorithm.\n  -e              Only check if files in SUMFILE exist, and output missing filenames.\n  -l              Only output the SUMFILE path found/selected.\n  -v              Show more verbose output.\n\nDESCRIPTION:\n  If no SUMFILE is specified, .*SHA256SUM* and *SHA256SUM* is globbed in the current directory, and the newest one is used.\n```\n\u003csmall\u003e^ output from `checkdir --help` from v0.1.1 2024-12-26\u003c/small\u003e\n\n## outdated scripts (sunsetting)\n\nSome scripts may be retired from this collection **if** (any of these):\n- they're not maintained\n- their use case is better served by a better utility\n- they tend to have undefined behavior\n- they have uncommon dependencies\n\nThe following scripts will be removed (sometime after 2024) if they won't be missed:\n- [`git-bundle-helper`](./git-bundle-helper): a somewhat outdated helper to create git bundles, and optionally encrypt them with `bcrypt` (the outdated part).\n- [`make-it-manifest`](./make-it-manifest): generate a list of all files in a directory, optionally with MD5 sums and Git commit hashes\n- [`web-search`](./web-search): search a few preset sites using the `lynx` command-line browser\n\t- `duck` -\u003e `web-search`: Search duckduckgo.com\n\t- `etym` -\u003e `web-search`: Search etymonline.com\n\t- `goog` -\u003e `web-search`: Search google.com\n\t- `wiki` -\u003e `web-search`: Search en.wikipedia.org\n- [`yt`](./yt): stream or download using `yt-dlp` (or `youtube-dl`)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmonking%2Fshell-utilities","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmonking%2Fshell-utilities","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmonking%2Fshell-utilities/lists"}