Skip to content

Instantly share code, notes, and snippets.

@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

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 / .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="
@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 / 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 / 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 November 22, 2021 20:28
Golang add key/value to json file
package main
import (
"encoding/json"
"log"
"os"
"sync"
)
type Exclude struct {
@justinschuldt
justinschuldt / main.go
Created November 22, 2021 20:18
Golang log to file
package main
import (
"os"
"time"
)
func main() {
logFileName := fmt.Sprintf("logs_%v.log", time.Now().String())
@justinschuldt
justinschuldt / main.go
Created November 11, 2021 22:53
golang parallel async tasks, using WaitGroups and Mutex locks
package main
import (
"fmt"
"time"
"sync"
)
type QueryResult struct {
key string
@justinschuldt
justinschuldt / main.go
Created November 11, 2021 22:51
golang parallel async tasks, results via channel
package main
import (
"fmt"
"time"
)
type QueryResult struct {
key string
result string