Most common Bitcoin-cli command line

bitcoin-cli getinfo
bitcoin-cli getbalance
bitcoin-cli getaddressesbyaccount “”
bitcoin-cli getnewaddress “”

bitcoin-cli sendfrom “erhverv.1” 1HE66xiaq5ooMADMfRfCXBZApqcW5ZurC5 0.00063

bitcoin-cli listaccounts 0
bitcoin-cli listunspent
bitcoin-cli listtransactions
bitcoin-cli listtransactions “erhverv.1”
bitcoin-cli listreceivedbyaddress “”
bitcoin-cli listreceivedbyaccount


bitcoin-cli setaccount 13JLyiRoArrq9QMcpVCur7J8X53P6dcA2u “e-Wallet”


wget -q -O-; echo

bitcoin-cli getblockcount

bitcoin-cli -regtest stop
sudo pkill -9 -f bitcoind
bitcoind &

systemctl stop rpcbind.socket
systemctl stop rpcbind.service
systemctl disable rpcbind.service

Bitcoin – How to Build Raw Transaction

Step 1)



Lets check list of unspent using with his address.



What we see here is the results that assigned 50 and 10 mBTC to our address…. To spend this output we will create a new transaction.

Step 2)


We need to choose some blocks with sufficient amount from the result of listunspent. Since we only need to send 0.02500000 mBTC I think the first block has the enough amount to make the transaction.


To pay the fee, we will reduce the change output by 0.5 millibits as you can see below.



The createrawtransaction command produces a raw hex string that encodes the transaction details we supplied. If you want to decode the hex just use decoderawtransaction command.

Step 3)


signs the transaction in the serialized transaction format using private keys stored in the wallet or provided in the call.




Now the signrawtransaction command returns another hex-encoded raw transaction.

Step 4)


RPC validates a transaction and broadcasts it to the peer-to-peer network.




Installing Bitcoin Core on Ubuntu

This tutorial will show you how to install bitcoin core on Ubuntu.

Let’s start

** Add repository and install bitcoind **

sudo apt-get update

sudo apt-get install software-properties-common python-software-properties -y

sudo apt-get install build-essential -y

sudo apt-get install libtool autotools-dev autoconf -y

sudo apt-get install libssl-dev -y

sudo apt-get install libboost-all-dev -y

sudo add-apt-repository ppa:bitcoin/bitcoin

sudo apt-get update

sudo apt-get install bitcoind -y

mkdir ~/.bitcoin/ && cd ~/.bitcoin/

sudo apt-get install nano

nano bitcoind.conf

** Add config to bitcoin.conf file **


** Start bitcoind **

bitcoind &

** Test bitcoind is running and working **

bitcoin-cli getinfo

Centos – Argument list too long

If you have in directory more than 1024 files and you wish to delete them all at once, for sure you got error message “Argument list too long”.
e.g. you did:


To solve this problem, pipe the names of files one by one to rm command like this:

It should be easy and still effective solution for you.

PHP Database Class

PHP Classes and Objects

Install Composer on CentOS

First you have to go to the /tmp directory

load the composer.phar file

Move it to /usr/local/bin/

Now you can to use the command composer globally.

How to get instance in PHP

Install OpenVZ on Centos 6

Postfix’s email queue

1- Postfix maintains two queues, the pending mails queue, and the deferred mail queue,
the differed mail queue has the mail that has soft-fail and should be retried (Temporary failure),
Postfix retries the deferred queue on set intervals (configurable, and by default 5 minutes)

In any case, the following commands should be useful

1- Display a list of queued mail, deferred and pending


To save the output to a text file you can run


the above commands display all queued messages (Not the message itself but the sender and recipients and ID), The ID is particularly useful if you want to inspect the message itself.

2- View message (contents, header and body) in Postfix queue

Assuming the message has the ID XXXXXXX (you can see the ID form the QUEUE)

Or to save it in a file

3- Tell Postfix to process the Queue now


4- Delete queued mail

Delete all queued mail

Delete differed mail queue messages

(The ones the system intends to retry later)

Delete from queue selectively

To delete from the queue all emails that have a certain address in them, we can use this program (perl script)…

NOTE: This perl script seems to be free, and is all over the internet, i could not find out where it originates or who wrote it.

1- Download this file, unzip, and upload the file to your server, then from your bash command line, Change Directory to wherever you uploaded this file, for example cd /root (Just an example, You can upload it wherever you wish)

NOTE: A second script here works differently, i have not yet tested it, download it here

Now, from within that directory, execute…

Any mail that has this email address in it’s IN or OUT list will be deleted