Skip to content

Instantly share code, notes, and snippets.

View wkimeria's full-sized avatar

William Kimeria wkimeria

View GitHub Profile
@wkimeria
wkimeria / gist:e4d0686194e71eaefcd6
Created June 24, 2014 22:22
Cause of borderpatrol tests failing randomly
I've tracked down the exact check-in that resulted in borderpatrol tests failing randomn, it was the following commit in the nginx Lua module
----------------------------------------------
commit ec2498a81592150e9ca74c65f05e1644afd7a1f5
Author: Yichun Zhang (agentzh) <agentzh@gmail.com>
Date: Tue May 27 12:44:12 2014 -0700
added assertions to the coroutine scheduler to ensure that we do not pop or push the wrong number of stack slots for yielded coroutines.
-------------------------------------------
@wkimeria
wkimeria / gist:186b6599f9e1d0cd9c9e
Last active August 29, 2015 14:05
Pattern Modifications for Defcon 22 Badge (Human)
'' =================================================================================================
''
'' File....... dc22_badge_human.spin
''
'' Authors.... Jon "JonnyMac" McPhalen and Ryan "1o57" Clarke
'' MIT License
'' -- see below for terms of use
''
'' E-mail..... jon@jonmcphalen.com
'' 1o57@10000100001.org
### Keybase proof
I hereby claim:
* I am wkimeria on github.
* I am wkimeria (https://keybase.io/wkimeria) on keybase.
* I have a public key whose fingerprint is F07A 4F30 D871 E928 2474 595D A4AD F335 82BE CA17
To claim this, I am signing this object:
@wkimeria
wkimeria / gist:b048ed4b3139e8650a29
Last active August 29, 2015 14:06
Luarock cannot install LuaJSON, returns 500
Luarock cannot install LuaJSON, returns 500
luarocks install luajson
Installing http://www.luarocks.org/repositories/rocks/luajson-1.3.3-1.src.rock...
Using http://www.luarocks.org/repositories/rocks/luajson-1.3.3-1.src.rock... switching to 'build' mode
Error: Could not fetch rock file: Error fetching file: Failed downloading http://www.luarocks.org/repositories/rocks/luajson-1.3.3-1.src.rock - HTTP/1.1 500 Internal Server Error
The issue seems to be that the file has moved and when luarocks gets redirected to the new location, that server throws a 500 if the User-Agent contains luarocks
I was thinking the upstream services essentially become proxies that get configured with the endpoint url
To instantiate
val mtpService = new UpstreamServiceProxy(authService, URI.create("https://localhost:8081/mtp"))
Class definition of UpstreamServiceProxy
package com.lookout.borderpatrol
/mtp-------- RoutingFilter ------------------------------>
[info] Service is >l4e<
[info] ------------------------------ SessionFilter ----------------------------->
[info] ------------------------------ UpstreamFilter ----------------------------->
[info] ------------------------------ UpstreamService /mtp----------------------------->
[info] /mtp-------- RoutingFilter ------------------------------>
[info] Service is >l4e<
[info] ------------------------------ SessionFilter ----------------------------->
[info] ------------------------------ UpstreamFilter ----------------------------->
[info] ------------------------------ MtpService /mtp ----------------------------->
package com.lookout.borderpatrol
import com.twitter.finagle.builder.ClientBuilder
import com.twitter.finagle.loadbalancer.{HeapBalancerFactory, DefaultBalancerFactory}
import com.twitter.finagle.service.SingletonFactory
import com.twitter.finagle.{Dtab, Http, Service, Path}
import com.twitter.finagle.http.{Request => FinagleRequest, Response => FinagleResponse, Http => FinagleHttp}
import com.twitter.util.{Await, Future}
import org.jboss.netty.handler.codec.http.{DefaultHttpRequest, HttpRequest, HttpResponse, HttpResponseStatus}
package com.lookout.borderpatrol
import java.net.{InetAddress, InetSocketAddress}
import com.lookout.borderpatrol.session._
import com.twitter.finagle.builder.ServerBuilder
import com.twitter.finagle.http.service.RoutingService
import com.twitter.finagle.http.{Request => FinagleRequest, Response => FinagleResponse, RichHttp, HttpMuxer, Http}
import com.twitter.finagle.{Filter, _}
import com.twitter.server.TwitterServer
import org.json4s.{NoTypeHints, native}
import native.Serialization.{read, write => swrite}
object Research {
implicit val formats = native.Serialization.formats(NoTypeHints)
sealed trait Person {
mport scala.concurrent.{Future => ScalaFuture}
object Research {
implicit val formats = native.Serialization.formats(NoTypeHints)
sealed trait Secret {
val algo = "HmacSHA256"
val id: Int
}