Add to /etc/pf.conf
block out proto udp from any to any
block in proto udp from any to any
pass out proto udp from any to any port 53
pass in proto udp from any to any port 53
To apply:
Because we already have an official CockroachDB docker image, we will use that in our docker-compose.yml
file. We recommend you use one of the current tags instead of latest
.
// Should be put into ~/.sbt/1.0/plugins/bloop.sbt | |
// By default, this file does not do anything. | |
// If the environment variable BLOOP_ENABLED has the value 'true', | |
// then this file enables sbt-bloop. | |
if (System.getenv("BLOOP_ENABLED") == "true") { | |
addSbtPlugin("ch.epfl.scala" % "sbt-bloop" % "1.3.4") | |
} else Nil |
A downstream repository (aka a “fork”) maintainer commonly needs to stay current with upstream work (aka "original"). The case is development continues on the upstream
repo while you work on your own origin
fork. You want to fetch
the upstream changes and apply them to your origin
so you don't make conflicts.
The following steps allow you to achieve this on the command line in a local git repository.
// | |
// EXERCISE 4 | |
// | |
// Create a type class to describe `printLine` and `readLine`. | |
// | |
trait Console[F[_]] { | |
def printLine(line: String): F[Unit] | |
def readLine: F[String] | |
} |
import scala.annotation.tailrec | |
/** | |
* A Type-aligned list is a list of functions which can be | |
* chained together. They are "type-aligned" because their | |
* types all line. For example, suppose you have the following | |
* functions: | |
* | |
* val foo: Int => String = i => i.toString | |
* val bar: String => Char = s => s.head |
running:
bash create-vod-hls.sh beach.mkv
will produce:
beach/
|- playlist.m3u8
|- 360p.m3u8
The following are examples of the four types rate limiters discussed in the accompanying blog post. In the examples below I've used pseudocode-like Ruby, so if you're unfamiliar with Ruby you should be able to easily translate this approach to other languages. Complete examples in Ruby are also provided later in this gist.
In most cases you'll want all these examples to be classes, but I've used simple functions here to keep the code samples brief.
This uses a basic token bucket algorithm and relies on the fact that Redis scripts execute atomically. No other operations can run between fetching the count and writing the new count.