Skip to content

Instantly share code, notes, and snippets.

🔨
If I had a hammer 🦥

Kyle Brandt kylebrandt

🔨
If I had a hammer 🦥
Block or report user

Report or block kylebrandt

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@kylebrandt
kylebrandt / Flight.pb.go
Created Sep 19, 2019
protoc genenrated Flight.proto
View Flight.pb.go
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: Flight.proto
package arrow_flight_protocol
import (
fmt "fmt"
proto "github.com/golang/protobuf/proto"
@kylebrandt
kylebrandt / df_arrow.diff
Created Sep 18, 2019
Old DF (dataframe) to Arrow Diff
View df_arrow.diff
diff --git a/pkg/dataframe/csv.go b/pkg/dataframe/csv.go
new file mode 100644
index 0000000000..0838a7c413
--- /dev/null
+++ b/pkg/dataframe/csv.go
@@ -0,0 +1,48 @@
+package dataframe
+
+import (
+ "encoding/csv"
View df.json
{
"Frames": [
{
"fields": [
{
"name": "Time",
"type": "time",
"values": [
"1568652080000000000",
"1568652085000000000",
@kylebrandt
kylebrandt / dumpResponseToFile.go
Created Aug 6, 2019
Dump HTTP Req -- appending to file
View dumpResponseToFile.go
func dumpResponseToFile(resp *http.Response, filename string) error {
dump, err := httputil.DumpResponse(resp, true)
if err != nil {
return err
}
f, err := os.OpenFile(filename, os.O_APPEND|os.O_WRONLY, 0600)
if err != nil {
return err
}
@kylebrandt
kylebrandt / bosun.json5
Last active Jan 25, 2019
Bosun VSCode Snippets
View bosun.json5
{
// Place your snippets for bosun here. Each snippet is defined under a snippet name and has a prefix, body and
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the
// same ids are connected.
// Example:
// "Print to console": {
// "prefix": "log",
// "body": [
// "console.log('$1');",
@kylebrandt
kylebrandt / i3hangout.md
Last active Jul 29, 2019
i3 Hangout / Meet VLC screensharing workaround mutli-monitor
View i3hangout.md

Share an area of your screen by using vlc screen capture, and then sharing the vlc capture window

Make sure the VLC window floats

In i3 config:

for_window [window_role="vlc-video"] floating enable move down 100px;

We float it so the tiling window manager doesn't resize the window and mess up the scale. We also move the window placement down at launch so it easy to drag somewhere mostly offscreen.

View gist:85ab9ff0cb4f61394b7796e429ca25dc
slack = `
{{- $attachments := makeSlice -}}
{{- /* Set some slack properties on the attachment */ -}}
{{- $fallback := printf "Alert on %v" .Alert.Vars.url_host -}}
{{- $title := printf "%v: HTTPUnit Check for %v returned error(s)" .Last.Status .Alert.Vars.url_host -}}
{{- $ts := .LastAbnormalTime.Unix -}}
{{- $color := "good" -}}
{{- if .Last.Status.IsWarning -}}
{{- $color = "warning" -}}
@kylebrandt
kylebrandt / ghook.go
Last active Oct 30, 2018
Bosun git saving and pulling
View ghook.go
package main
import (
"fmt"
"log"
"os"
"path/filepath"
"<replaceme>/bogit/util"
)
@kylebrandt
kylebrandt / docker.sh
Last active Jun 8, 2018
Bosun Data in ES PoC
View docker.sh
docker run -d -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" docker.elastic.co/elasticsearch/elasticsearch:5.5.3 && docker run -d -p 5601:5601 --net=host -e "ELASTICSEARCH_URL=http://localhost:9200" docker.elastic.co/kibana/kibana:5.5.3
@kylebrandt
kylebrandt / linelrforecastlr.txt
Created May 30, 2018
Bosun Expr: linelr based on forecastlr
View linelrforecastlr.txt
# Only works for single result in series due to ungroup()
$q = q("sum:hbase.region.percentFilesLocal{host=literal_or(co-tsdb05)}", "20m", "")
$to100 = tod(ungroup(forecastlr($q, 100)))
$line = linelr($q, $to100)
merge($q, $line)
You can’t perform that action at this time.