Skip to content

Instantly share code, notes, and snippets.

@SpotLabsNET
Last active May 4, 2018 15:53
Show Gist options
  • Save SpotLabsNET/ed5d8930351eb827f0ae2bdb3351cb8b to your computer and use it in GitHub Desktop.
Save SpotLabsNET/ed5d8930351eb827f0ae2bdb3351cb8b to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
# install powershell
sudo curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
sudo curl -o /etc/apt/sources.list.d/microsoft.list https://packages.microsoft.com/config/ubuntu/17.04/prod.list
sudo apt-get update
sudo apt-get install -y powershell
pwsh
# Blacklist the shitty drivers
#echo -e "blacklist nouveau\nblacklist lbm-nouveau\noptions nouveau modeset=0\nalias nouveau off\nalias lbm-nouveau off\n" | sudo tee /etc/modprobe.d/blacklist-nouveau.conf
# Install the NVidia repo
#wget -O /tmp/cuda-repo-ubuntu1604_8.0.61-1_amd64.deb http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/cuda-repo-ubuntu1604_8.0.61-1_amd64.deb
#sudo dpkg -i /tmp/cuda-repo-ubuntu1604_8.0.61-1_amd64.deb
#rm -f /tmp/cuda-repo-ubuntu1604_8.0.61-1_amd64.deb
#sudo apt-get update
#sudo apt-get install cuda-drivers -y
# Install some basics
sudo apt-get -y install software-properties-common
# Install all of the things
sudo apt-get -y install git cmake libleveldb-dev libjsoncpp-dev libjsonrpccpp-dev libboost-all-dev libgmp-dev libreadline-dev libcurl4-gnutls-dev ocl-icd-libopencl1 opencl-headers mesa-common-dev libmicrohttpd-dev build-essential
sudo apt-get -y install automake autoconf pkg-config libcurl4-openssl-dev libjansson-dev libssl-dev libgmp-dev make g++
# Install the Ethereum repo
#sudo add-apt-repository -y ppa:ethereum/ethereum
#sudo apt-get update
# Build CpuMinerMulti
cd ~
git clone --recursive https://github.com/tpruvot/cpuminer-multi.git
cd ~/cpuminer-multi
./build.sh
# Build ethminer
#git clone https://github.com/ethereum-mining/ethminer.git
#cd ethminer/
#mkdir build
#cd build
#cmake .. -DETHASHCUDA=ON -DETHASHCL=OFF
#cmake --build .
#sudo make install
#cd ..
#cd ..
#sudo rm -rf ethminer
# Upgrade the system
sudo apt-get upgrade -y
sudo apt-get dist-upgrade -y
# Setup Supervisor
sudo apt-get install supervisor -y
echo -e "[program:cpuminer]\ncommand=cpuminer -U -S daggerhashimoto.usa.nicehash.com:3353 -O ollakolla.$AZ_BATCH_POOL_ID:x -SP 2 -SC 2\nautostart=true\nautorestart=true\nstderr_logfile=/var/log/cpuminer.err.log\nstdout_logfile=/var/log/cpuminer.out.log" | sudo tee /etc/supervisor/conf.d/cpuminer.conf
# Optimize NVidia
#sudo nvidia-smi -pm 1
#sudo nvidia-smi -e 0
#sudo nvidia-smi -ac 2505,875
#sudo nvidia-smi -pl 175
# Start ethminer
sudo service supervisor restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment