This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ubuntu:20.04 | |
ENV DEBIAN_FRONTEND=noninteractive | |
ENV DISPLAY :99 | |
ENV STAGE=dev | |
ENV REGION=us-east-1 | |
ENV BUCKET_NAME=bucket | |
RUN apt-get update |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tcpdump -A -s 10240 'tcp port 9393 and (((ip[2:2] - ((ip[0]&0xf)<<2)) - ((tcp[12]&0xf0)>>2)) != 0)' | egrep --line-buffered "^........(GET |HTTP\/|POST |HEAD )|^[A-Za-z0-9-]+: " | sed -r 's/^........(GET |HTTP\/|POST |HEAD )/\n\1/g' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.github.reikje | |
import java.net.{InetAddress, InetSocketAddress} | |
import com.twitter.finagle.{Address, Name, ThriftMux, param} | |
import com.twitter.util.{Await, Future} | |
import org.scalatest.{Matchers, WordSpec} | |
class RoundtripSpec extends WordSpec with Matchers { | |
"Microservice" should { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace com.github.reikje | |
service MicroService { | |
string request() | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.github.rschatz | |
import ch.qos.logback.classic.turbo.TurboFilter | |
import ch.qos.logback.classic.{Level, Logger, LoggerContext} | |
import ch.qos.logback.core.spi.FilterReply | |
import org.slf4j.{LoggerFactory, Marker} | |
import com.github.rschatz.{LogLevelName, LogLevelOverride} | |
object BroadcastContextOverrideFilter extends TurboFilter { | |
override def decide(marker: Marker, logger: Logger, level: Level, format: String, params: Array[AnyRef], t: Throwable): FilterReply = { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.github.rschatz | |
import com.twitter.app.App | |
// other imports | |
trait LoggingSetup { self: App => | |
private val root = LoggerFactory.getLogger(org.slf4j.Logger.ROOT_LOGGER_NAME).asInstanceOf[Logger] | |
private val context = root.getLoggerContext | |
private[this] val logLevel = flag( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.github.rschatz | |
import com.twitter.finagle.http._ | |
import com.twitter.finagle.{Service, SimpleFilter} | |
import com.twitter.util.Future | |
import com.github.rschatz.LogLevelOverride | |
import com.github.rschatz.LogLevelName | |
class LogLevelOverrideFilter extends SimpleFilter[Request, Response] { | |
override def apply(request: Request, service: Service[Request, Response]): Future[Response] = { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.github.rschatz | |
import com.twitter.finagle.context.Contexts | |
import com.twitter.io.{Buf, Charsets} | |
import com.twitter.util.Try | |
import com.github.rschatz.LogLevelName.LogLevelName | |
/** | |
* Encapsulates the name of a log level override. | |
* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.net.SocketAddress | |
import com.twitter.finagle.{Addr, Name, Resolver} | |
import com.twitter.util.{Future, Promise, Var, Await} | |
import org.scalatest.{Matchers, WordSpec} | |
/** | |
* A utility trait to resolve '''destinations''' into sets of '''SocketAddress'''es. | |
*/ | |
trait SocketAddressResolver { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package me.rschatz; | |
import com.glassdoor.planout4j.config.Planout4jConfigBackend; | |
import com.typesafe.config.Config; | |
import org.apache.commons.io.Charsets; | |
import org.apache.commons.io.IOUtils; | |
import java.io.IOException; | |
import java.util.ArrayList; | |
import java.util.HashMap; |
NewerOlder