Skip to content

Instantly share code, notes, and snippets.

@mikeyb
Last active August 27, 2016 11:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save mikeyb/1e9892f66810ff4478d08a18f0a3e47b to your computer and use it in GitHub Desktop.
Save mikeyb/1e9892f66810ff4478d08a18f0a3e47b to your computer and use it in GitHub Desktop.
How I setup my headless mining rigs
# My headless ubuntu 15.04 mining rig install
#
# Replace <username> with the username you chose during install
#
# Note: The mining_scripts repo listed below is still WIP and should be adjusted to your needs
# especially paths/usernames/hostnames
#
# By default it uses genoil ethminer, atrides eth-proxy and siacoin gominer with poolmod3
sudo visudo -f /etc/sudoers.d/README
<username> ALL = NOPASSWD:ALL
ssh-keygen -t rsa -b 4096
sudo apt update
sudo apt upgrade -y
sudo apt install software-properties-common -y
sudo add-apt-repository ppa:ethereum/ethereum -y
sudo apt update
sudo apt install ubuntu-desktop autossh zsh vim git screen curl wget python-pip cmake libcryptopp-dev libleveldb-dev libjsoncpp-dev libjson-rpc-cpp-dev libboost-all-dev libgmp-dev libreadline-dev libcurl4-gnutls-dev ocl-icd-libopencl1 opencl-headers mesa-common-dev libmicrohttpd-dev build-essential -y
sudo vi /etc/default/grub
# GRUB_CMDLINE_LINUX_DEFAULT="text"
sudo update-grub
sudo systemctl enable multi-user.target --force
sudo systemctl set-default multi-user.target
zsh
cd
git clone --recursive https://github.com/sorin-ionescu/prezto.git "${ZDOTDIR:-$HOME}/.zprezto"
setopt EXTENDED_GLOB
for rcfile in "${ZDOTDIR:-$HOME}"/.zprezto/runcoms/^README.md(.N); do
ln -s "$rcfile" "${ZDOTDIR:-$HOME}/.${rcfile:t}"
done
chsh -s /bin/zsh
vi ~/.zprofile
# Add to .zprofile
alias gits='git status'
export PATH=$PATH:$HOME/bin:/usr/local/go/bin:$HOME/apps/go/bin
export GOPATH=$HOME/apps/go
export GPU_FORCE_64BIT_PTR=0
export GPU_MAX_HEAP_SIZE=100
export GPU_USE_SYNC_OBJECTS=1
export GPU_MAX_ALLOC_PERCENT=100
export GPU_SINGLE_ALLOC_PERCENT=100
export DISPLAY=:0
# add to /etc/rc.local
su <username> - -c 'screen -S X -d -m zsh -lc "startx"'
sudo dpkg-reconfigure x11-common # choose anybody to allow user to startx
pip install --user adl3
mkdir ~/apps ~/apps/go ~/scripts ~/miners ~/tmp
cd ~/tmp
wget https://storage.googleapis.com/golang/go1.6.3.linux-amd64.tar.gz
sudo tar -C /usr/local -xzf go1.6.3.linux-amd64.tar.gz
wget https://www.dropbox.com/s/u35h4iirsxordy4/AMD-APP-SDK-linux-v2.9-1.599.381-GA-x64.tar.bz2
wget https://www.dropbox.com/s/86uoq7ni54sedtd/ADL_SDK9.zip
unzip ADL_SDK9.zip
tar xfj AMD-APP-SDK-linux-v2.9-1.599.381-GA-x64.tar.bz2
sudo ./AMD-APP-SDK-v2.9-1.599.381-GA-linux64.sh
sudo ln -s /opt/AMDAPPSDK-2.9-1 /opt/AMDAPP
sudo ln -s /opt/AMDAPP/include/CL /usr/include
sudo ln -s /opt/AMDAPP/lib/x86_64/* /usr/lib/
sudo ldconfig
sudo reboot
sudo apt install fglrx-updates -y
sudo aticonfig --adapter=all --initial
aticonfig --list-adapters
cd ~/scripts
git clone https://github.com/mikeyb/mining_scripts.git .
crontab ~/scripts/crontab
cd ~/miners
git clone https://github.com/Genoil/cpp-ethereum/ genoil
cd genoil
mkdir build
cd build
cmake -DBUNDLE=miner ..
make -j8
sudo ln -s ~/miners/genoil/build/ethminer/ethminer /usr/local/bin/ethminer
cd ~/miners
git clone https://github.com/Atrides/eth-proxy.git
echo yes | cp ~/scripts/etc.conf ~/miners/eth-proxy/eth-proxy.conf
go get github.com/SiaMining/gominer
cd $GOPATH/src/github.com/SiaMining/gominer
git fetch
git checkout poolmod3
go build
echo yes | cp gominer ~/apps/go/bin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment