Check These Out
$ sleep 1h ; sudo command
or
$ sudo sleep 1h ; sudo command
won't work, because by the time the delay is up, sudo will want your password again.
You got some results in two variables within your shell script and would like to find the differences? Changes in process lists, reworked file contents, ... . No need to write to temporary files. You can use all the diff parameters you'll need. Maybe anything like $ grep "^>"
is helpful afterwards.
Repeat command after every 2 secs
You'll be notified if your core 1 temperature exceeds 50 degrees, you can change the monitored device by editing the "Core 1" or change the critical temperature by editing the "-gt 50" part.
Note: you must have lm-sensors installed and configured in order to get this command working.
The last ; is important. example:
time { rm -rf /folder/bar && mkdir -p /folder/bar ; echo "done" ; }
command is a bash builtin
This command has been used to overwrite corrupted "entries" files of a corrupted subversion working copy.
Note the --files-from input format.
inputfile.txt is a space-separated textfile, 1st column contains the items (id) I want to put into my SQL statement.
39 = charactercode for single tick '
$1 = first column
If inputfile.txt is a CSV-file separated by "," use FS= to define your own field-separator:
$ awk 'BEGIN {FS=","; }{printf "select * from table where id = %c%s%c;\n",39,$1,39; }' inputfile.txt
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
easier way to recursively change files to lowercase using rename instead