A collection of tiny but helpful shell scripts for personal use. Tested with current Ubuntu. 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/master/bootstrap | sh
Reproducible shell examples.
~ ( 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.
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.
Execute command in the foreground and show desktop notification after completion.
Execute command in the background and show desktop notification in case of error.
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()
.
Start a new instance of texstudio with a .txss
session file found in the current directory.
Copies its argument to the clipboard.
GitHub Pages in a separate directory. Allows efficiently maintaining and synchronizing the contents of the gh-pages
branch in a subdirectory of the main branch. Supports subcommands init
, repair
(in case you want to undo init
, works only before pushing), merge
and checkout
.
Use ghpsd init
for creating an empty gh-pages
subdirectory that will hold the contents of your gh-pages
branch. After adding to this subdirectory, use ghpsd merge
for updating the gh-pages
branch. Note that you still have to push
to GitHub.
It works by cloning a copy of the repo into a shadow subdirectory named .gh-pages
(which is added to .gitignore
, too); this makes updating the gh-pages
branch work seamless. Call ghpsd checkout
to recreate the hidden .gh-pages
folder, this clones locally and does not require network access.
You can also add the call ghpsd merge
to your commit hook.
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
.
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.
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)
Exits with 0 if and only if the connection is configured as an unmetered connection.
Connects to remote machines and shows the top 5 processes by CPU consumption.
Executes a script and e-mails the status and output to the current user after completion.
Convert a video to an animated GIF.
Parallel make
, uses number of CPU cores as number of jobs.
Execute command until success, with increasing time intervals between failures.
Echoes each of its parameters on a single line.
Creates a new mail in Thunderbird with attachments (given as parameters).
A simple wrapper around xpra attach
, useful to integrate xpra with GNU Screen.
Repeat a command (default: make
) as soon as the contents of the current working directory change.
encfs
command with support for relative paths.
Indent current clipboard contents by four spaces and copy back to clipboard, the latter script places two hashes in front.
Executes an R script in a way that its contents and output are formatted as strict Markdown.
Start multi-monitor output on an Optimus card, using bumblebee. Needs tweaking to adapt to your screen setup.
Copyright 2015-2019 Kirill Müller.