Configuring a fresh Ubuntu server

Ok, so you’ve installed Ubuntu 14.04 on a new machine. Now there are a few things you can do to make your life more comfortable after getting your OS installed, and connected to wifi (which is beyond the scope of this post).

You’ll want to first have ssh set up so you can remote in, even if your graphic driver is not configured.

ssh:

sudo apt-get install openssh-server

Give your yourself super user access by adding a line to your sudousers file. Then you won’t have to type in your password every time you use sudo.

sudo:

sudo nano /etc/sudoers

Add this line to the end of the file:

yourusername ALL=(ALL) NOPASSWD:ALL

Next, you’ll want to set up VNC, so you can put that computer in another room if you want. This way you can be in front of your favorite big monitor or TV and access your Ubuntu box. For this, you will need to install x11vnc on Ubuntu. If you are accessing from Windows, I found that the tightvnc viewer works best with x11vnc.

x11vnc:

sudo apt-get install x11vnc

Save password:

sudo x11vnc –storepasswd /etc/x11vnc.pass

Create a startup file:

sudo nano /etc/init/x11vnc.conf

Put this in your x11vnc.conf file:

start on login-session-start
script
/usr/bin/x11vnc -xkb -auth /var/run/lightdm/root/:0 -noxrecord -noxfixes -noxdamage -rfbauth /etc/x11vnc.pass -overlay -cursor -noshared -forever -bg -rfbport 5900 -o /var/log/x11vnc.log
end script

Now, you can reboot Ubuntu and x11vnc will always start up. But if you want to stop/start it manually, you can do this via ssh. This is also handy if your vnc session crashes for some reason or gets stuck.

sudo pkill -f x11vnc
sudo start x11vnc

If you don’t want to deal with sending error reports to Ubuntu by being prompted to send them, then edit this file and set enable=0

sudo nano /etc/default/apport

If you have your source code on an SVN Server:

sudo apt-get install subversion

Some useful things to attach to your tool bar:

Terminal
Software Updater
Scheduled Tasks
Startup Applications
System Monitor

Some conveniences if you like:

Settings:

Brightness and Lock:
Turn off screen when inactive for: Never

Power:
When lid is closed: Do Nothing

Appearance/Behaviour:
Enable Workspaces

Mining Decred on Ubuntu with cgminer

First create your account and worker on the pool you want to join.

If you need to install git:

sudo apt-get update
sudo apt-get install git

Download, compile, install from source code:

mkdir ~/source
cd ~/source
git clone https://github.com/decred/cgminer.git

If you need to install some extra libraries, here is what I used:

sudo apt-get install autoconf
sudo apt-get install libc-bin
sudo apt-get install libtool
sudo apt-get install libncurses-dev
sudo apt-get install curl
sudo apt-get install libcurl4-openssl-dev
sudo apt-get install opencl-headers
sudo apt-get install ocl-icd-opencl-dev

Or all together:

sudo apt-get install autoconf libc-bin libtool libncurses-dev curl libcurl4-openssl-dev opencl-headers ocl-icd-opencl-dev

At this point you should have a newly created folder “cgminer”

cd cgminer
./autogen.sh --enable-opencl
make
sudo make install

Test cgminer (hit “q” when your done testing):

/usr/local/bin/cgminer --blake256 --benchmark

Start mining:

/usr/local/bin/cgminer --blake256 --intensity d -o http://dcr.suprnova.cc:9110 -u YourPoolUser.YourPoolWorker -p YourPoolPassword -o http://dcr.pool.mn:4722 -u YourPoolUser.YourPoolWorker -p YourPoolPassword

You may want to further configure your cgminer.conf by adding/updating these settings in ~/.cgminer/cgminer.conf:

"pools" : [
        {
                "url" : "http://dcr.suprnova.cc:9110",
                "user" : "YourUserName.YourWorkerName",
                "pass" : "x"
        }
]
,
"api-allow" : "W:192.168.1.###",
"api-listen" : true,
"expiry" : "30",
"queue" : "0",
"scan-time" : "15",

To start mining on reboot, add this command to your “Startup Applications:

gnome-terminal -e '/home/reynold/bin/run_cgminer_decred' --geometry=80x40+80+40

Bug Shooting Installation and Setup

Bug Shooting Installation and Setup

Bug Shooting is and awesome screen capture and annotation utility. You can get a free license for personal use:

http://www.bugshooting.com/

Download
Then get free license

You will need Microsoft .NET Framework 4.5.2
https://www.microsoft.com/en-us/download/details.aspx?id=42643

File save options
In Settings (Right click icon)
File name type: Date and Time format
yyyy-MM-dd-HH-mm-ss-fff

DCR (Decred) The New Crypto Currency

Decred which is traded as (DCR) on only a couple of CryptoCoin exchanges at the time of this post is very promising.

Promising in a way that it addresses Bitcoin’s current flaws and may be the next dominant CryptoCurrency. Such a bold claim to become Bitcoin 2.0, but this coin and the community has what it takes.

Want technical details? Go here: https://www.decred.org/

There is still a lot to do, and a long way to go, but they have a solid plan and a Decred Constitution.

I was amazed when I read this, as they have clear direction and seek to bring back the spirit of what Bitcoin was supposed to do.

I’ve been able to set up my Decred Wallet, and even attempted to mine decred both solo and in a pool.

During testnet, my humble ~375 MH/s graphics card would find blocks and let me know everything is working.

Now that mainnet is up, I haven’t found any blocks as there is already too much competition with those who have mining rigs with open air GPU card sleds that will put gaming systems to shame.

This did not daunt me however, as I was able to purchase some DCR from the exchanges and set up my system for POS (Proof of Stake) mining.

Hybrid Proof-of-Work Proof-of-Stake

Since my 5 ASIC’s that were used for Bitcoin and other sha256 alt coins are useless for mining Decred, I point them to coins that can be traded for Decred.

Later, I’ll set up the POS wallet somewhere that will not be affected by my home internet connection and power grid. Will give more details about this later.

Decred setup on Windows x64 and mining on Testnet

Since Decred is using blake256, I will be setting up mining on my windows machine because it has a better graphics card.

Info for the setup came from here:

https://forum.decred.org/threads/public-testnet-binaries-source-code-and-documentation.334/

Download the binaries:

https://github.com/decred/dcrd/releases/tag/v0.0
https://github.com/decred/cgminer/releases/tag/v0.0

The quick reference guide will help you:

https://wiki.decred.org/Quick_Reference

Start the decred daemon the first time:

dcrd.exe -u YourUserName -P YourPassword

Start the decred wallet and get a new address:

dcrwallet --create
dcrwallet --dcrdusername=YourUserName --dcrdpassword=YourPassword /noclienttls

You will need to set up a passphrase that you should save. You will need it to unlock your wallet later.

Your wallet will get created somewhere here:

C:\Users\YourWindowsUserName\AppData\Local\Dcrwallet\testnet

Get a new address:

dcrctl --testnet -u YourUserName -P YourPassword --wallet getnewaddress

At this point, you will not need this wallet open to start mining, so you can shut it down, but you can unlock it and check the balance anytime you want when the wallet is running.

dcrctl --testnet -u YourUserName -P YourPassword --wallet getbalance
dcrctl --testnet -u YourUserName -P YourPassword --wallet walletpassphrase "your passphrase here" 9999999

Shut down and start the decred daemon again. Note that if you are on windows, you will need the –notls flag if you want to mine:

dcrd.exe --notls -u YourUserName -P YourPassword --miningaddr=YourNewDecredAddress

Now to start mining:

cgminer.exe --blake256 -o http://127.0.0.1:19109 -u YourUserName -p YourPassword --intensity d

Decred Installation on Ubuntu

Attempting to install Decred

Github project:

https://github.com/decred/dcraddrgen.git

GO installation:

sudo apt-get install gccgo-go
mkdir ~/gocode

Add to .bashrc

export GOPATH=$HOME/gocode

Now get the address generator:

go get -u github.com/decred/dcraddrgen

Currently getting errors, will update this post later…

EDIT: This post is old, I was able to get my decred wallet working and will post details in later posts.

Using Upstart on Ubuntu for bitcoind

My bitcoind was always crashing after about 12 hours and I would restart it. I had a script that ran after a reboot, but that didn’t help to restart it after a crash. I tried Upstart scripts but they wouldn’t work at reboot, although I could start/stop them at will after configuration.

I found the answer here:
https://bitcointalk.org/index.php?topic=25518.msg8733922#msg8733922

So this is what my /etc/init/bitcoind.conf looks like now.

description "bitcoind"

start on filesystem
stop on runlevel [!2345]
oom score -500
expect fork
respawn
respawn limit 10 60 # 10 times in 60 seconds

script
	user=yourusername
	home=/home/$user
	cmd=/usr/local/bin/bitcoind
	pidfile=$home/bitcoind.pid
	# Don't change anything below here unless you know what you're doing
	[[ -e $pidfile && ! -d "/proc/$(cat $pidfile)" ]] && rm $pidfile
	[[ -e $pidfile && "$(cat /proc/$(cat $pidfile)/cmdline)" != $cmd* ]] && rm $pidfile
	exec start-stop-daemon --start -c $user --chdir $home --pidfile $pidfile -m --startas $cmd
end script

I have similar scripts for my other coins.