Dangerous helpers

Opt-in: destructive helpers. Each one shows targets and asks for a phrase.

Enable only for maintenance: ALIASX_ENABLE="dangerous"

Not loaded by default. Enable: export ALIASX_ENABLE="dangerous"

General

NameRunsWhat it does
confirm PROMPT PHRASEtrue only if user types PHRASE
example
$ confirm 'Wipe cache?' WIPE && rm -r cache
Wipe cache? Type WIPE to continue: WIPE

Docker

NameRunsWhat it does
docker-rm-stoppedremove all exited containers
example
$ docker-rm-stopped
CONTAINER ID  STATUS
9a1b...       Exited (0)
Remove every stopped container? Type REMOVE-STOPPED to continue:
docker-prune-allremove all unused data including images
example
$ docker-prune-all
Remove all unused Docker data, including images? Type PRUNE-DOCKER to continue:

Databases

NameRunsWhat it does
redis-flushdelete every key in the current Redis database
example
$ redis-flush
(integer) 1520
Delete every key in this Redis database? Type FLUSH-REDIS to continue:
pg-dropdb DBdrop a PostgreSQL database (type its name to confirm)
example
$ pg-dropdb shop_copy
Drop database shop_copy permanently? Type shop_copy to continue: