Running and Mining from CoinHive in the Linux Command Line
As you may be aware, 0x00sec has begun offering Monero Mining in the browser via Javascript. If you’re like me, you have some server somewhere that can happily take the load, but it’s headless, and you don’t want to be leaving a web browser window open forever.
Fear no more. I have been messing around and finally got it sorted.
What you need to do, is installed Google Chrome or Chromium and run this command.
chromium --headless --disable-gpu --repl https://0x00sec.org
This will start Chrome in headless mode, with REPL enabled, Read-Evaluate-Print-Loop, basically this will allow you to execute javascript in the DOM via the command line, without having to render the actual page.
This may take a little while, once you’ve got this you’ll see a prompt. Paste this.
miner = new CoinHive.User('8GiCBvTene8ArpdPgDjPt2tUIIr4NrXM', "pry0cc", { throttle: 0, autoThreads: true});
Obviously change “pry0cc” to your username, or whoever you want to mine for!
Then start the miner with:
miner.start()
And then check it is running with
miner.isRunning()
You can execute any range of commands, the docs can be found here
I hope this helped! Stay Snappy
pry0cc