A collection of tiny but helpful shell scripts and configuration files for personal use. Tested with current Ubuntu and macOS. Licensed under GPL v3.
To install all scripts to ~/bin
(by creating symbolic links), clone the project and type make
. Or run the bootstrap
script:
curl -s https://raw.githubusercontent.com/krlmlr/scriptlets/main/bootstrap | sh
Execute command in the foreground and show desktop notification after completion. Currently macOS only.
Execute command in the background and show desktop notification in case of error. Currently macOS only.
Iterate over all worktrees under the current Git repository and execute a command in each of them.
With h
, the command is executed directly.
The s
command prepends git
, it is a wrapper around h git
.
Supported switches:
-i
or--interactive
: run the command in interactive mode, turn off parallel propcessing (with aliaseshi
andsi
)-p
or--paged
: show the output of the command in a pager (with aliaseshp
andsp
)-n
or--dry-run
: show the command that would be executed, but do not execute it-x
or--log-commands
: also log the commands that are executed
gita
both does too much and not enough, let's see how far I can get with home-grown scripts.
g
is a simple forwarder to git
.
FIXME: Integrate with inside
and every
Start RStudio with an .Rproj
project file found in the current directory.
If no project file is found, it is created using usethis::use_rstudio()
.
Run gsed
on files in subdirectories.
Run air format
on a single file if the containing Git repository has an air.toml
file.
Useful as a formatter in the RStudio IDE.
Allows you to write git mmv
to move several Git-controlled files at once, with the usual mmv
syntax.
Merges the current branch into another branch without altering the current working copy.
Parallel make
, uses number of CPU cores as number of jobs.
Execute command until success, with increasing time intervals between failures.
Colorful egrep
.
Concatenate multiple PDF files into a single document.
How far can the most recent commit be pushed back up in the history without introducing merge conflicts?
FIXME: Add option to run code (check for semantic conflicts).
Launch LibreOffice/OpenOffice on macOS with proper environment setup.
A simple forwarder to kubectl
.
Execute command inside a subdirectory, given as first argument.
Treat each line of the standard input as subdirectory to execute command in (via inside
).
Like every
, but in parallel.
Execute command in each subdirectory (via inside
).
FIXME: Currently assumes that the current directory only has subdirectories, not files.
Like everyfile
, but in parallel.
Mirrors GitHub issues in a subdirectory of .git
for offline use. A low-tech wrapper for wget
.
Tracks the files that Git does not track in a shadow Git repository.
Treat a whole tree of Git repositories with git-backup
.
Simplifies maintenance of "development" branches that contain several feature/bugfix branches.
Allows repeated Git-less synchronization with remote locations via rsync
.
Compare 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 <image files>
. (Source)
Connects to remote machines and shows the top 5 processes by CPU consumption.
Convert a video to an animated GIF.
Echoes each of its parameters on a single line.
Repeat a command (default: make
) as soon as the contents of the current working directory change.
Reproducible shell examples.
FIXME: This is likely better solved with script
.
~ ( echo "echo a"; echo "echo b" ) | reprex
echo a
echo b
# a
# b
Step by step:
-
Type
reprex
on the shell. -
Type
echo a
on the shell. -
Output:
echo a # a
-
Type
echo b
on the shell. -
Output:
echo b # b
-
Type <Ctrl + D> on the shell.
Not perfect, but a start.
Get the default Azure resource group.
Deallocate an Azure VM, freeing up compute resources.
Set the size (instance type) of an Azure VM.
Start a stopped or deallocated Azure VM.
Configure Git to look for settings in parent directories.
Join multiple Git repositories into one while preserving history.
In the obsolete
directory.
Copyright 2015-2025 Kirill Müller.