Skip to content

Instantly share code, notes, and snippets.

@justinschuldt
justinschuldt / confg.yaml
Created November 30, 2021 04:04
OctoPrint config for controlling relays via GPIO
system:
actions:
- action: light_on
command: gpio mode 0 out && gpio write 0 0
name: Light ON
- action: light_off
command: gpio mode 0 out && gpio write 0 1
name: Light OFF
- action: divider
- action: rpi_usb_on
@justinschuldt
justinschuldt / main.go
Created December 11, 2021 00:22
golang parallel async tasks, sending results to channel, completion tracked by WaitGroup
package main
import (
"fmt"
"sync"
"time"
)
type QueryResult struct {
key string
@justinschuldt
justinschuldt / external-monitor-control.sh
Created December 12, 2021 23:17
Modify external monitor settings like brightness and contrast, from debian
# add the repository to get ddcutil
sudo add-apt-repository ppa:rockowitz/ddcutil
# update
sudo apt-get update
# install ddcutil
sudo apt install ddcutil
# change brightness of the primary montior to 80
sudo ddcutil setvcp 10 80
@justinschuldt
justinschuldt / .zshrc
Created January 27, 2022 03:07
zsh customizations
# defaults plus:
plugins=(aliases command-not-found common-aliases git gh gcloud kubectl minikube npm zsh-autosuggestions)
# search from the command line with:
# goog "string to search for"
function goog() {
emulate -L zsh
google="https://www.google.com/search?q="

Keybase proof

I hereby claim:

  • I am justinschuldt on github.
  • I am justinschuldt (https://keybase.io/justinschuldt) on keybase.
  • I have a public key ASC0NerBVM9JwJUyR0lqzXFwvXIUrWJw-gJyu97lf0qHxQo

To claim this, I am signing this object:

@justinschuldt
justinschuldt / grafana-prometheus.sh
Created March 18, 2022 09:43
grafana + prometheus for wormhole
# open grafana to the network
sudo docker run -d --name=grafana -h 0.0.0.0 -p 4001:3000 grafana/grafana:latest
docker run -d --name=prometheus -p 9090:9090 -v /home/justin/code/wormhole/prometheus.yml:/etc/prometheus/prometheus.yml prom/prometheus
@justinschuldt
justinschuldt / Tiltfile
Created March 18, 2022 09:48
local Ethereum explorer for wormhole - WIP
config.define_bool("evm_explorer", False, "Enable EVM explorer")
evm_explorer = cfg.get("evm_explorer", False)
if evm_explorer:
k8s_yaml_with_ns("devnet/eth-devnet-ui.yaml")
k8s_resource("eth-ui-redis", resource_deps=["eth-devnet"], labels = ["evm"])
import { ethers } from "ethers";
const rpc = 'http://localhost:8545'
const senderAddress = "0x90F8bf6A479f320ead074411a4B0e7944Ea8c9C1"
const senderPrivateKey = "0x4f3edf983ac636a65a842ce7c78d9aa706d3b113bce9c46f30d7d21715b23b1d" // ganche default
const addresses = [
"0xE11BA2b4D45Eaed5996Cd0823791E0C93114882d",
"0xd03ea8624C8C5987235048901fB614fDcA89b117",
"0x95cED938F7991cd0dFcb48F0a06a40FA1aF46EBC",
"0x3E5e9111Ae8eB78Fe1CC3bb8915d5D461F3Ef9A9",
@justinschuldt
justinschuldt / Tiltfile
Created May 18, 2022 09:12
grafana + prometheus for wormhole's devnet
config.define_bool("node_metrics", False, "Enable Prometheus & Grafana for Guardian metrics")
node_metrics = cfg.get("node_metrics", False)
# grafana + prometheus for node metrics
if node_metrics:
@justinschuldt
justinschuldt / kint36-i3wm-keys-and-vim-layer.json
Created December 8, 2021 06:45
QMK keymap for a Kinesis Advantage2 running the Stapelberg kint36 controller. This keymap provides OS keys for i3wm, and a layer with VIM controls.
{
"version": 1,
"notes": "For QMK Configurator. You can view this by importing it at <https://config.qmk.fm/#/kinesis/kint36/LAYOUT>. It can also be used directly with QMK's source code",
"documentation": "QMK keymap for a Kinesis Advantage2 running the Stapelberg kint36 controller. This keymap provides OS keys for i3wm, and a layer with VIM controls. Build info: <https://github.com/kinx-project/kint> \n",
"keyboard": "kinesis/kint36",
"keymap": "kint36-updated-layer-toggles",
"layout": "LAYOUT",
"layers": [
[
"KC_ESC",