Check These Out
Say you just typed a long command like this:
$ rsync -navupogz --delete /long/path/to/dir_a /very/long/path/to/dir_b
but you really want to sync dir_b to dir_a. Instead of rewriting all the command line, just type followed by , and your command line will read
$ rsync -navupogz --delete /very/long/path/to/dir_b /long/path/to/dir_a
It's certainly not nicely formatted SQL, but you can see the SQL in there...
This command will find all occurrences of one or more patterns in a collection of files and will delete every line matching the patterns in every file
This is one of those 'nothing' shell functions ...which I use all the time.
If the command contains spaces, it must be quoted, e.g.
$ vimcmd 'svn diff' /tmp/svndiff.out
If I want to keep the output of the command that I'm running, I use vimcmd. If I don't need to keep the output, I use this:
$ vim
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
Pipe any output to "grep ." and blank lines will not be printed.
Use mencoder to concatenate (join) multiple video files together.
This will give you the Dell Service tag number associated with your machine. Incredibly useful when you need that number for tech support or downloads.
swap out "80" for your port of interest. Can use port number or named ports e.g. "http"
Sometimes I would like to see hidden files, prefix with a period, but some files or folders I never want to see (and really wish I could just remove all together).