Skip to content

Instantly share code, notes, and snippets.

View bneil's full-sized avatar
🍙
everything really is awesome

Benjamin Neil bneil

🍙
everything really is awesome
View GitHub Profile
@bneil
bneil / test.go
Last active February 28, 2020 22:45
Golang Example Type/Interface Inheritance
package main
import (
"fmt"
)
type Funny interface {
Joke()
}
//Just note taking a problem as i keep getting an illegal byte string
f, err := os.Open("/tmp/extra/sample.csv")
check(err)
defer f.Close()
in, err := ioutil.ReadAll(f)
check(err)
out := make([]byte, len(in))
out = out[:]
@bneil
bneil / freeze.md
Created April 30, 2019 21:31 — forked from jessfraz/freeze.md

In a terminal start a server.

$ python -m SimpleHTTPServer 8000

In another terminal set up the cgroups freezer.

@bneil
bneil / .tmux.conf
Created April 5, 2019 15:30
Mah Current TMUX
# status bar
#set-option -g status-utf8 on
# https://github.com/seebi/tmux-colors-solarized/blob/master/tmuxcolors-256.conf
set-option -g status-bg colour235 #base02
set-option -g status-fg colour136 #yellow
set-option -g status-attr default
set -g history-limit 10000
@bneil
bneil / Makefile
Last active May 8, 2019 17:25
My Docker/GoLang Makefile
## Basic GoLang Makefile
##
## inspired by https://gist.github.com/turtlemonvh/38bd3d73e61769767c35931d8c70ccb4
## But this has more dockerism's
BINARY = thing
VET_REPORT = reports/vet.report
TEST_REPORT = reports/tests.xml
GOARCH = amd64
DOCKER_HUB = gitlab.com/bneil
@bneil
bneil / Dockerfile
Last active May 8, 2019 17:23
My typical golang dockerfile
# ======================== [ Create GoLang Builder ]
FROM golang:1.12 AS builder
COPY . /app
WORKDIR /app
RUN make release && pwd && ls
# ======================== [ Create Final ]
FROM gcr.io/distroless/base

Keybase proof

I hereby claim:

  • I am bneil on github.
  • I am trugrok (https://keybase.io/trugrok) on keybase.
  • I have a public key whose fingerprint is A819 8EA6 DEDA 1875 A9ED 4972 8FCB 2D24 5FE3 73AA

To claim this, I am signing this object:

@bneil
bneil / dcos-mesos-elastic-nonsecret.log
Created January 22, 2018 16:28
another run without secrets
I0122 08:23:49.487488 28672 fetcher.cpp:533] Fetcher Info: {"cache_directory":"\/tmp\/mesos\/fetch\/nobody","items":[{"action":"BYPASS_CACHE","uri":{"cache":false,"executable":false,"extract":true,"value":"https:\/\/downloads.mesosphere.com\/java\/jre-8u144-linux-x64.tar.gz"}},{"action":"BYPASS_CACHE","uri":{"cache":false,"executable":false,"extract":true,"value":"https:\/\/downloads.mesosphere.com\/elastic\/assets\/2.1.1-5.6.5\/elastic-scheduler.zip"}},{"action":"BYPASS_CACHE","uri":{"cache":false,"executable":false,"extract":true,"value":"https:\/\/downloads.mesosphere.io\/libmesos-bundle\/libmesos-bundle-1.10-1.4-63e0814.tar.gz"}}],"sandbox_directory":"\/var\/lib\/mesos\/slave\/slaves\/e9ee1b90-7e38-4d26-8df2-6411bd3e3952-S4\/frameworks\/0dcb9c5c-7724-4dbc-9691-cbf91056f28c-0001\/executors\/elastic.a08f0332-ff90-11e7-bad7-70b3d5800002\/runs\/5837e8e7-561a-40bd-8906-cf964d3a9524","user":"nobody"}
I0122 08:23:49.491022 28672 fetcher.cpp:444] Fetching URI 'https://downloads.mesosphere.com/java/jre-8u144-linux
@bneil
bneil / dcos-mesos-elastic.log
Created January 22, 2018 16:08
Weird error when scheduling elastic using secrets
Certificate was added to keystore
Exception in thread "main" java.lang.IllegalStateException: com.mesosphere.sdk.state.ConfigStoreException: Failed to deserialize DefaultServiceSpecification from JSON: Could not resolve type id 'IsLocalRegionRule' into a subtype of [simple type, class com.mesosphere.sdk.offer.evaluate.placement.PlacementRule]: known type ids = [AgentRule, AndRule, AttributeRule, HostnameRule, MaxPerAttributeRule, MaxPerHostnameRule, NotRule, OrRule, PassthroughRule, PlacementRule, RoundRobinByAttributeRule, RoundRobinByHostnameRule, TaskTypeRule]
at [Source: java.io.StringReader@2687bf90; line: 196, column: 9] (through reference chain: com.mesosphere.sdk.specification.DefaultServiceSpec["pod-specs"]->java.util.ArrayList[0]->com.mesosphere.sdk.specification.DefaultPodSpec["placement-rule"]->com.mesosphere.sdk.offer.evaluate.placement.AndRule["rules"]->java.util.ArrayList[0]) (reason: SERIALIZATION_ERROR)
at com.mesosphere.sdk.scheduler.DefaultScheduler.updateConfig(DefaultScheduler.java:4
@bneil
bneil / s3fs2.scala
Last active September 27, 2016 22:38
Issues figuring out how to integrate streaming to s3 via fs2
package services.processing
import java.nio.file.{Paths, StandardOpenOption}
import akka.actor.Actor
import fs2._
import jp.co.bizreach.s3scala.S3
import services.consumer.EventRecord
import utils.Logging
import awscala.s3._