Check These Out
Tested on FreeBSD 8.1 and CSH. The scripts works correctly but the Zombies do not die! I hope it will run and function as expected in Linux and others.
Dialog's gauge widget accepts progress updates on stdin. This version runs dialog once and updates it every second.
There's no need to use timeout which causes screen flicker since it restarts dialog for each update.
Converts any number of seconds into days, hours, minutes and seconds.
sec2dhms() {
declare -i SS="$1"
D=$(( SS / 86400 ))
H=$(( SS % 86400 / 3600 ))
M=$(( SS % 3600 / 60 ))
S=$(( SS % 60 ))
[ "$D" -gt 0 ] && echo -n "${D}:"
[ "$H" -gt 0 ] && printf "%02g:" "$H"
printf "%02g:%02g\n" "$M" "$S"
}
Works with *rooted* Android devices. 400x800 are the screen dimensions of a typical handheld smartphone.
This is probably overkill, but I have some issues when the directories have spaces in their names.
The
$ find . -type d -print0 | while read -d $'\0' dir; do xxx; done
loops over all the subdirectories in this place, ignoring the white spaces (to some extend).
$ cd "$dir"; echo " process $dir"; cd -;
goes to the directory and back. It also prints some info to check the progress.
$ find . -maxdepth 1 -name "*.ogg.mp3" -exec rename 's/.ogg.mp3/.mp3/' {} \;
renames the file within the current directory.
The whole should work with directories and file names that include white spaces.
Based on capsule8 agent examples, not rigorously tested
To allow a program ("programmaautorizzato" in example) to listen through the firewall
You might want to secure your AWS operations requiring to use a MFA token. But then to use API or tools, you need to pass credentials generated with a MFA token.
This commands asks you for the MFA code and retrieves these credentials using AWS Cli. To print the exports, you can use:
`awk '{ print "export AWS_ACCESS_KEY_ID=\"" $1 "\"\n" "export AWS_SECRET_ACCESS_KEY=\"" $2 "\"\n" "export AWS_SESSION_TOKEN=\"" $3 "\"" }'`
You must adapt the command line to include:
* $MFA_IDis ARN of the virtual MFA or serial number of the physical one
* TTL for the credentials
In my case it was actually like this...