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 / keybase.md
Created January 29, 2015 03:21
keybase.md

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 8409 901D BBFC 6E07 4490 E259 AF63 63EE 28D2 9D6B

To claim this, I am signing this object:

{
@bneil
bneil / gist:76bcc1ea3a8a70c97fe2
Created June 15, 2015 22:20
Kamon has not been started yet.
//BAD
object Boot {
implicit val system = ActorSystem("test")
def main(args: Array[String]): Unit = {
Kamon.start()
class ApplicationServer(val actorSystem: ActorSystem) extends Stuff
new ApplicationServer(system)
system.shutdown()
@bneil
bneil / gist:4799a88dbf18dd26ca21
Created August 13, 2015 15:55
level3 connectivity issue
$> mtr 8.8.8.8
Host Loss% Snt Last Avg Best Wrst StDev
1. 10.1.10.1 0.0% 12 6.0 5.3 2.0 10.2 2.6
2. 50.152.30.1 0.0% 12 30.0 21.3 10.9 31.1 6.5
3. xe-2-0-0-0-sur02.denver.co.denver.comcast.net 0.0% 12 14.7 20.7 10.8 47.0 10.2
4. ae-20-0-ar01.aurora.co.denver.comcast.net 0.0% 12 20.3 27.5 14.3 60.8 15.8
5. lag-4.ear1.Denver.Level3.net 90.0% 11 29.5 29.5 29.5 29.5 0.0
6. Google.ear1.Denver1.Level3.net 0.0% 11 16.2 20.6 16.2 29.6 4.1
7. 216.239.42.249 0.0% 11 21.3 20.9 14.4 28.2 4.5
@bneil
bneil / CustomCodecs.scala
Created December 31, 2015 23:34
Adding a custom en/decoder for quill async-postgres
import java.util.UUID
import com.github.mauricio.async.db.RowData
trait CustomCodecs {
implicit val uuidEncoder = new Database.db.Encoder[UUID] {
def apply(index: Int, value: UUID, row: List[Any]) =
row :+ value
}
@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._
@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 / 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

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 / 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
@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