Small shell helpers for an interactive session: pu (listening ports), gfp (git fetch && git pull, optional args go to git pull only), retry (re-run a command until it exits 0), and shacks-update (git pull --ff-only in SHACKS_REPO—this clone). You either set that directory once or let bash/zsh infer it when you source the snippet.
Clone the repo (use any directory you like instead of ~/src/shacks; keep the path consistent with the lines you add to your shell config):
git clone https://github.com/KodzghlyCZ/shacks.git ~/src/shacksThen add to ~/.bashrc or ~/.zshrc (adjust the path to match your clone):
SHACKS_REPO=$HOME/src/shacks
. "$SHACKS_REPO/shacks"$HOME/... avoids surprises with ~ inside variables.
Or skip the variable and source the file by path; bash and zsh will set SHACKS_REPO to this repo’s root automatically:
. $HOME/src/shacks/shacksMinimal POSIX shells that do not expose the sourced file’s path should use the two-line block with SHACKS_REPO set first.
Reload your shell (exec bash -l, exec zsh -l, or a new terminal) so this runs once per session.
Use an interactive shell so shacks-update (an alias) is expanded; pu, gfp, and retry are functions and follow the same expectation for a normal login session.
When you open a new shell and shacks is sourced, it starts a background git fetch so your prompt is not delayed; if your clone is behind its upstream, a warning is printed to stderr whenever that fetch finishes (often right after your prompt appears). That still needs network on those logins. To turn it off, export SHACKS_SKIP_UPDATE_CHECK=1 before sourcing, or change the default at the top of the shacks file from :-0 to :-1 in your copy.
After loading shacks, apply updates with:
shacks-updateThat uses the SHACKS_REPO from your session (see install above).
Note: If shacks-update fails or aliases are not available, pull from your clone manually with git -C /path/to/shacks pull --ff-only (use your real clone path instead of /path/to/shacks).
Ideas and improvements are welcome. If you are comfortable with git and shell snippets, open a pull request (or merge request, depending on where you host a fork) with your change and a short note on what it does and why.
If you do not write code or prefer not to touch the repo, that is fine too—open an issue instead. Describe the idea, pain point, or alias you wish you had; someone can pick it up or discuss it there.
pu:sudo,lsof,awk.gfp:git. Runs in whatever directory you are in (not limited toSHACKS_REPO). If you use Oh My Zsh with thegitplugin instead, there is no singlegfpalias, butgfa(git fetch --all) plusgl(git pull) is close; see the git plugin README. Plaingit pullalready fetches the upstream for the current branch, sogfpis for when you want an explicitfetchfirst (same defaults asgit fetchwith no args).retry:sleep(and a shell with functions — bash or zsh is enough). Usage:retry [-n max] [-s delay] command [args...]. Omit-n(or use-n 0) for unlimited tries;-sdefaults to 1 second between attempts. Use--if the command starts with-.shacks-update:gitand a clone withorigin(normal aftergit clone).