This file contains 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
""" | |
sprockets.clients.botocore | |
========================== | |
Asynchronous wrapper for botocore for use with Tornado. This module | |
monkey-patches in a new :py:func:`botocore.session.get_session` method that | |
returns an instance of :py:class:`sprockets.clients.botocore.AsyncSession` that | |
applies request adapters that use | |
:py:class:`tornado.httpclient.AsyncHTTPClient` for all requests. You can | |
configure the maximum number of concurrent HTTP requests that can be made |
This file contains 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
"""The PublishingMixin wraps RabbitMQ use into a request handler, with | |
methods to speed the development of publishing RabbitMQ messages. | |
Configured using two environment variables: ``AMQP_URL`` and ``AMQP_TIMEOUT`` | |
``AMQP_URL`` is the AMQP url to connect to, defaults to | |
``amqp://guest:guest@localhost:5672/%2f``. | |
``AMQP_TIMEOUT`` is the number of seconds to wait until timing out when | |
connecting to RabbitMQ. |
This file contains 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
#!/bin/bash | |
cd $1 | |
hub fork | |
travis sync | |
travis enable -r gmr/$1 | |
git checkout -b travis-ci-testing | |
cp ../.travis.yml . | |
git add .travis.yml | |
git commit -m 'Add travis-ci configuration' .travis.yml | |
git push gmr travis-ci-testing |
This file contains 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
#!/usr/bin/bash | |
MAX_FAILURES=10 | |
LINES=1000 | |
DROPPED=`iptables -L INPUT -x -n | tail -n+3 | awk '{print $4}'` | |
already_blocked() { | |
local blocked | |
for blocked in ${2}; do | |
if [[ "$1" == "$blocked" ]]; then | |
return 0 |
This file contains 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
[Unit] | |
Description=MyService Service | |
After=docker.service | |
Requires=docker.service | |
Requires=consul.service | |
Requires=datadog-agent.service | |
Requires=memcached.service | |
[Service] | |
TimeoutStartSec=0 |
This file contains 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 rabbitpy | |
import threading | |
import time | |
# Event that we'll set to tell the consumer to stop | |
stop_event = threading.Event() | |
# Method that will be invoked in 15 seconds to set the event | |
def set_stop_event(): | |
print('Setting stop-event') |
This file contains 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
[Unit] | |
Description=Docker Registry | |
After=docker.service | |
Requires=docker.service | |
[Service] | |
TimeoutStartSec=0 | |
ExecStartPre=-/usr/bin/docker kill registry1 | |
ExecStartPre=-/usr/bin/docker rm registry1 | |
ExecStartPre=/usr/bin/docker pull registry |
This file contains 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
Custom TCP Rule | |
TCP | |
4369 | |
sg-8abf3dee (Riak) | |
Custom TCP Rule | |
TCP | |
6000 - 7999 | |
sg-8abf3dee (Riak) |
This file contains 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
%YAML 1.2 | |
--- | |
Items:{{with $hostname := env "HOSTNAME"}}{{with $items := printf "sample/assignments/%s" ($hostname) }}{{range key $items | parseJSON}} | |
{{.}}: | |
connections: {{range service "rabbitmq"}} | |
- {{.Node}}{{end}} | |
foo: {{with $foo := printf "sample/items/%s/foo" (.)}}{{ key $foo }}{{end}} | |
{{with $baz := printf "sample/items/%s" (.)}}tree-key: {{$baz}} | |
{{range $key, $pairs := tree $baz | byKey}}{{$key}}:{{range $pairs}} | |
{{.Key}}: {{.Value}}{{end}}{{end}}{{end}}{{end}}{{end}}{{end}} |
This file contains 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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
$primary = <<SCRIPT | |
su vagrant -c 'cd /opt/rabbitmq-in-depth;git pull origin master' | |
SCRIPT | |
$secondary = <<SCRIPT | |
# Join it to the primary cluster node | |
rabbitmqctl stop_app |