Skip to content

Instantly share code, notes, and snippets.

View howardjohn's full-sized avatar

John Howard howardjohn

  • Solo.io
  • Sunnyvale, CA
View GitHub Profile
@Sennevds
Sennevds / system_sensor.py
Created July 31, 2019 10:24
Send Raspberry PI data to mqtt(with Home Assistant discovery support)
#!/usr/bin/env python3
from subprocess import check_output
from re import findall
import psutil
import sys
import os
import threading, time, signal
from datetime import timedelta
import datetime as dt
import paho.mqtt.client as mqtt
@jsmouret
jsmouret / struct.go
Last active June 20, 2024 11:15
Convert map[string]interface{} to a google.protobuf.Struct
package pb
import (
"fmt"
"reflect"
st "github.com/golang/protobuf/ptypes/struct"
)
// ToStruct converts a map[string]interface{} to a ptypes.Struct
@louiscryan
louiscryan / README
Created December 14, 2015 21:51
GRPC - Curl, HTTP/1.1 & nghttp misc
# Build the GRPC Java server which is used for interop testing.
# Interface defined here
# https://github.com/grpc/grpc-java/blob/master/interop-testing/src/main/proto/io/grpc/testing/integration/test.proto
./gradlew :grpc-interop-testing:installDist
# Run it with TLS turned on so ALPN is enabled. Uses a dummy cert
./interop-testing/build/install/grpc-interop-testing/bin/test-server --port=8080 --use_tls=true
# Run the awesome nghttp2 as a proxy in front of it.
# See https://nghttp2.org/documentation/package_README.html#building-from-git
@dergachev
dergachev / ssh-forward-clipboard.md
Last active May 8, 2024 09:15
Forward your clipboard via SSH reverse tunnels

Exposing your clipboard over SSH

I frequently administer remote servers over SSH, and need to copy data to my clipboard. If the text I want to copy all fits on one screen, then I simply select it with my mouse and press CMD-C, which asks relies on m y terminal emulator (xterm2) to throw it to the clipboard.

This isn't practical for larger texts, like when I want to copy the whole contents of a file.

If I had been editing large-file.txt locally, I could easily copy its contents by using the pbcopy command: