{"id":14069409,"url":"https://github.com/krlmlr/scriptlets","last_synced_at":"2025-04-15T12:31:44.608Z","repository":{"id":10102685,"uuid":"12165824","full_name":"krlmlr/scriptlets","owner":"krlmlr","description":"A collection of tiny but helpful shell scripts and config files for personal use. Tested on Ubuntu","archived":false,"fork":false,"pushed_at":"2025-04-15T05:16:34.000Z","size":308,"stargazers_count":13,"open_issues_count":4,"forks_count":4,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-15T06:25:37.319Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/krlmlr.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,"zenodo":null}},"created_at":"2013-08-16T18:57:46.000Z","updated_at":"2025-04-15T05:16:37.000Z","dependencies_parsed_at":"2025-04-05T10:36:11.222Z","dependency_job_id":null,"html_url":"https://github.com/krlmlr/scriptlets","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/krlmlr%2Fscriptlets","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krlmlr%2Fscriptlets/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krlmlr%2Fscriptlets/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krlmlr%2Fscriptlets/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/krlmlr","download_url":"https://codeload.github.com/krlmlr/scriptlets/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249072277,"owners_count":21208153,"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-13T07:06:55.996Z","updated_at":"2025-04-15T12:31:44.593Z","avatar_url":"https://github.com/krlmlr.png","language":"Shell","funding_links":[],"categories":["Shell"],"sub_categories":[],"readme":"# scriptlets\n\nA collection of tiny but helpful shell scripts for personal use.\nTested with current Ubuntu and macOS.\nLicensed under [GPL v3](http://www.gnu.org/copyleft/gpl.html).\n\nTo install all scripts to `~/bin` (by creating symbolic links), clone the project and type `make`. Or run the [`bootstrap`](bootstrap) script:\n\n```sh\ncurl -s https://raw.githubusercontent.com/krlmlr/scriptlets/main/bootstrap | sh\n```\n\n# Actively used tools\n\n## Notifications\n\n### n\n\nExecute command in the foreground and show desktop notification after completion.\nCurrently macOS only.\n\n### bkg\n\nExecute command in the background and show desktop notification *in case of error*.\nCurrently macOS only.\n\n## h and s\n\nIterate over all worktrees under the current Git repository and execute a command in each of them.\nWith `h`, the command is executed directly.\nThe `s` command prepends `git`, it is a wrapper around `h git` .\nSupported switches:\n\n- `-i` or `--interactive`: run the command in interactive mode, turn off parallel propcessing (with aliases `hi` and `si`)\n- `-p` or `--paged`: show the output of the command in a pager (with aliases `hp` and `sp`)\n- `-n` or `--dry-run`: show the command that would be executed, but do not execute it\n- `-x` or `--log-commands`: also log the commands that are executed\n\n`gita` both does too much and not enough, let's see how far I can get with home-grown scripts.\n\n`g` is a simple forwarder to `git`.\n\nFIXME: Integrate with `inside` and `every`\n\n## rh\n\nStart RStudio with an `.Rproj` project file found in the current directory.\nIf no project file is found, it is created using `usethis::use_rstudio()`.\n\n## fsed\n\nRun `gsed` on files in subdirectories.\n\n## git-mmv\n\nAllows you to write `git mmv` to move several Git-controlled files at once, with the usual `mmv` syntax.\n\n## git-merge-into\n\nMerges the current branch into another branch without altering the current working copy.\n\n## pmake\n\nParallel `make`, uses number of CPU cores as number of jobs.\n\n## retry\n\nExecute command until success, with increasing time intervals between failures.\n\n## cgrep\n\nColorful `egrep` .\n\n## pdfcat\n\nConcatenate multiple PDF files into a single document.\n\n## git-bubble\n\nHow far can the most recent commit be pushed back up in the history without introducing merge conflicts?\n\nFIXME: Add option to run code (check for semantic conflicts).\n\n## soffice-macos\n\nLaunch LibreOffice/OpenOffice on macOS with proper environment setup.\n\n## k\n\nA simple forwarder to `kubectl`.\n\n# To be reviewed\n\n## Run commands in subdirectories\n\n### inside\n\nExecute command inside a subdirectory, given as first argument.\n\n### every\n\nTreat each line of the standard input as subdirectory to execute command in (via `inside`).\n\n### each\n\nLike `every`, but in parallel.\n\n### everyfile\n\nExecute command in each subdirectory (via `inside`).\nFIXME: Currently assumes that the current directory only has subdirectories, not files.\n\n### eachfile\n\nLike `everyfile`, but in parallel.\n\n## gh-mirror\n\nMirrors GitHub issues in a subdirectory of `.git` for offline use. A low-tech wrapper for `wget`.\n\n## git-backup\n\nTracks the files that Git does *not* track in a shadow Git repository.\n\n## git-backup-all\n\nTreat a whole tree of Git repositories with `git-backup`.\n\n## git-merge-update\n\nSimplifies maintenance of \"development\" branches that contain several feature/bugfix branches.\n\n## git-rsync\n\nAllows repeated Git-less synchronization with remote locations via `rsync`.\n\n## imgdiff and imgdiff-bg\n\nCompare two images side by side and show differences in a middle pane. Requires ImageMagick. The `-bg` script exits immediately. Usage: `git difftool -x imgdiff-bg -y \u003cimage files\u003e`. ([Source](http://www.akikoskinen.info/image-diffs-with-git))\n\n## machine-load\n\nConnects to remote machines and shows the top 5 processes by CPU consumption.\n\n## ogv-to-gif\n\nConvert a video to an animated GIF.\n\n## slecho\n\nEchoes each of its parameters on a single line.\n\n## rpt\n\nRepeat a command (default: `make`) as soon as the contents of the current working directory change.\n\n## reprex\n\nReproducible shell examples.\n\nFIXME: This is likely better solved with `script` .\n\n```sh\n~ ( echo \"echo a\"; echo \"echo b\" ) | reprex\necho a\necho b\n# a\n# b\n```\n\nStep by step:\n\n1. Type `reprex` on the shell.\n\n2. Type `echo a` \u003center\u003e on the shell.\n\n3. Output:\n\n    ```sh\n    echo a\n    # a\n    ```\n\n4. Type `echo b` \u003center\u003e on the shell.\n\n5. Output:\n\n    ```sh\n    echo b\n    # b\n    ```\n\n6. Type \u003cCtrl + D\u003e on the shell.\n\nNot perfect, but a start.\n\n## Azure utilities\n\n### azure-resource-group-get-default\n\nGet the default Azure resource group.\n\n### azure-vm-deallocate\n\nDeallocate an Azure VM, freeing up compute resources.\n\n### azure-vm-set-size\n\nSet the size (instance type) of an Azure VM.\n\n### azure-vm-start\n\nStart a stopped or deallocated Azure VM.\n\n## git-config-parent\n\nConfigure Git to look for settings in parent directories.\n\n## git-join-repos\n\nJoin multiple Git repositories into one while preserving history.\n\n# Obsolete\n\nIn the [`obsolete`](obsolete) directory.\n\n\n\nCopyright 2015-2025 Kirill Müller.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkrlmlr%2Fscriptlets","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkrlmlr%2Fscriptlets","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkrlmlr%2Fscriptlets/lists"}