Skip to content

Instantly share code, notes, and snippets.

View edrex's full-sized avatar

Eric Drechsel edrex

  • Portland, OR
View GitHub Profile
localhost:2020 {
log proxy.log
proxy /echo localhost:2021 {
websocket
}
}
localhost:2021 {
log websocket.log
@edrex
edrex / -
Created August 16, 2016 17:17
eric@ark ~/g/s/g/s/s/switch (master)> ./switch master -l 7468
{"context":"starting","function":"New","level":"info","msg":"starting","package":"master","time":"2016-08-16T09:47:20-07:00"}
SetUpListener: serverName (of self); localhost:7468
I'm a master switch called 'none' listening on 7468
2016/08/16 09:47:21 grpc: addrConn.resetTransport failed to create client transport: connection error: desc = "transport: dial tcp [::1]:7468: getsockopt: connection refused"; Reconnecting to {"localhost:7468" <nil>}
2016/08/16 09:47:21 grpc: addrConn.resetTransport failed to create client transport: connection error: desc = "transport: dial tcp [::1]:7468: getsockopt: connection refused"; Reconnecting to {"localhost:7468" <nil>}
2016/08/16 09:47:21 grpc: addrConn.resetTransport failed to create client transport: connection error: desc = "transport: dial tcp [::1]:7468: getsockopt: connection refused"; Reconnecting to {"localhost:7468" <nil>}
@edrex
edrex / -
Created August 11, 2016 19:07
bash-3.2$ echo  '{"value": "health"}' | http --pretty=all --verify=no POST https://localhost:7467/v1/health
HTTP/1.1 400 Bad Request
Content-Length: 74
Content-Type: application/json
Date: Thu, 11 Aug 2016 19:06:05 GMT
{
"Code": 3,
"Error": "invalid character 'Â' looking for beginning of value"
}
@edrex
edrex / -
Created August 5, 2016 21:39
Go Oracle
/Users/eric/go/src/github.com/sixgill/service/switch/cmd/device/service.go:380:25: cannot use float32(math.Mod(float64(gpsLocation.Heading) + (r.NormFloat64() * float64(stdDeltas.Heading)) + headingDelta, 360.)) (value of type float32) as float64 value in assignment
/Users/eric/go/src/github.com/sixgill/service/switch/cmd/device/service.go:382:4: invalid operation: mismatched types float64 and float32
/Users/eric/go/src/github.com/sixgill/service/switch/cmd/device/service.go:384:28: invalid operation: mismatched types float32 and float64
oracle: couldn't load packages due to errors: github.com/sixgill/service/switch/cmd/device
@edrex
edrex / -
Created August 3, 2016 00:18
# github.com/sixgill/service/switch/cmd/device
cmd/device/service.go:202: cannot use gwmux (type *"github.com/sixgill/service/vendor/github.com/gengo/grpc-gateway/runtime".ServeMux) as type *"github.com/sixgill/service/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime".ServeMux in argument to protobuf.RegisterHealthServiceHandlerFromEndpoint
cmd/device/service.go:210: cannot use gwmux (type *"github.com/sixgill/service/vendor/github.com/gengo/grpc-gateway/runtime".ServeMux) as type *"github.com/sixgill/service/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime".ServeMux in argument to protobuf.RegisterSGMSServiceHandlerFromEndpoint
cmd/device/service.go:218: cannot use gwmux (type *"github.com/sixgill/service/vendor/github.com/gengo/grpc-gateway/runtime".ServeMux) as type *"github.com/sixgill/service/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime".ServeMux in argument to protobuf.RegisterInitialContactServiceHandlerFromEndpoint
# github.com/sixgill/service/switch/cmd/master
cmd/master/service.go
Getting links from: http://localhost:4000/
├───OK─── http://gmpg.org/xfn/11
├───OK─── http://localhost:4000/public/css/poole.css
├───OK─── http://localhost:4000/public/css/syntax.css
├───OK─── http://localhost:4000/public/css/hyde.css
├───OK─── http://localhost:4000/public/css/pdxruby.css
├───OK─── https://fonts.googleapis.com/css?family=PT+Sans:400,400italic,700%7CAbril+Fatface
├─BROKEN─ http://localhost:4000/public/apple-touch-icon-144-precomposed.png (HTTP_404)
├─BROKEN─ http://localhost:4000/public/favicon.ico (HTTP_404)
├───OK─── http://localhost:4000/atom.xml
@edrex
edrex / camlistore-server-vps-s3.md
Last active June 8, 2016 10:12
Camlistore on a VPS with S3 blob storage

Let's set up Camlistore on a Linux server, with blobs stored in s3. This seems to be the currently best-supported option for "cloud" deployment.

This is meant as a supplement to the official server config doc. Read through both docs before you start.

http://camlistore.org/docs/server-config

This blog post is also recommended reading.

I've posted my config files for reference, but they will be created the first time you run camlistored (for the server) and camput init (for the client) so don't copy them.

package main
import "os"
import "log"
import "github.com/cznic/kv"
import "bytes"
import "strconv"
func usage() {
log.Fatalf(`Usage: exifgps-fixup FILE`)
@edrex
edrex / publish.sh
Last active May 5, 2016 21:27
Upload static site to S3 with clean URLs
#!/bin/sh
# Be sure to set the index and 404 docs to "index" and "404" respectively in your bucket settings
# replace with your compile command
harp compile ./ ./out
# removes the html extension
for f in `ls out/*.html out/**/*.html`; do mv $f "${f%%.*}"; done
;; -*- mode: emacs-lisp -*-
;; This file is loaded by Spacemacs at startup.
;; It must be stored in your home directory.
(defun dotspacemacs/layers ()
"Configuration Layers declaration.
You should not put any user code in this function besides modifying the variable
values."
(setq-default
;; Base distribution to use. This is a layer contained in the directory