A metamorphic island in the net...

Tuning of a Dayun ZigMiner

Recently I've put my hands on a relatively new ASIC miner released by Dayun company, the ZigMiner Z1+. Make an educated guess about what might be the location of the manufacturer...

By the way, at the beginning the features of this miner seemed to be really promising: an hashrate of 7.25 Gh/s mining coins based on the Lyra2REv2 algorithm (such as Vertcoin, Monacoin, Galactrum, ...) with a power consumption of 1200 W. Despite the cost of energy in Italy, actually one the highest in the world (because of choices made in the past by not entitled people regarding the energy supply), this machine initially guaranteed an high daily income (around 50 € per day) and a short span for ROI.

However, after 2 months of bear run affecting the crypto market, its profitability fell off a cliff and, right now, it's almost more profitable as an heating system. Moreover, there are rumors of forks regarding the coins with the highest market cap among those using Lyra2REv2 (these coins actually declared themselves as ASIC resistant since the beginning). Therefore, this machine was definitely not a deal so far.

Reading online forums related to altcoin mining, I also noticed that most of the owners complained about its noisiness and the configuration process limited by its web interface which, in some cases, was non working properly. Therefore I wound up posting the update procedure and the passes I commonly follow to tune it a little bit.

Once I've downloaded the latest image (released on 30/11/2018 in the example) from the ZigMiner repository on Google Drive, I extract the 7z archive containing the raw image:

s1kl3@sprawl:~$
7z x z1+_static_100_11_30.7z
Later I check for the partition table stored in the image and take note of the sector size and the end sector of the image:
s1kl3@sprawl:~$
sudo fdisk -l ./z1+_static_100_11_30.img Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: dos Disk identifier: 0x00000000 Device Boot Start End Sectors Size Id Type /dev/sda1 49152 131071 81920 40M 83 Linux /dev/sda2 131072 7617185 7486114 3.6G 83 Linux /dev/sda3 7617186 9713663 2096478 1023.7M 83 Linux
With these details I can write the raw image to the USB pendrive provided with the ZigMiner which will end up in 3 partitions (boot, rootfs and the encrypted web GUI written in PHP):
s1kl3@sprawl:~$
sudo dd if=z1+_static_100_11_30.img bs=512 count=9713663 conv=sync,noerror | pv -s 7GB | sudo dd of=/dev/sdg
Once completed, I mount the root file system of the USB pendrive and I change the network interface configuration according to the LAN settings. In my case the IP is assigned by a DHCP server through static leases based on the interface MAC address of the miner. If you prefer a static IP you will simply change the defaults to the desired subnet addresses (setting accordingly the IP for miner, gateway and DNS servers).
s1kl3@sprawl:~$
sudo mount /dev/sdg3 /mnt
s1kl3@sprawl:~$
sudo vim /mnt/etc/network/interfaces
The file content is changed to:
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet dhcp
pre-up /root/getmac.sh
hwaddress `cat /root/macaddr`
After saving the file I enable the SSH daemon to gain remote shell access to the miner (it's actually an Ubuntu 16.04 system). To do this, I enter in the Systemd configuration directory and create a symbolic link to the SSH service:
s1kl3@sprawl:~$
cd /mnt/etc/systsemd/system/multiuser-target/
s1kl3@sprawl:~$
sudo ln -s /lib/systemd/system/ssh.service ssh.service
Now I can unmount the pendrive, plug it into the ZigMiner and power it on:
s1kl3@sprawl:~$
cd && sudo sync && sudo umount /mnt
Later I connect to the ZigMiner web interface and login with admin/admin. Here I change the admin password, I set the address/username/password for the mining pools and I change the timezone and the network settings to DHCP (leaving the network address fields empty), save and reboot.

Finally I connect to the ZigMiner SSH server with root/envision, change root password and install the packages I commonly use to monitor a machine remotely from shell:
s1kl3@sprawl:~$
ssh -l root -p envision ZigMiner_IP_address
root@zigminer:~$
passwd
root@zigminer:~$
apt install bash-completion vim htop tmux iotop tcpdump ranger ncdu iptraf-ng tree lshw munin-node

System Administration Cryptocurrencies

Let's stop tinkering and put some order instead

This is the first of a series of papers I'll post to collect concepts and ideas I found remarkable during my everyday tasks dealing with programming, computer science, compilers and so on. Besides, it may be intended just as an effort to give some sort of usefulness to these dark-web pages which have been ignored for too long.

I begin with a paper describing the C++ memory model, whose thorough understanding is fundamental to exploit the full potential of modern multicore architectures. Along with atomic operations, it paves the way to lock-free programming, an elegant way to deal with shared data in concurrent environments. This guarantees a lower overhead and, generally, better performances in comparison to more common techniques based on mutexes, condition variables, etc.

The C++ Memory Model

News Programming

Current status

So, finally, this website is slowly taking a reasonable shape. After the initial uncertainties, due to the thick layer of rust settled on my PHP background, only a few aspects still need to get fixed:

  • Move to a responsive design.
  • On the backend side I'd like to move from the current simple object-oriented design to a more scalable MCV design pattern, just like any modern web-application.
  • On the frontend side I should fill the lacking sections with some kind of information... :-P

News