Skip to content

Instantly share code, notes, and snippets.

@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.
@mharsch
mharsch / VSpeedTeleOp.java
Created September 12, 2015 19:10
PRA's FTC TeleOp V1
package com.qualcomm.ftcrobotcontroller.opmodes;
import com.qualcomm.robotcore.eventloop.opmode.OpMode;
import com.qualcomm.robotcore.hardware.DcMotor;
import com.qualcomm.robotcore.util.Range;
/**
* Created by mharsch on 9/12/15.
*/
public class VSpeedTeleOp extends OpMode {
Notes for final nodebots day organizer's meeting:
Chris will record his intro video and give to dshaw before Thursday
length will be 20min max
content will include 'get to blinking led' bootstrap sequence
dshaw recommends following up with all attendees this week to combat attrition
Medellín is considering streaming video toward the end of their event
@mharsch
mharsch / gist:5943801
Last active April 18, 2018 11:38
Roomba power supply + serial interface for Raspberry Pi

Roomba exposes both unregulated battery voltage (+14v, GND), and a 5v TTL serial interface via it's mini-din connector. Also exposed is an active-low signal pin called DD (Device Detect) that can be used to wakeup a sleeping/off Roomba.

Rpi has a 3.3v TTL serial interface exposed on it's header pins. Also, Rpi exposes +5v, +3.3v, GND, as well as GPIO pins.

We can leverage the Roomba battery to power the Rpi by adding a voltage regulator circuit between the roomba min-din battery pins and the 5v/GND power pins on the Rpi header. I've chosen the following part from the RC community (called a UBEC Universal Battery Elimination Circuit) to power the Rpi: this or this

To convert the 5v Roomba signals (both serial and DD) to/from 3.3v, I've chosen this: