Check These Out
This works in Mac OS X (10.6.2) (natively comes with curl)
usage: currency_convert $1(amount) $2(from_denomination) $3(to_denomination)
This works in combination with http://www.commandlinefu.com/commands/view/10496/identify-exported-sonames-in-a-path as it reports the NEEDED entries present in the files within a given path. You can then compare it with the libraries that are exported to make sure that, when cross-building a firmware image, you're not bringing in dependencies from the build host.
The short version of it as can be seen in the same output is
$ scanelf -RBnq -F "+n#f" $1 | tr ',' '\n' | sort -u
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
Sorts by latest modified files by looking to current directory and all subdirectories
If you omit the function name, the command will display all definitions
Nothing fancy, just a regular filesystem scan that calls the badblocks program and shows some progress info. The used options are:
-c ? check for bad sectors with badblocks program
-D ? optimize directories if possible
-f ? force check, even if filesystem seems clean
-t ? print timing stats (use -tt for more)
-y ? assume answer ?yes? to all questions
-C 0 ? print progress info to stdout
/dev/sdxx ? the partition to check, (e.g. /dev/sda1 for first partition on first hard disk)
NOTE: Never run fsck on a mounted partition!
Converts any number of seconds into days, hours, minutes and seconds.
sec2dhms() {
declare -i SS="$1"
D=$(( SS / 86400 ))
H=$(( SS % 86400 / 3600 ))
M=$(( SS % 3600 / 60 ))
S=$(( SS % 60 ))
[ "$D" -gt 0 ] && echo -n "${D}:"
[ "$H" -gt 0 ] && printf "%02g:" "$H"
printf "%02g:%02g\n" "$M" "$S"
}
Find recursively all files in ~/Notes with the extension '.md' and pipe that via xargs to rename command, which will replace every '.md' to '.txt' in this example (existing files will not be overwritten).
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