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
Using this command you can track a moment when usb device was attached.
Display commands and their arguments as they are executed. Useful for debugging shell scripts.
THIS COMMAND IS DESTRUCTIVE. That said, lets assume you want to render your boot drive unbootable and reboot your machine. Maybe you want it to boot off the network and kickstart from a boot server for a fresh OS install. Replace /dev/fd0 with the device name of your boot drive and this DESTRUCTIVE command will render your drive unbootable. Your BIOS boot priority should be set to boot from HD first, then LAN.
outputs a history of logins on the server (top 10, when piped to 'head'); optional flags: '-a' put the hostname at the end of the line (good for long hostnames), '-i' post the IP instead of the hostname, '-F' put the full login and logout times, rather than short times.
If you give tar a list of filenames, it will not add the directories, so if you don't care about directory ownership or permissions, you can save some space.
Tar will create directories as necessary when extracting.
This command is limited by the maximum supported size of the argument list, so if you are trying to tar up the whole OS for instance, you may just get "Argument list too long".
Display recursive file list (newest file displayed at the end) and be free to access last file in the list simply by pressing arrow_up_key i.e. open it with joe editor.
BTW IMHO the list of files with newest files at the end is often more informative.
Put this 'lsa' function somewhere in your .bashrc and issue
$ . ~/.bashrc
or
$ source ~/.bashrc
to have access to the 'lsa' command immediately.
.
(the function appends command "joe last_file_in_the_list" at the end of command history)
I've seen a lot of overly complicated attempts at figuring out "where am I?"
I think this is a part of the problem:
type -a pwd
force the use of the binary version of `pwd` instead of the built-in with "/bin/pwd -P"
-P option provides an absolute path to the present working directory
for the overly cautious type:
$(which pwd) -P
Use this command if you want your terminal commands be saved in your history file in real time instead of waiting until the terminal is closed