Check These Out
The command first deletes any old playlist calles playlist.tmp under /tmp. After that it recursively searches all direcotries under ~/mp3 and stores the result in /tmp/playlist.tmp. After havin created the playlist, the command will execute mplayer which will shuffle through the playlist.
This command is aliased to
m is aliased to `rm -rf /tmp/playlist.tmp && find ~/mp3 -name *.mp3 > /tmp/playlist.tmp && mplayer -playlist /tmp/playlist.tmp -shuffle -loop 0 | grep Playing'
in my ~/.bashrc.
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
Negative shell globs already come with bash. Make sure to turn on extended pattern matching with 'shopt -e extglob'.
works in /bin/bash
Show all commands having the part known by you.
Eg:
$apropos pdf | less
Need output in mbps (bits)
# ./bytes-second.sh eth0
eth0 interface maximum Speed: 1000Mb/s
RX:12883212 TX:17402002 B/s | RX:98 TX:132 Mb/s
RX:12371647 TX:17830111 B/s | RX:94 TX:136 Mb/s
RX:12502750 TX:17860915 B/s | RX:95 TX:136 Mb/s
If you frequently need to connect to your ubersecure mainframe from various uberunsafe machines, you have to face difficult decision: (a) type the password everytime during the session (lame), (b) add local public key to mainframes authorized_keys file (unsafe), (c) as above, but remove this key at the end of the session (pain in the a55). So let's say you save The Command to tempauth file in bin directory of your mainframe's account and make it executable. Then, while you're on one of these unsafe ones, do:
$ cat $HOME/.ssh/id_rsa.pub|ssh 5z474n@mainframe.nl bin/tempauth 30
and password prompts stop the harassment for 30 minutes and you don't have to care to remove the unsafe key after that.