Check These Out
(only when vim has been compiled with +clipboard)
A bitcoin "brainwallet" is a secret passphrase you carry in the "wallet" of your brain.
The Bitcoin Brainwallet Private Key Calculator calculates the standard base58 encoded bitcoin private key from your "brainwallet" passphrase.
The private key is the most important bitcoin number. All other numbers can be derived from it.
This command uses 3 other functions - all 3 are defined on my user page:
1) brainwallet_exponent() - search for Bitcoin Brainwallet Exponent Calculator
2) brainwallet_checksum() - search for Bitcoin Brainwallet Exponent Calculator
3) b58encode() - search for Bitcoin Brainwallet Base58 Encoder
Do make sure you use really strong, unpredictable passphrases (30+ characters)!
http:brainwallet.org can be used to check the accuracy of this calculator.
A common mistake in Bash is to write command-line where there's command a reading a file and whose result is redirected to that file.
It can be easily avoided because of :
1) warnings "-bash: file.txt: cannot overwrite existing file"
2) options (often "-i") that let the command directly modify the file
but I like to have that small function that does the trick by waiting for the first command to end before trying to write into the file.
Lots of things could probably done in a better way, if you know one...
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"
}
or
echo '127.0.0.1 facebook.com' | sudo tee -a /etc/hosts
Do not execute this command if you don't know what you are doing.
A similar command that lists only the currently running VMs is thus:
$ VBoxManage list runningvms
...the above showing a list of VMs by name and UUID in the same format as the "$ VBoxManage list vms" command
Find if $b is in $a in bash