heyer.systems Open Source

Shell aliases

Short commands for interactive shells – git (gitp, gitcm "…"), systemd and logs, files, Docker and iac. Override or switch them off in /etc/iac/aliases.local.conf, or share your own list across guests with aliases_url. List: aliases

aliases LXCVM

Add to a guest

In the guest as root – container and VM alike:

update --add-modules aliases

Runs a normal update and installs the module on the way.

From the Proxmox node, without logging in:

pct exec <ID> -- update --add-modules aliases   # container
ssh root@<IP> update --add-modules aliases

Choose when creating a guest

Without a dialog, on the Proxmox node:

IAC_NONINTERACTIVE=1 var_modules=auto-update,aliases \
  bash -c "$(curl -fsSL https://iac.heyer.systems/<app>/ct.sh)"

var_modules replaces the app's preselection – keep auto-update in the list if you want it. Interactive: choose “advanced” in the dialog, or tick the module in the generator on the app page.

Remove

update --remove-modules aliases

Removes the module's packages, services, firewall rules and configuration again. Data stays.

Details

Short commands for interactive shells – SSH, tmux, the terminals of a web app. iac brings a set for Git, systemd, files, Docker and iac; you override them, switch them off or add your own, per guest or for all guests at once. Scripts and coding agents do not see them.

The aliases of iac

AliasCommandAliasCommand
gitsgit statussstsystemctl status
gitpgit pushsresystemctl restart
gitplgit pullsfasystemctl --failed
gitagit addjfjournalctl -f -u
gitcmgit commit -mjljournalctl -n 100 --no-pager -u
gitcagit commit --amendllls -lah
gitdgit difflals -A
gitlgit log --oneline --graph -20.. / ...cd .. / cd ../..
gitcogit checkoutdfdf -h
gitbgit branchdu1du -h -d1
dpsdocker ps -aupupdate
dlogdocker logs -fsmokethe smoke test of the guest
dexdocker exec -it

Arguments go after the alias: gitcm "Fix the login", jf nginx.

Your own aliases

/etc/iac/aliases.local.conf is yours – iac creates it once and never changes it. One alias per line:

gitp = git push --follow-tags    # overrides the alias of iac
k    = kubectl                   # a new one
up   =                           # switches an alias of iac off

It applies in the next shell; update is not needed. aliases lists every active alias with the file it comes from, aliases --check the lines that are skipped.

The same aliases on every guest

Put your list (same format) in a file anyone with the link may read, e.g. a Git repository, and set its address – then run update:

aliases_url=https://git.example.org/me/dotfiles/raw/branch/main/aliases.conf

Every update fetches it again; when it is not reachable, the last fetched list stays. Order: the aliases of iac, then the list of aliases_url, then aliases.local.conf – the last one wins.

Safety

The files are read line by line as name = command, never run as a script, so a broken line does nothing at login. But an alias decides what a command does when you type it: whoever can change the file of aliases_url can make ll run anything as root. Use a URL only from a repository you control, over HTTPS (iac fetches nothing else).

Removing the module

update --remove-modules aliases removes the aliases of iac, the fetched list and the line in /etc/bash.bashrc; /etc/iac/aliases.local.conf stays.