Skip to content

Instantly share code, notes, and snippets.

View mharsch's full-sized avatar

Mike Harsch mharsch

View GitHub Profile
@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)
@mharsch
mharsch / gist:1e3ca6ad69d195f0bc24a96576bf38ae
Last active May 4, 2020 15:14
fahclient ubuntu amd vega20 setup steps
install 18.04 server
sudo apt install linux-generic-hwe-18.04
reboot
download proprietary AMD driver file: amdgpu-pro-20.10-1048554-ubuntu-18.04.tar.xz
tar -Jxvf amdgpu-pro-20.10-1048554-ubuntu-18.04.tar.xz
amdgpu-pro-install --opencl=pal --headless
reboot
download fahclient file fahclient_7.6.9_amd64.deb
sudo dpkg -i --force-depends fahclient_7.6.9_amd64.deb
sudo usermod -a -G video fahclient
@mharsch
mharsch / gist:8860c8d9f2357f8a38f1d00b585d69c4
Created January 17, 2020 17:37
install fahclient on ubuntu 18.04 in 2020
Download client from https://download.foldingathome.org/releases/public/release/fahclient/debian-stable-64bit/
sudo dpkg -i <fahclient.deb>
<fails>
sudo update-rc.d FAHClient defaults
sudo dpkg -i <fahclient.deb> //again
<works>
Now the FAHclient start/stop/reload script is located in /etc/init.d
the config.xml file is located in /etc/fahclient
and the runtime artifacts (logs) are in /var/lib/fahclient
@mharsch
mharsch / gist:c3e3c5b69251ab05e208641b0e3c249b
Last active March 19, 2020 19:16
nvidia headless opencl ubuntu 18.04 setup in 2020
Install latest 18.04 (server) version
apt install software-properties-common
add-apt-repository ppa:graphics-drivers
apt install nvidia-headless-440
apt install nvidia-utils-440
apt install nvidia-opencl-dev //all of this just to get a symlink for libOpenCL.so
# see discussion of the above issue here: https://foldingforum.org/viewtopic.php?f=106&t=30836&start=15#p313509
# workaround: create the following symlink (this let's you skip the whole nvidia-opencl-dev package):
lrwxrwxrwx 1 root root 18 Mar 19 13:10 /usr/lib/x86_64-linux-gnu/libOpenCL.so -> libOpenCL.so.1.0.0
break out of initial activation jail on Verizon moto e5 go prepaid phones ($30 at BestBuy -- subsidized price)
Boot phone and attempt activation -- fails
tap screen 5 times to go into QR code setup mode -- configure wifi
restart phone
attempt activation -- fails, wifi is still connected from before
attempt a few more times -- fails each time
go back into QR code setup mode and enter wrong wifi password for your network (breaking wifi)
phone now shows 4GLTE status
attempt activation -- fails but allows you to continue with wifi -- reconfigure wifi and move on.
@mharsch
mharsch / gist:30f5262b0a6fb634c2d0bf6d0836c430
Last active July 29, 2020 16:34
setup ethereum mining on ubuntu 18.04 with polaris card
1.) install ubuntu 18.04.2 server edition from usb
2.) run sudo apt update && sudo apt dist-upgrade
3.) download latest linux drivers from amd (e.g. amdgpu-pro-19.10-785425-ubuntu-18.04.tar.xz)
4.) install drivers with './amdgpu-pro-install -y --opencl=pal,legacy --headless
5.) add /opt/amdgpu-pro/bin to your path. Test opencl with 'sudo /opt/amdgpu-pro/bin/clinfo'
6.) add rocm apt source
wget -qO - http://repo.radeon.com/rocm/apt/debian/rocm.gpg.key | sudo apt-key add -
echo 'deb [arch=amd64] http://repo.radeon.com/rocm/apt/debian/ xenial main' | sudo tee /etc/apt/sources.list.d/rocm.list
7.) install rocm-smi package
8.) add the following parameter to the /etc/default/grub file on the GRUB_CMDLINE_LINUX_DEFAULT line: amdgpu.ppfeaturemask=0xffffffff
@mharsch
mharsch / gist:3fad6a10ca627823a7963bbb13831656
Created September 6, 2018 00:10
FTC OnBot Java using Atom editor
Enjoy lighting fast build turnaround time (provided by OnBot Java) without sacrificing a nice (local) development environment.
1.) Install Atom from atom.io
2.) within atom, install the 'build' package (https://atom.io/packages/build)
3.) Install ftc_http per the instructions for your platform (https://github.com/TheLostLambda/ftc_http)
3.a) Review the ftc_http documentation and watch the video (https://youtu.be/gZabYO8g9mU)
4.) Create a new directory for your opmode code. Inside this directory, create a file called '.atom-build.js'
Contents of .atom-build.js
@mharsch
mharsch / gist:7f2a9b06d4b3291cea67847819d2e2d8
Last active December 29, 2022 23:46
Notes on ConnectedIO LTE modem + Raspberry Pi
The following applies to using the ConnectedIO LT1001 and LT1002 LTE modems on Verizon
in North America with the Raspberry Pi running Raspbian Jessie Lite (04/10/2017).
These guidelines assume that the modem interface will be the primary connection to
the Internet under normal conditions (i.e. not initial setup or field servicing).
Initial Setup
Establish serial communications with the modem (e.g. minicom -D /dev/ttyACM0).
Check modem firmware version with AT%VER and decide if you want/need to upgrade.