Check These Out
Replace 'csv_file.csv' with your filename.
There are some environments that use this value for password and account expiration. It's helpful to be able to quickly determine the number of days since the Unix epoch (dse) when working directly with the configuration files as an administrator.
use to execute a block of code only if $var is numeric
List files above a given size threshold.
swap out "80" for your port of interest. Can use port number or named ports e.g. "http"
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
This function runs a program in the background, and logs all output to an automatically created logfile. That way, you can still get at the output without it clogging up your terminal.
Tip:
Throw fork() and this:
$for prog in firefox kate konqueror ;do alias $prog="fork $prog";done
into your bashrc, so that they'll automatically run out of the way.
I love this function because it tells me everything I want to know about files, more than stat, more than ls. It's very useful and infinitely expandable.
$ find $PWD -maxdepth 1 -printf '%.5m %10M %#9u:%-9g %#5U:%-5G [%AD | %TD | %CD] [%Y] %p\n' | sort -rgbS 50%
00761 drwxrw---x askapache:askapache 777:666 [06/10/10 | 06/10/10 | 06/10/10] [d] /web/cg/tmp
The key is:
# -printf '%.5m %10M %#9u:%-9g %#5U:%-5G [%AD | %TD | %CD] [%Y] %p\n'
which believe it or not took me hundreds of tweaking before I was happy with the output.
You can easily use this within a function to do whatever you want.. This simple function works recursively if you call it with -r as an argument, and sorts by file permissions.
$ lsl(){ O="-maxdepth 1";sed -n '/-r/!Q1'