Check These Out
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
Just realized how needless the 'ls' has been...
This version is also multilingual, since there is no need to grep for a special key word ("nothing"/"nichts"/"rien"/"nada"...). And it makes use of all the available horizontal space.
Have netcat listen on port 8000, point browser to http://localhost:8000/ and you see the information sent. netcat terminates as soon as your browser disconnects.
I tested this command on my Fedora box but linuxrawkstar pointed out that he needs to use
$ nc -l -p 8000
instead. This depends on the netcat version you use. The additional '-p' is required by GNU netcat that for example is used by Debian but not by the OpenBSD netcat port used by my Fedora system.
Allows you to establish a tunnel (encapsulate packets) to your (Server B) remote server IP from your local host (Server A).
On Server B you can then connect to port 2001 which will forward all packets (encapsulated) to port 22 on Server A.
-- www.fir3net.com --
lists files and folders in a folder with summary.
To replace foo by bar, but not execute, do ^foo^bar^:p
To replace all foo by bar, but not execute, do ^foo^bar^:&:p
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"
}
Handy if you want to quickly generate a self-signed certificate. Also can be used in your automated scripts for generating quick-use certificates.
swap out "80" for your port of interest. Can use port number or named ports e.g. "http"