Check These Out
ry4an@four:~$ echo $SHLVL
1
ry4an@four:~$ ${0/-/}
ry4an@four:~$ echo $SHLVL
2
"What it actually shows is going to be dependent on the commands you've previously entered.
When you do this, bash looks for the last command that you entered that contains the substring "ls", in my case that was "lsof ...". If the command that bash finds is what you're looking for, just hit Enter to execute it. You can also edit the command to suit your current needs before executing it (use the left and right arrow keys to move through it).
If you're looking for a different command, hit Ctrl+R again to find a matching command further back in the command history. You can also continue to type a longer substring to refine the search, since searching is incremental.
Note that the substring you enter is searched for throughout the command, not just at the beginning of the command." - http://www.linuxjournal.com/content/using-bash-history-more-efficiently
This is the same command as this one, but for OS X.
http://www.commandlinefu.com/commands/view/3053/find-out-when-your-billion-second-anniversary-is-was.
Admittedly, I'd never have thought of this without the earlier examples, but here's one that you can execute from your workstation to just display the image from another, without separately doing a file transfer, etc. By the way, I hear a loud beep coming from the other room, so I guess it's not too stealthy :-D
This function make it easy to compute X/Y as a percentage.
The name "wpoxiy" is an acronym of "what percentage of X is Y"
From the man page.
lft ? display the route packets take to a network host/socket using one of several layer-4
protocols and methods; optionally show heuristic network information in transitu
-A Enable lookup and display of of AS (autonomous system) numbers (e.g., [1]). This option
queries one of several whois servers (see options 'C' and 'r') in order to ascertain the origin
ASN of the IP address in question. By default, LFT uses the pWhoIs service whose ASN data
tends to be more accurate and more timely than using the RADB as it is derived from the
Internet's global routing table.
-N Enable lookup and display of network or AS names (e.g., [GNTY-NETBLK-4]). This option
queries Prefix WhoIs, RIPE NCC, or the RADB (as requested). In the case of Prefix WhoIs or
RADB, the network name is displayed. In the case of RIPE NCC, the AS name is displayed.
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