I hereby claim:
- I am analytically on github.
- I am analytically (https://keybase.io/analytically) on keybase.
- I have a public key whose fingerprint is 6560 B522 27E1 4A62 A9A0 4685 FB67 7394 51EC 486A
To claim this, I am signing this object:
import cc.spray.typeconversion.{DefaultMarshallers, SimpleMarshaller, SimpleUnmarshaller, DefaultUnmarshallers} | |
import com.thoughtworks.xstream.XStream | |
import com.thoughtworks.xstream.io.xml.StaxDriver | |
import cc.spray.http._ | |
import MediaTypes._ | |
import HttpCharsets._ | |
import cc.spray.json._ | |
import cc.spray.SprayBaseSettings | |
import cc.spray.http.ContentTypeRange |
def rateLimit(action: String, subject: String, maxRequests: Int) = { | |
val key = action + ":" + subject | |
add(redis, key) | |
val actionCount = count(redis, key, interval) | |
transformRequestContext { | |
ctx => | |
ctx.withResponseTransformed { | |
response => |
def rateLimit(action: => String, subject: => String, maxRequests: => Int): Directive0 = { | |
mapInnerRoute { | |
inner => ctx => | |
val key = action + ":" + subject | |
add(redis, key) | |
val actionCount = count(redis, key, interval) | |
if (actionCount >= maxRequests) { | |
logger.warn("Rate limiting user '" + subject + "': exceeded max number of requests (" + maxRequests + ").") |
I hereby claim:
To claim this, I am signing this object:
A curated list of AWS resources to prepare for the AWS Certifications
A curated list of awesome AWS resources you need to prepare for the all 5 AWS Certifications. This gist will include: open source repos, blogs & blogposts, ebooks, PDF, whitepapers, video courses, free lecture, slides, sample test and many other resources.
Index:
#!/bin/bash | |
set -e | |
sudo rm -f /etc/update-motd.d/10-help-text | |
sudo rm -f /etc/update-motd.d/51-cloudguest | |
sudo rm -f /etc/update-motd.d/91-release-upgrade | |
echo -e "[sysinfo]\nexclude_sysinfo_plugins = LandscapeLink" | sudo tee /etc/landscape/client.conf | |
echo deb https://get.docker.com/ubuntu docker main | sudo tee /etc/apt/sources.list.d/docker.list | |
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9 |
# {{ ansible_managed }} | |
# This file describes the network interfaces available on your system | |
# and how to activate them. For more information, see interfaces(5). | |
# The loopback network interface | |
auto lo | |
iface lo inet loopback | |
{% if ansible_interfaces|length > 2 %} |
# {{ ansible_managed }} | |
# This file describes the network interfaces available on your system | |
# and how to activate them. For more information, see interfaces(5). | |
# The loopback network interface | |
auto lo | |
iface lo inet loopback | |
{% if ansible_interfaces|length > 2 %} |