Skip to content

Instantly share code, notes, and snippets.

Task: add vector type option parsing to chia_plot for the -t and -2 options
so the user can specify a comma-separated list of paths instead of just a single path
e.g.
./chia-plot -n 4 -t /mnt/ssd1/,/mnt/ssd2 -2 /mnt/ssd3/,/mnt/ssd4/,/mnt/ssd5 <other options>
in the above example the actual paths used will be as follows:
plot -t_path -2_path
@mharsch
mharsch / gist:424adca0e264a79493b8e5a02096be1d
Created March 5, 2021 18:23
EM1000T-VZ-CAT1 on Raspberry Pi using ModemManager 1.14
The version of ModemManager that ships with Raspberry Pi OS (1.10) doesn't appear to work with the Telit LE910 V2
in MBIM mode (AT#USBCFG=3) and so we must upgrade to a newer version (1.14). Thankfully, that is available via
the debian backports repository.
0.) Add this line to /etc/apt/sources.list
deb http://deb.debian.org/debian buster-backports main
1.) Download and install the Debian repo key package
wget http://deb.debian.org/debian/pool/main/d/debian-archive-keyring/debian-archive-keyring_2021.1.1_all.deb
sudo dpkg -i debian-archive-keyring_2021.1.1_all.deb
@mharsch
mharsch / gist:3e855c192c75767f7c220abbf6d66404
Created February 22, 2021 18:42
ConnectedIO EM1000T-VZ-CAT1 modem on Raspberry Pi
How to setup the Raspberry Pi to use the Connected IO EM1000T-VZ-CAT1 modem in MBIM mode
(Tested on Pi 4 model B (2GB), Raspberry Pi OS Buster 2021-01-11 release, Modem firmwre 20.00.015)
First put the modem into MBIM mode by issuing the following AT command (using minicom -D /dev/ttyACM0)
at#usbcfg=5
Power off /on modem, reboot Pi
Confirm the following device exists
/dev/cdc-wdm0
@mharsch
mharsch / gist:981ce81429e9012bb0efd0149f7556fd
Last active February 6, 2021 15:55
Get ethereum mining working on Ubuntu + NVIDIA Docker host
Make sure the host has up-to-date nvidia drivers (460 as of this writing)
sudo apt install nvidia-headless-460
Download ethminer to current directory:
wget https://github.com/ethereum-mining/ethminer/releases/download/v0.19.0-alpha.0/ethminer-0.19.0-alpha.0-cuda-9-linux-x86_64.tar.gz
Create Dockerfile as follows:
FROM nvidia/cuda:11.2.0-base-ubuntu18.04
LABEL description="ethminer container for NVIDIA GPU systems"
@mharsch
mharsch / gist:cfd02f95d8ae784c638f465251b9dcbb
Created January 25, 2021 22:05
why does this fail in the Node-RED function editor?
if (msg.payload == 0) {
msg.payload = "No trip factor "
} else if (msg.payload == 1) {
msg.payload = "Over-current event while at constant speed"
} else if (msg.payload == 2) {
msg.payload = "Over-current event during deceleration"
} else if (msg.payload == 3) {
msg.payload = "Over-current event during acceleration "
} else if (msg.payload == 4) {
msg.payload = "Over-current event during other conditions"
@mharsch
mharsch / gist:f2bb226caa1de91abaa95f28c6d17b7b
Created January 24, 2021 16:48
ethminer on ROCm Dockerfile
FROM ubuntu:18.04
LABEL description="ethminer AMD ROCm Container"
ENV API_PORT=3333
COPY ethminer.tar.gz ./ethminer.tar.gz
ARG ROCM_VER=4.0.0
RUN apt-get update \
@mharsch
mharsch / gist:942811d575987d6589886a09ad9e754b
Created January 24, 2021 16:43
build ethminer on ROCm host
cd ethminer
mkdir build
cd build
cmake .. -DETHASHCUDA=OFF -DETHASHCL=ON -DUSE_SYS_OPENCL=ON -DAPICORE=ON
CPATH=/opt/rocm/opencl/include cmake --build .
@mharsch
mharsch / student_coding.md
Created August 12, 2020 19:24
Links to HS student coding competitions, hackathons, and project-based challenges
FROM nvidia/cuda:9.2-base-ubuntu18.04
LABEL description="ethminer container for hosts running the NVIDIA driver"
ENV API_PORT=3333
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
ocl-icd-opencl-dev \
clinfo \
curl \
* Download and install the pi imager tool https://www.raspberrypi.org/downloads/
* Insert SD card into adapter and run the imager tool. Choose Raspbian Lite (Buster)
* Once flashed, eject and re-insert SD card into PC. Navigate to the "boot" partition of the newly flashed SD card.
* Create an empty file inside "boot" called "ssh" -- all lower-case with no file extension (this will enable incoming ssh connections)
* Follow the instructions here to pre-configure wifi network name and passphrase: https://www.raspberrypi.org/documentation/configuration/wireless/headless.md
* safely eject the SD card and use it to boot the pi. Use your wifi router admin interface to determine the IP address assigned to the newly booted pi.
* ssh into the pi using the username/password: pi/raspberry
* run the command "sudo raspi-config" to launch the initial setup menu program. Customize the following:
Timezone
interfacing options->SPI (set to enable)