Last active
April 18, 2024 12:04
-
-
Save ThinGuy/fea6a6f66e8c51a40c5322f3b4c560e8 to your computer and use it in GitHub Desktop.
Read a list of commands then make it look like you're typing in terminal, Use with termtosvg. asciinema, etc.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
[[ -f ~/script.cmds ]] || { printf "\nMissing $HOME/script.cmds. Exiting\n";exit 1; } | |
dprompt() { [[ $HOME = $(pwd) ]] && { local DIR='~'; } || { local DIR=$(pwd); };printf "\e[01;32m$USER@${HOSTNAME}\e[0m:\e[01;34m${DIR}\e[0m$ ";};export -f dprompt | |
clear | |
declare -ag DCMDS=() | |
export DCMD_CNT=${#DCMDS[@]} | |
while IFS= read -er C;do DCMDS+=("${C%;$*}");done < <(cat script.cmds) | |
export DCMD_CNT=${#DCMDS[@]} | |
for D in "${DCMDS[@]}";do dprompt;echo "${D}"|pv -qL 10;bash -c "${D}";done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
canonical-livepatch status | |
canonical-livepatch status --verbose | |
canonical-livepatch status --verbose|awk '/fixes/,/tier:/{if (/CVE/) print;next}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment