Check These Out
Just a simple way without the need of additional tools. Of course, replace eth0 with your IF.
Directly attach a remote screen session (saves a useless parent bash process)
The output format is given by the -printf parameter:
%T@ = modify time in seconds since Jan. 1, 1970, 00:00 GMT, with fractional part. Mandatory, hidden in the end.
%TY-%Tm-%Td %TH:%TM:%.2TS = modify time as YYYY-MM-DD HH:MM:SS. Optional.
%p = file path
Refer to http://linux.die.net/man/1/find for more about -printf formatting.
------------------------
sort -nr = sort numerically and reverse (higher values - most recent timestamp - first)
head -n 5 = get only 5 first lines (change 5 to whatever you want)
cut -f2- -d" " = trim first field (timestamp, used only for sorting)
------------------------
Very useful for building scripts for detecting malicious files upload and malware injections.
This command generates a pseudo-random data stream using aes-256-ctr with a seed set by /dev/urandom. Redirect to a block device for secure data scrambling.
Removes all unversioned files and folders from an svn repository. Also:
$ svn status --no-ignore | grep ^I | awk '{print $2}' | xargs rm -rf
will remove those files which svn status ignores. Handy to add to a script which is in your path so you can run it from any repository (a la 'svn_clean.sh').
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 version uses read instead of eval.
the middle command between the ; and ; is the vi commands that insert that line into the last line of the file, the esc with the carets is literally hitting the escape key, you have to have the smbfs package installed to do it, I use it to access my iTunes music on my mac from my linux PC's with amarok so I can play the music anywhere in the house. among other things, it allows you to access the files on that share from your computer anytime you're on that network.
That should be a short as it can get.