Commands tagged bitcoin (10)

  • Compactly display a bitcoin-cli fee estimate in satoshis/Byte, sat/B, date time stamp. Change the 6 to the desired number of confirmations. Display in btc/KB unit of measure: printf %g "$(bccli estimatesmartfee 6 "ECONOMICAL" | jq .feerate)";printf " btc/KB estimated feerate for 6 confirmations\nMultiply by 100,000 to get sat/B\n"; Two settings for estimate mode are "ECONOMICAL". "CONSERVATIVE" is the same as "UNSET" # jq is a json filter. sudo apt-get install jq Show Sample Output

    printf %g "$(bitcoin-cli estimatesmartfee 6 "ECONOMICAL" | jq .feerate*100000)";printf " sat/B estimated feerate for 6 confirmations as of $(date +%c)\nDivide by 100,000 to get btc/KB\n"
    deinerson1 · 2018-06-20 13:40:32 0

  • 1
    openssl enc -d -aes-256-cbc -a -in bitcoin-wallet-backup -out bitcoin-wallet-backup-decrypted
    UnklAdM · 2016-01-13 21:04:19 0
  • Returns the global weighted BTC rate in EUR. Requires the "jq" JSON parser. Show Sample Output

    echo "BTC rate is" $(wget -q -O - | jq ".last") "?"
    lordtoran · 2015-09-28 23:03:59 0
  • The only pre-requisite is jq (and curl, obviously). The other version used grep, but jq is much more suited to JSON parsing than that. Show Sample Output

    btc() { echo "1 BTC = $(curl -s$1.json | jq .bpi.\"$1\".rate | tr -d \"\"\") $1"; }
    benjabean1 · 2015-09-19 02:49:30 0
  • 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)! can be used to check the accuracy of this calculator. Show Sample Output

    (read -r passphrase; b58encode 80$( brainwallet_exponent "$passphrase" )$( brainwallet_checksum "$passphrase" ))
    nixnax · 2014-02-18 02:50:09 0
  • A bitcoin "brainwallet" is a secret passphrase you carry in your brain. The Bitcoin Brainwallet Private Key Base58 Encoder is the third of three functions needed to calculate a bitcoin PRIVATE key from your "brainwallet" passphrase. This base58 encoder uses the obase parameter of the amazing bc utility to convert from ASCII-hex to base58. Tech note: bc inserts line continuation backslashes, but the "read s" command automatically strips them out. I hope that one day base58 will, like base64, be added to the amazing openssl utility. Show Sample Output

    function b58encode () { local b58_lookup_table=({1..9} {A..H} {J..N} {P..Z} {a..k} {m..z}); bc<<<"obase=58;ibase=16;${1^^}"|(read -a s; for b58_index in "${s[@]}" ; do printf %s ${b58_lookup_table[ 10#"$b58_index" ]}; done); }
    nixnax · 2014-02-18 02:29:30 0
  • A bitcoin "brainwallet" is a secret passphrase you carry in your brain. The Bitcoin Brainwallet Exponent Calculator is the second of three functions needed to calculate a bitcoin PRIVATE key. Roughly, checksum is the first 8 hex digits of sha256(sha256(0x80+sha256(passphrase))) Note that this is a bash function, which means you have to type its name to invoke it Show Sample Output

    function brainwallet_checksum () { (o='openssl sha256 -binary'; p='printf';($p %b "\x80";$p %s "$1"|$o)|$o|sha256sum|cut -b1-8); }
    nixnax · 2014-02-18 02:07:02 0
  • A bitcoin "brainwallet" is a secret passphrase you carry in your brain. The Bitcoin Brainwallet Exponent Calculator is one of three functions needed to calculate the bitcoin PRIVATE key. Roughly, the formula is exponent = sha256 (passphrase) Note that this is a bash function, which means you have to type its name to invoke it. You can check the accuracy of the results here Show Sample Output

    function brainwallet_exponent () { printf %s "$1"|sha256sum|head -c 64; }
    nixnax · 2014-02-18 01:49:09 0

  • 0
    wget -q -O- |grep -o -P 'lastTrade">([0-9]{1,})(.){0,1}[0-9]{0,}' |grep -o -P '(\d)+(\.){0,1}(\d)*' |head -n 1
    peter1337 · 2014-01-25 23:40:00 0
  • Found on

    for i in `wget -O url|grep '<a rel="nofollow"'|grep http|sed 's|.*<a rel="nofollow" class="[^"]\+" href="[^"]*https\?://\([^/]\+\)[^"]*">[^<]\+</a>.*|\1|'`;do if test -n "$(whois $i|grep -i godaddy)";then echo $i uses GoDaddy;fi;sleep 20;done
    coinbitsdotcom · 2011-12-24 19:12:18 0

What's this? is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands

Check These Out

Get first Git commit hash
git log --format=%H | tail -1 doesn't work anymore

Convert CSV to JSON
Replace 'csv_file.csv' with your filename.

Share a 'screen'-session
Ater person A starts his screen-session with `screen`, person B can attach to the srceen of person A with `screen -x`. Good to know, if you need or give support from/to others.

Write comments to your history.
A null operation with the name 'comment', allowing comments to be written to HISTFILE. Prepending '#' to a command will *not* write the command to the history file, although it will be available for the current session, thus '#' is not useful for keeping track of comments past the current session.

Make changes in any profile available immediately/Change to default group
Changes your group to the default group, has the same effect as sourcing your profile/rc file (in any shell) or logging out and back in again.

awk date convert
Convert readable date/time with `date` command

Recursive chmod all files and directories within the current directory

Isolate file name from full path/find output
Quick method of isolating filenames from a full path using expansion. Much quicker than using "basename"

Resize a Terminal Window
Replace 70 with the desired height. Replace 180 with the desired width. I put it in my bashrc, because by default my terminal is too small.

Generate a random password
Another password maker, for human-unfriendly passwords. '-base64' output will make sure it it can be typed on a keyboard, though the output string length will always be a multiple of 4.

Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.


Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: