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
The keycodes are a result of pressing:
Mute (Fn+F1)
a
mogrify can be used like convert. The difference is that mogrify overwrites files:
http://www.imagemagick.org/www/mogrify.html
Of course, other source colors can be used as well.
Here is the full function (got trunctated), which is much better and works for multiple queries.
function cmdfu () {
local t=~/cmdfu;
until [[ -z $1 ]]; do
echo -e "\n# $1 {{{1" >> $t;
curl -s "commandlinefu.com/commands/matching/$1/`echo -n $1|base64`/plaintext" | sed '1,2d;s/^#.*/& {{{2/g' | tee -a $t > $t.c;
sed -i "s/^# $1 {/# $1 - `grep -c '^#' $t.c` {/" $t;
shift;
done;
vim -u /dev/null -c "set ft=sh fdm=marker fdl=1 noswf" -M $t;
rm $t $t.c
}
Searches commandlinefu for single/multiple queries and displays syntax-highlighted, folded, and numbered results in vim.
Find statistics for an Edirectory server form LDAPsearch.
We have a lot more examples at:
http://ldapwiki.willeke.com/wiki/Ldapsearch%20Examples
The full command got shut off it is:
ldapsearch -h ldapserver.willeke.com -p636 -e C:\mydata\treerootcert.der -b "" -s base -D cn=admin,ou=administration,dc=willeke,dc=com -w secretpwd "(objectclass=*)" chainings removeEntryOps referralsReturned listOps modifyRDNOps repUpdatesIn repUpdatesOut strongAuthBinds addEntryOps compareOps wholeSubtreeSearchOps modifyEntryOps searchOps errors simpleAuthBinds inOps oneLevelSearchOps inBytes abandonOps bindSecurityErrors securityErrors unAuthBinds outBytes extendedOps readOps dsaName directoryTreeName vendorVersion vendorName
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 ;)
It displays the top 10 processes sorted by memory usage
I used this to copy all PDFs recursively to a selected dir