Check These Out
Useful when you've produced a large file of numbers, and want to quickly see the distribution. The value of y halfway along the x axis is the median. Simple!
Just create the listOfNumbers.txt file with a number on each line to try it out.
'data' is the directory to backup, 'backup' is directory to store snapshots.
Backup files on a regular basis using hard links. Very efficient, quick. Backup data is directly available.
Same as explained here :
http://blog.interlinked.org/tutorials/rsync_time_machine.html
in one line.
Using du to check the size of your backups, the first backup counts for all the space, and other backups only files that have changed.
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
parrallel execution of a command on remote host by ssh or rsh or ...
very useful for cluster management (software update)
Shows all block devices in a tree with descruptions of what they are.
Tuned for short command line - you can set the path to sessionstore.js more reliable instead of use asterixes etc.
Usable when you are not at home and really need to get your actual opened tabs on your home computer (via SSH). I am using it from my work if I forgot to bookmark some new interesting webpage, which I have visited at home. Also other way to list tabs when your firefox has crashed (restoring of tabs doesn't work always).
This script includes also tabs which has been closed short time before.
Send microphone audio to another computer using netcat and arecord.
Connect to the stream using "nc [other ip] 3333|aplay"
You can set up two-way communication by piping audio the reverse direction on another port:
Machine #1:
$arecord -D hw:0,0 -f S16_LE -c2|nc -l 3333 &;nc -l 3334|aplay
Machine #2:
$$ip=[machine1_ip];arecord -D hw:0,0 -f S16_LE -c2|nc $ip 3334 &;nc $ip 3333|aplay
You have a script where =ALL= STDERR should be redirected to STDIN and you don't want to add "2>&1" at the end of each command...
E.G.:
$ ls -al /foo/bar 2>&1
Than just add this piece of code at the beginning of your script!
I hope this can help someone. :)