Check These Out
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
Rotates log files with "gz"-extension in a directory for 7 days and enumerates the number in file name.
i.e.: logfile.1.gz > logfile.2.gz
I needed this line due to the limitations on AIX Unix systems which do not ship with the rename command.
Outputs contents of virtual hosts containing PATTERN. Particularly useful for pefrorming complex searches. E.g. search for docroot of www.example.com:
$ sed -n '/^[^#]*
generating self signed ssl certificate to use in dovecot postfix nginx
Self signed certificates can be used for private encryptions between server and client and must be manually accepted on browser/ client
or "Execute a command with a timeout"
Run a command in background, sleep 10 seconds, kill it.
$! is the process id of the most recently executed background command.
You can test it with:
find /& sleep10; kill $!
If you use 'tail -f foo.txt' and it becomes temporarily moved/deleted (ie: log rolls over) then tail will not pick up on the new foo.txt and simply waits with no output.
'tail -F' allows you to follow the file by it's name, rather than a descriptor. If foo.txt disappears, tail will wait until the filename appears again and then continues tailing.
Replace 'csv_file.csv' with your filename.
Unsetting HISTFILE avoid getting current session history list saved.
you could save the code between if and fi to a shell script named smiley.sh with the first argument as and then do a smiley.sh to see if the command succeeded. a bit needless but who cares ;)
Trace python statement execution and syscalls invoked during that simultaneously