├── hubot ├── hubot │ ├── hubot-scripts.json │ ├── external-scripts.json │ └── scripts │ │ ├── devexcuse.coffee │ │ ├── hack.coffee │ │ ├── zombies.coffee │ │ ├── marvin-quotes.coffee │ │ ├── reverse-dns.coffee │ │ ├── python_library.coffee │ │ ├── gaye.coffee │ │ ├── stage.coffee │ │ ├── geolocate-ip.coffee │ │ ├── httpcat.coffee │ │ ├── code-name-generator.coffee │ │ ├── ackbar.coffee │ │ ├── newrelic.coffee │ │ ├── yoda-quotes.coffee │ │ ├── grumpycat.coffee │ │ ├── working-on.coffee │ │ ├── excuse.coffee │ │ ├── example.coffee │ │ ├── sensu.coffee │ │ └── emoji-me.coffee ├── README.md └── Dockerfile ├── .gitignore ├── logstash-forwarder ├── config-example │ ├── etc │ │ └── logstash-forwarder │ │ │ ├── server.crt │ │ │ ├── run.sh │ │ │ └── logstash-forwarder-config.json │ ├── Dockerfile │ └── README.md ├── makefile ├── builder │ ├── docker-compose.yml │ ├── logstash-forwarder_0.4.0_amd64.deb │ ├── README.md │ └── Dockerfile ├── Dockerfile └── README.md ├── makefile ├── base ├── build │ ├── nginx │ │ ├── nginx_php_fcgi │ │ │ ├── Dockerfile │ │ │ ├── Makefile │ │ │ └── files │ │ │ │ └── etc │ │ │ │ └── nginx │ │ │ │ └── sites-enabled │ │ │ │ └── php-fcgi │ │ ├── nginx_redirect_to_http │ │ │ ├── files │ │ │ │ └── etc │ │ │ │ │ └── nginx │ │ │ │ │ └── sites-enabled │ │ │ │ │ └── http_to_https │ │ │ ├── Dockerfile │ │ │ └── Makefile │ │ ├── nginx_redirect_to_https │ │ │ ├── files │ │ │ │ └── etc │ │ │ │ │ └── nginx │ │ │ │ │ └── sites-enabled │ │ │ │ │ └── http_to_https │ │ │ ├── Dockerfile │ │ │ └── Makefile │ │ ├── Dockerfile │ │ └── Makefile │ ├── php │ │ ├── 5.6 │ │ │ ├── peru.yaml │ │ │ ├── fpm │ │ │ │ ├── peru.yaml │ │ │ │ ├── composer │ │ │ │ │ ├── Makefile │ │ │ │ │ └── Dockerfile │ │ │ │ ├── docker-php-ext-configure │ │ │ │ ├── Makefile │ │ │ │ ├── docker-php-ext-install │ │ │ │ ├── docker-php-ext-enable │ │ │ │ └── Dockerfile │ │ │ ├── composer │ │ │ │ ├── Makefile │ │ │ │ └── Dockerfile │ │ │ ├── docker-php-ext-configure │ │ │ ├── Makefile │ │ │ ├── docker-php-ext-install │ │ │ ├── docker-php-ext-enable │ │ │ └── Dockerfile │ │ └── Makefile │ ├── README.md │ ├── Makefile │ └── Dockerfile ├── Makefile ├── README.md └── Dockerfile ├── go-slackjira ├── Dockerfile └── README.md ├── kibana ├── README.md └── Dockerfile ├── elastic_search ├── README.md └── Dockerfile ├── java ├── makefile ├── peru.yaml ├── README.md └── Dockerfile ├── elastic_search_plugins ├── README.md └── Dockerfile ├── peru.yaml ├── graphite_carbon_cache └── Dockerfile ├── README.md ├── tests ├── all.sh ├── update-all.sh ├── build-cascade.sh └── clean-cascade.sh ├── graphite_carbon_relay ├── Dockerfile └── relay-rules.conf ├── py-ssj ├── README.md └── Dockerfile ├── annona ├── Dockerfile └── README.md ├── python └── Dockerfile ├── logstash-server ├── README.md └── Dockerfile ├── git_client ├── Dockerfile └── README.md ├── redis ├── README.md └── Dockerfile ├── graphite_web ├── Dockerfile └── local_settintgs.py.example ├── sshuttle └── Dockerfile ├── graphite_carbon └── Dockerfile ├── uml.sh └── LICENSE /hubot/hubot/hubot-scripts.json: -------------------------------------------------------------------------------- 1 | [] -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .peru 2 | *.swp 3 | *.SyncOld 4 | -------------------------------------------------------------------------------- /logstash-forwarder/config-example/etc/logstash-forwarder/server.crt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /logstash-forwarder/makefile: -------------------------------------------------------------------------------- 1 | all: 2 | cd builder && docker-compose run logstashforwarderbuilder 3 | docker build . 4 | -------------------------------------------------------------------------------- /makefile: -------------------------------------------------------------------------------- 1 | all: 2 | peru reup -f 3 | peru sync 4 | sed -i "s/^docker run .*/docker build \./" uml.sh # build docker image 5 | -------------------------------------------------------------------------------- /logstash-forwarder/builder/docker-compose.yml: -------------------------------------------------------------------------------- 1 | logstashforwarderbuilder: 2 | build: . 3 | volumes: 4 | - ./:/build/ 5 | 6 | -------------------------------------------------------------------------------- /base/build/nginx/nginx_php_fcgi/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM rounds/10m-nginx 2 | 3 | ADD files/etc /etc 4 | 5 | # Only http port is used 6 | EXPOSE 80 7 | -------------------------------------------------------------------------------- /go-slackjira/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM rounds/10m-build-go 2 | 3 | RUN go get github.com/rounds/go-slackjira 4 | 5 | CMD cd /root/go/bin/ && ./go-slackjira 6 | -------------------------------------------------------------------------------- /base/build/nginx/nginx_redirect_to_http/files/etc/nginx/sites-enabled/http_to_https: -------------------------------------------------------------------------------- 1 | server { 2 | listen 443; 3 | return 301 http://$host$request_uri; 4 | } 5 | -------------------------------------------------------------------------------- /base/build/nginx/nginx_redirect_to_https/files/etc/nginx/sites-enabled/http_to_https: -------------------------------------------------------------------------------- 1 | server { 2 | listen 80; 3 | return 301 https://$host$request_uri; 4 | } 5 | -------------------------------------------------------------------------------- /kibana/README.md: -------------------------------------------------------------------------------- 1 | [![](https://badge.imagelayers.io/rounds/10m-kibana:latest.svg)](https://imagelayers.io/?images=rounds/10m-kibana:latest 'Get your own badge on imagelayers.io') 2 | -------------------------------------------------------------------------------- /logstash-forwarder/builder/logstash-forwarder_0.4.0_amd64.deb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zendesk/10M-Docker-Images/master/logstash-forwarder/builder/logstash-forwarder_0.4.0_amd64.deb -------------------------------------------------------------------------------- /base/build/nginx/nginx_redirect_to_http/Dockerfile: -------------------------------------------------------------------------------- 1 | # Nginx to redirect https -> http 2 | FROM rounds/10m-nginx 3 | 4 | ADD files/etc /etc 5 | 6 | # Only http port is used 7 | EXPOSE 80 8 | -------------------------------------------------------------------------------- /base/build/nginx/nginx_redirect_to_https/Dockerfile: -------------------------------------------------------------------------------- 1 | # Nginx to redirect http -> https 2 | FROM rounds/10m-nginx 3 | 4 | ADD files/etc /etc 5 | 6 | # Only http port is used 7 | EXPOSE 80 8 | -------------------------------------------------------------------------------- /elastic_search/README.md: -------------------------------------------------------------------------------- 1 | [![](https://badge.imagelayers.io/rounds/10m-elastic-search:latest.svg)](https://imagelayers.io/?images=rounds/10m-elastic-search:latest 'Get your own badge on imagelayers.io') 2 | -------------------------------------------------------------------------------- /logstash-forwarder/config-example/etc/logstash-forwarder/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | /opt/logstash-forwarder/bin/logstash-forwarder -config /etc/logstash-forwarder/logstash-forwarder-config.json -spool-size 100 3 | -------------------------------------------------------------------------------- /java/makefile: -------------------------------------------------------------------------------- 1 | all: 2 | peru reup -f 3 | peru sync 4 | mv oracle-java8/Dockerfile ./Dockerfile 5 | rmdir oracle-java8 6 | sed -i "s/^FROM .*/FROM rounds\/10m-build/" Dockerfile # Inherit from our own base docker 7 | -------------------------------------------------------------------------------- /logstash-forwarder/config-example/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM rounds/10m-logstash-forwarder 2 | MAINTAINER Ofir Petrushka ROUNDS 3 | 4 | # Config config files 5 | COPY etc/logstash-forwarder/* /etc/logstash-forwarder/ 6 | -------------------------------------------------------------------------------- /elastic_search_plugins/README.md: -------------------------------------------------------------------------------- 1 | [![](https://badge.imagelayers.io/rounds/10m-elastic-search-plugins:latest.svg)](https://imagelayers.io/?images=rounds/10m-elastic-search-plugins:latest 'Get your own badge on imagelayers.io') 2 | -------------------------------------------------------------------------------- /java/peru.yaml: -------------------------------------------------------------------------------- 1 | imports: 2 | java-dockerfile: . 3 | 4 | git module java-dockerfile: 5 | url: git@github.com:dockerfile/java.git 6 | files: oracle-java8/Dockerfile 7 | rev: 926218ef9b5b6c83bb07aae9a0aaa2ba118f6372 8 | -------------------------------------------------------------------------------- /peru.yaml: -------------------------------------------------------------------------------- 1 | imports: 2 | travis-docker-example: ./ 3 | 4 | git module travis-docker-example: 5 | url: https://github.com/lukecyca/travis-docker-example 6 | pick: uml.sh 7 | rev: cdf898185b4868cfb9d71bddf33c9ceb0778abd0 8 | -------------------------------------------------------------------------------- /graphite_carbon_cache/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM rounds/10m-graphite-carbon 2 | MAINTAINER Ofir Petrushka 3 | 4 | CMD /usr/bin/carbon-cache --nodaemon --config=/etc/carbon/carbon.conf --pidfile=/var/run/carbon-cache.pid --logdir=/var/log/carbon/ start 5 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![Build Status](https://travis-ci.org/rounds/10M-Docker-Images.svg?branch=master)](https://travis-ci.org/rounds/10M-Docker-Images) 2 | 3 | # 10M-Docker-images 4 | Please see wiki: 5 | https://github.com/rounds/10M-Docker-Images/wiki 6 | 7 | -------------------------------------------------------------------------------- /hubot/README.md: -------------------------------------------------------------------------------- 1 | [![](https://badge.imagelayers.io/rounds/10m-hubot:latest.svg)](https://imagelayers.io/?images=rounds/10m-hubot:latest 'Get your own badge on imagelayers.io') 2 | 3 | Hubot docker image 4 | ============================ 5 | 6 | Hubot docker image. 7 | -------------------------------------------------------------------------------- /base/build/php/5.6/peru.yaml: -------------------------------------------------------------------------------- 1 | imports: 2 | php-dockerfile: . 3 | 4 | git module php-dockerfile: 5 | url: git@github.com:docker-library/php.git 6 | pick: 7 | - 5.6/Dockerfile 8 | - 5.6/docker-php-ext* 9 | rev: 1da4310f6c3b86f7acf32b2350de3657e64e440f 10 | -------------------------------------------------------------------------------- /tests/all.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Setup 4 | ORIGINAL_DIR=`pwd` 5 | SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 6 | cd $SCRIPT_DIR 7 | 8 | ./update-all.sh 9 | ./build-cascade.sh 10 | ./clean-cascade.sh 11 | 12 | # back to where we were 13 | cd $ORIGINAL_DIR 14 | -------------------------------------------------------------------------------- /base/build/php/5.6/fpm/peru.yaml: -------------------------------------------------------------------------------- 1 | imports: 2 | php-dockerfile: . 3 | 4 | git module php-dockerfile: 5 | url: git@github.com:docker-library/php.git 6 | pick: 7 | - 5.6/fpm/Dockerfile 8 | - 5.6/fpm/docker-php-ext* 9 | rev: 5919c607c571c03b52996a92d3d0b809674d3ace 10 | -------------------------------------------------------------------------------- /graphite_carbon_relay/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM rounds/10m-graphite-carbon 2 | MAINTAINER Ofir Petrushka 3 | 4 | COPY relay-rules.conf /etc/carbon/relay-rules.conf 5 | 6 | CMD /usr/bin/carbon-relay --nodaemon --config=/etc/carbon/carbon.conf --pidfile=/var/run/carbon-relay.pid --logdir=/var/log/carbon/ start 7 | -------------------------------------------------------------------------------- /java/README.md: -------------------------------------------------------------------------------- 1 | [![](https://badge.imagelayers.io/rounds/10m-java:latest.svg)](https://imagelayers.io/?images=rounds/10m-java:latest 'Get your own badge on imagelayers.io') 2 | 3 | 10M JAVA Docker 4 | =============== 5 | 6 | 10M JAVA docker - for dockers needing a jvm 7 | 8 | 99% not our code, Run make to update! 9 | -------------------------------------------------------------------------------- /py-ssj/README.md: -------------------------------------------------------------------------------- 1 | [![](https://badge.imagelayers.io/rounds/10m-go-py-ssj:latest.svg)](https://imagelayers.io/?images=rounds/10m-py-ssj:latest 'Get your own badge on imagelayers.io') 2 | 3 | #py-ssj docker image 4 | ============================ 5 | 6 | py-ssj docker image. 7 | 8 | Slack slash commands for Jira interactions 9 | -------------------------------------------------------------------------------- /py-ssj/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM rounds/10m-python 2 | MAINTAINER Aviv Laufer 3 | 4 | 5 | RUN apt-get update && \ 6 | apt-get install -y git 7 | 8 | 9 | RUN cd /root/ && git clone https://github.com/rounds/py-ssj.git 10 | RUN cd /root/py-ssj && pip install -r requirements.txt 11 | 12 | CMD cd /root/py-ssj && python py-ssj.py 13 | -------------------------------------------------------------------------------- /annona/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM rounds/10m-build-go 2 | RUN apt-get update && \ 3 | apt-get install wget 4 | 5 | RUN go get github.com/rounds/annona 6 | 7 | EXPOSE 5000 8 | 9 | RUN wget -O /root/go/bin/avatars.json https://raw.githubusercontent.com/rounds/annona/master/avatars.json 10 | 11 | CMD cd /root/go/bin/ && ./annona 12 | 13 | -------------------------------------------------------------------------------- /go-slackjira/README.md: -------------------------------------------------------------------------------- 1 | [![](https://badge.imagelayers.io/rounds/10m-go-slackjira:latest.svg)](https://imagelayers.io/?images=rounds/10m-go-slackjira:latest 'Get your own badge on imagelayers.io') 2 | 3 | #go-slackjira docker image 4 | ============================ 5 | 6 | go-slackjira docker image. 7 | 8 | Jira issue name expender for Slack 9 | -------------------------------------------------------------------------------- /base/build/README.md: -------------------------------------------------------------------------------- 1 | [![](https://badge.imagelayers.io/rounds/10m-build:latest.svg)](https://imagelayers.io/?images=rounds/10m-build:latest 'Get your own badge on imagelayers.io') 2 | 3 | # 10M Build Docker 4 | 5 | Common build tools for dockers that need to compile / build an executable. 6 | Per language build containers should inherit from it. 7 | -------------------------------------------------------------------------------- /python/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM rounds/10m-base 2 | MAINTAINER Ory Band @ Rounds 3 | 4 | # install python, setuptools, pip 5 | RUN \ 6 | apt-get update && \ 7 | apt-get install -y python python-setuptools python-pip && \ 8 | pip install --upgrade pip && \ 9 | apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* 10 | -------------------------------------------------------------------------------- /annona/README.md: -------------------------------------------------------------------------------- 1 | [![](https://badge.imagelayers.io/rounds/10m-anonna:latest.svg)](https://imagelayers.io/?images=rounds/10m-annona:latest 'Get your own badge on imagelayers.io') 2 | 3 | #Anonna docker image 4 | ============================ 5 | 6 | Annona docker image. 7 | 8 | A service for posting anonymous messages to a Slack channel 9 | 10 | -------------------------------------------------------------------------------- /base/build/php/Makefile: -------------------------------------------------------------------------------- 1 | all: 2 | echo 'Usage: see https://github.com/rounds/10M-Docker-Images/blob/master/base/README.md' 3 | 4 | build-parent: 5 | $(MAKE) -C .. build-cascade 6 | 7 | build-cascade: build-parent 8 | 9 | clean: 10 | 11 | clean-parent: 12 | $(MAKE) -C .. clean-cascade 13 | 14 | clean-cascade: clean clean-parent 15 | 16 | run: 17 | -------------------------------------------------------------------------------- /tests/update-all.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Setup 4 | ORIGINAL_DIR=`pwd` 5 | SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 6 | cd $SCRIPT_DIR/.. 7 | 8 | # Future add here more tests 9 | cd base/build/php/5.6/ 10 | make update 11 | cd $SCRIPT_DIR/.. 12 | cd base/build/php/5.6/fpm/ 13 | make update 14 | 15 | # back to where we were 16 | cd $ORIGINAL_DIR 17 | -------------------------------------------------------------------------------- /logstash-server/README.md: -------------------------------------------------------------------------------- 1 | [![](https://badge.imagelayers.io/rounds/10m-logstash-server:latest.svg)](https://imagelayers.io/?images=rounds/10m-logstash-server:latest 'Get your own badge on imagelayers.io') 2 | 3 | Logstash server docker image 4 | ============================ 5 | 6 | Logstash server docker image. 7 | This assumes /etc/logstash/ config files (/etc/logstash/logstash.conf is explicitly loaded). 8 | -------------------------------------------------------------------------------- /base/Makefile: -------------------------------------------------------------------------------- 1 | IMAGE_NAME=rounds/10m-base 2 | 3 | all: 4 | echo 'Usage: see https://github.com/rounds/10M-Docker-Images/blob/master/base/README.md' 5 | 6 | .build: 7 | docker build --tag "$(IMAGE_NAME)" . 8 | 9 | build: .build 10 | 11 | build-cascade: build 12 | 13 | clean: 14 | docker rmi -f $(IMAGE_NAME) 15 | 16 | clean-cascade: clean 17 | 18 | run: 19 | docker run --rm -it $(IMAGE_NAME) bash 20 | -------------------------------------------------------------------------------- /git_client/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM rounds/10m-base 2 | MAINTAINER Ofir Petrushka ROUNDS 3 | 4 | # Generic (should be in base images if this issue https://github.com/docker/docker/issues/3639 is ever resolved) 5 | VOLUME ["/var/log"] 6 | 7 | RUN apt-get update && \ 8 | apt-get install -y git && \ 9 | apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* 10 | 11 | ENTRYPOINT ["git"] 12 | -------------------------------------------------------------------------------- /hubot/hubot/external-scripts.json: -------------------------------------------------------------------------------- 1 | [ 2 | "hubot-diagnostics", 3 | "hubot-help", 4 | "hubot-google-images", 5 | "hubot-google-translate", 6 | "hubot-pugme", 7 | "hubot-maps", 8 | "hubot-redis-brain", 9 | "hubot-rules", 10 | "hubot-shipit", 11 | "hubot-youtube", 12 | "hubot-devops-reactions", 13 | "hubot-standup-alarm", 14 | "hubot-alias", 15 | "hubot-seen", 16 | "hubot-has-no-idea" 17 | 18 | ] 19 | -------------------------------------------------------------------------------- /redis/README.md: -------------------------------------------------------------------------------- 1 | [![](https://badge.imagelayers.io/rounds/10m-redis:latest.svg)](https://imagelayers.io/?images=rounds/10m-redis:latest 'Get your own badge on imagelayers.io') 2 | 3 | Redis server docker image 4 | ============================ 5 | 6 | Redis server docker image. 7 | Minimal redis installtion. Main usage is for Hubot brain 8 | run it with shared data dir 9 | docker run --name redis -v /datat/redis:/data -d rounds/10m-redis 10 | -------------------------------------------------------------------------------- /graphite_web/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM rounds/10m-python 2 | MAINTAINER Ofir Petrushka 3 | 4 | RUN \ 5 | apt-get update && \ 6 | apt-get install -y graphite-web gunicorn && \ 7 | rm -fr /var/lib/apt/lists/* 8 | 9 | COPY local_settintgs.py.example /etc/graphite/local_settings.py 10 | 11 | RUN python /usr/lib/python2.7/dist-packages/graphite/manage.py syncdb --noinput 12 | 13 | CMD gunicorn_django -b 0.0.0.0:80 /usr/lib/python2.7/dist-packages/graphite/settings.py 14 | -------------------------------------------------------------------------------- /kibana/Dockerfile: -------------------------------------------------------------------------------- 1 | # 2 | # Ubuntu Dockerfile 3 | # 4 | # https://github.com/dockerfile/ubuntu 5 | # 6 | 7 | # Pull base image. 8 | FROM rounds/10m-base 9 | 10 | WORKDIR /opt 11 | 12 | # Install. 13 | RUN \ 14 | cd /opt && \ 15 | wget -q https://download.elastic.co/kibana/kibana/kibana-4.1.2-linux-x64.tar.gz && \ 16 | tar xvfz kibana-*.tar.gz && \ 17 | rm kibana-*.tar.gz 18 | 19 | EXPOSE 5601 20 | 21 | # Define default command. 22 | CMD cd kibana*/bin && ./kibana 23 | -------------------------------------------------------------------------------- /tests/build-cascade.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Setup 4 | ORIGINAL_DIR=`pwd` 5 | SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 6 | 7 | cd $SCRIPT_DIR/.. 8 | cd base/build/php/5.6/composer/ 9 | make build-cascade 10 | 11 | cd $SCRIPT_DIR/.. 12 | cd base/build/php/5.6/fpm/composer/ 13 | make build-cascade 14 | 15 | cd $SCRIPT_DIR/.. 16 | cd base/build/nginx/nginx_redirect_to_ssl 17 | make build-cascade 18 | 19 | # back to where we were 20 | cd $ORIGINAL_DIR 21 | -------------------------------------------------------------------------------- /tests/clean-cascade.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Setup 4 | ORIGINAL_DIR=`pwd` 5 | SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 6 | 7 | # composer 8 | cd $SCRIPT_DIR/.. 9 | cd base/build/php/5.6/composer/ 10 | make clean-cascade 11 | 12 | cd $SCRIPT_DIR/.. 13 | cd base/build/php/5.6/fpm/composer/ 14 | make clean-cascade 15 | 16 | cd $SCRIPT_DIR/.. 17 | cd base/build/nginx/nginx_redirect_to_ssl 18 | make clean-cascade 19 | 20 | # back to where we were 21 | cd $ORIGINAL_DIR 22 | -------------------------------------------------------------------------------- /hubot/hubot/scripts/devexcuse.coffee: -------------------------------------------------------------------------------- 1 | # Description: 2 | # Dev excuses scraper. From http://developerexcuses.com/ 3 | # 4 | # Dependencies: 5 | # 6 | # "cheerio": "~0.12.0" 7 | # 8 | # Commands: 9 | # hubot excuse me 10 | 11 | cheerio = require 'cheerio' 12 | 13 | module.exports = (robot) -> 14 | robot.respond /excuse me/i, (msg) -> 15 | robot.http("http://developerexcuses.com/") 16 | .get() (err, res, body) -> 17 | $ = cheerio.load(body) 18 | 19 | msg.send $('.wrapper a').text() -------------------------------------------------------------------------------- /base/build/nginx/Dockerfile: -------------------------------------------------------------------------------- 1 | # Pull base image. 2 | FROM rounds/10m-build 3 | 4 | # Install. 5 | RUN \ 6 | add-apt-repository ppa:nginx/stable && \ 7 | apt-get update && \ 8 | apt-get install -y nginx && \ 9 | rm -rf /var/lib/apt/lists/* 10 | 11 | # Disable Default website 12 | RUN rm /etc/nginx/sites-enabled/default 13 | 14 | # Disable self-daemonize 15 | RUN echo "daemon off;" >> /etc/nginx/nginx.conf 16 | 17 | EXPOSE 80 443 18 | 19 | # Define default command. 20 | CMD mkdir -p /var/log/nginx; nginx 21 | -------------------------------------------------------------------------------- /base/build/Makefile: -------------------------------------------------------------------------------- 1 | IMAGE_NAME=rounds/10m-build 2 | 3 | all: 4 | echo 'Usage: see https://github.com/rounds/10M-Docker-Images/blob/master/base/README.md' 5 | 6 | build: 7 | docker build --tag "$(IMAGE_NAME)" . 8 | 9 | build-parent: 10 | $(MAKE) -C .. build-cascade 11 | 12 | build-cascade: build-parent build 13 | 14 | clean: 15 | docker rmi -f $(IMAGE_NAME) 16 | 17 | clean-parent: 18 | $(MAKE) -C .. clean-cascade 19 | 20 | clean-cascade: clean clean-parent 21 | 22 | run: 23 | docker run --rm -it $(IMAGE_NAME) bash 24 | -------------------------------------------------------------------------------- /base/build/nginx/Makefile: -------------------------------------------------------------------------------- 1 | IMAGE_NAME=rounds/10m-nginx 2 | 3 | all: 4 | echo 'Usage: see https://github.com/rounds/10M-Docker-Images/blob/master/base/README.md' 5 | 6 | build: 7 | docker build --tag "$(IMAGE_NAME)" . 8 | 9 | build-parent: 10 | $(MAKE) -C .. build-cascade 11 | 12 | build-cascade: build-parent build 13 | 14 | clean: 15 | docker rmi -f $(IMAGE_NAME) 16 | 17 | clean-parent: 18 | $(MAKE) -C .. clean-cascade 19 | 20 | clean-cascade: clean clean-parent 21 | 22 | run: 23 | docker run --rm -it $(IMAGE_NAME) bash 24 | -------------------------------------------------------------------------------- /base/build/nginx/nginx_php_fcgi/Makefile: -------------------------------------------------------------------------------- 1 | IMAGE_NAME=rounds/10m-nginx-php-fcgi 2 | 3 | all: 4 | echo 'Usage: see https://github.com/rounds/10M-Docker-Images/blob/master/base/README.md' 5 | 6 | build: 7 | docker build --tag "$(IMAGE_NAME)" . 8 | 9 | build-parent: 10 | $(MAKE) -C .. build-cascade 11 | 12 | build-cascade: build-parent build 13 | 14 | clean: 15 | docker rmi -f $(IMAGE_NAME) 16 | 17 | clean-parent: 18 | $(MAKE) -C .. clean-cascade 19 | 20 | clean-cascade: clean clean-parent 21 | 22 | run: 23 | docker run --rm -it $(IMAGE_NAME) bash 24 | -------------------------------------------------------------------------------- /base/build/php/5.6/composer/Makefile: -------------------------------------------------------------------------------- 1 | IMAGE_NAME=rounds/10m-php-composer:5.6 2 | 3 | all: 4 | echo 'Usage: see https://github.com/rounds/10M-Docker-Images/blob/master/base/README.md' 5 | 6 | build: 7 | docker build --tag "$(IMAGE_NAME)" . 8 | 9 | build-parent: 10 | $(MAKE) -C .. build-cascade 11 | 12 | build-cascade: build-parent build 13 | 14 | clean: 15 | docker rmi -f $(IMAGE_NAME) 16 | 17 | clean-parent: 18 | $(MAKE) -C .. clean-cascade 19 | 20 | clean-cascade: clean clean-parent 21 | 22 | run: 23 | docker run --rm -it $(IMAGE_NAME) bash 24 | -------------------------------------------------------------------------------- /base/build/php/5.6/fpm/composer/Makefile: -------------------------------------------------------------------------------- 1 | IMAGE_NAME=rounds/10m-php-fpm-composer:5.6 2 | 3 | all: 4 | echo 'Usage: see https://github.com/rounds/10M-Docker-Images/blob/master/base/README.md' 5 | 6 | build: 7 | docker build --tag "$(IMAGE_NAME)" . 8 | 9 | build-parent: 10 | $(MAKE) -C .. build-cascade 11 | 12 | build-cascade: build-parent build 13 | 14 | clean: 15 | docker rmi -f $(IMAGE_NAME) 16 | 17 | clean-parent: 18 | $(MAKE) -C .. clean-cascade 19 | 20 | clean-cascade: clean clean-parent 21 | 22 | run: 23 | docker run --rm -it $(IMAGE_NAME) bash 24 | -------------------------------------------------------------------------------- /base/build/nginx/nginx_redirect_to_http/Makefile: -------------------------------------------------------------------------------- 1 | IMAGE_NAME=rounds/10m-nginx-redirect-to-http 2 | 3 | all: 4 | echo 'Usage: see https://github.com/rounds/10M-Docker-Images/blob/master/base/README.md' 5 | 6 | build: 7 | docker build --tag "$(IMAGE_NAME)" . 8 | 9 | build-parent: 10 | $(MAKE) -C .. build-cascade 11 | 12 | build-cascade: build-parent build 13 | 14 | clean: 15 | docker rmi -f $(IMAGE_NAME) 16 | 17 | clean-parent: 18 | $(MAKE) -C .. clean-cascade 19 | 20 | clean-cascade: clean clean-parent 21 | 22 | run: 23 | docker run --rm -it $(IMAGE_NAME) bash 24 | -------------------------------------------------------------------------------- /logstash-forwarder/config-example/etc/logstash-forwarder/logstash-forwarder-config.json: -------------------------------------------------------------------------------- 1 | { 2 | "network": { 3 | "servers": [ "logs.example.com:12346" ], 4 | "ssl ca": "/etc/logstash-forwarder/server.crt", 5 | "timeout": 300 6 | }, 7 | "files": [ 8 | { 9 | "dead time": "10m", 10 | "paths": [ 11 | "/var/log/*", 12 | "/var/log/*/*" 13 | ], 14 | "fields": { 15 | "environment": "production" 16 | } 17 | } 18 | ] 19 | } 20 | -------------------------------------------------------------------------------- /base/build/nginx/nginx_redirect_to_https/Makefile: -------------------------------------------------------------------------------- 1 | IMAGE_NAME=rounds/10m-nginx-redirect-to-https 2 | 3 | all: 4 | echo 'Usage: see https://github.com/rounds/10M-Docker-Images/blob/master/base/README.md' 5 | 6 | build: 7 | docker build --tag "$(IMAGE_NAME)" . 8 | 9 | build-parent: 10 | $(MAKE) -C .. build-cascade 11 | 12 | build-cascade: build-parent build 13 | 14 | clean: 15 | docker rmi -f $(IMAGE_NAME) 16 | 17 | clean-parent: 18 | $(MAKE) -C .. clean-cascade 19 | 20 | clean-cascade: clean clean-parent 21 | 22 | run: 23 | docker run --rm -it $(IMAGE_NAME) bash 24 | -------------------------------------------------------------------------------- /elastic_search/Dockerfile: -------------------------------------------------------------------------------- 1 | # 2 | # Ubuntu Dockerfile 3 | # 4 | # https://github.com/dockerfile/ubuntu 5 | # 6 | 7 | # Pull base image. 8 | FROM rounds/10m-java 9 | 10 | # Install. 11 | RUN \ 12 | wget -qO - https://packages.elastic.co/GPG-KEY-elasticsearch | apt-key add - && \ 13 | echo "deb http://packages.elastic.co/elasticsearch/1.5/debian stable main" | tee -a /etc/apt/sources.list && \ 14 | apt-get update && \ 15 | apt-get install -y elasticsearch && \ 16 | rm -rf /var/lib/apt/lists/* 17 | 18 | # Define default command. 19 | CMD ["/usr/share/elasticsearch/bin/elasticsearch"] 20 | -------------------------------------------------------------------------------- /hubot/hubot/scripts/hack.coffee: -------------------------------------------------------------------------------- 1 | # Description: 2 | # None 3 | # 4 | # Dependencies: 5 | # None 6 | # 7 | # Configuration: 8 | # None 9 | # 10 | # Commands: 11 | # it's a trap - Display an Admiral Ackbar piece of wonder 12 | # 13 | # Author: 14 | # brilliantfantastic 15 | 16 | stages = [ 17 | "http://www.dvarhamefarsem.co.il/Hot/130573/Rashit.jpg" 18 | "https://fbcdn-sphotos-b-a.akamaihd.net/hphotos-ak-xfp1/t31.0-8/10272762_291185964390175_423323458311162901_o.jpg?dl=1" 19 | ] 20 | 21 | module.exports = (robot) -> 22 | robot.hear /hack/i, (msg) -> 23 | msg.send msg.random stages 24 | -------------------------------------------------------------------------------- /base/build/php/5.6/docker-php-ext-configure: -------------------------------------------------------------------------------- 1 | # *** DO NOT EDIT THIS FILE MANUALLY *** 2 | # *** Will be overwritten by 'make update' *** 3 | #!/bin/bash 4 | set -e 5 | 6 | ext="$1" 7 | extDir="/usr/src/php/ext/$ext" 8 | if [ -z "$ext" -o ! -d "$extDir" ]; then 9 | echo >&2 "usage: $0 ext-name [configure flags]" 10 | echo >&2 " ie: $0 gd --with-jpeg-dir=/usr/local/something" 11 | echo >&2 12 | echo >&2 'Possible values for ext-name:' 13 | echo >&2 $(find /usr/src/php/ext -mindepth 2 -maxdepth 2 -type f -name 'config.m4' | cut -d/ -f6 | sort) 14 | exit 1 15 | fi 16 | shift 17 | 18 | set -x 19 | cd "$extDir" 20 | phpize 21 | ./configure "$@" 22 | -------------------------------------------------------------------------------- /base/build/php/5.6/fpm/docker-php-ext-configure: -------------------------------------------------------------------------------- 1 | # *** DO NOT EDIT THIS FILE MANUALLY *** 2 | # *** Will be overwritten by 'make update' *** 3 | #!/bin/bash 4 | set -e 5 | 6 | ext="$1" 7 | extDir="/usr/src/php/ext/$ext" 8 | if [ -z "$ext" -o ! -d "$extDir" ]; then 9 | echo >&2 "usage: $0 ext-name [configure flags]" 10 | echo >&2 " ie: $0 gd --with-jpeg-dir=/usr/local/something" 11 | echo >&2 12 | echo >&2 'Possible values for ext-name:' 13 | echo >&2 $(find /usr/src/php/ext -mindepth 2 -maxdepth 2 -type f -name 'config.m4' | cut -d/ -f6 | sort) 14 | exit 1 15 | fi 16 | shift 17 | 18 | set -x 19 | cd "$extDir" 20 | phpize 21 | ./configure "$@" 22 | -------------------------------------------------------------------------------- /sshuttle/Dockerfile: -------------------------------------------------------------------------------- 1 | # This image would sshuttle a mini vpn for a single ip that also equals the remote machine ip 2 | # You would need to add a private ssh key to it. 3 | # Run this image with --cap-add NET_ADMIN 4 | 5 | # Pull base image. 6 | FROM rounds/10m-base 7 | 8 | # Install. 9 | RUN \ 10 | apt-get update && \ 11 | apt-get install -y sshuttle python && \ 12 | rm -rf /var/lib/apt/lists/* 13 | 14 | # Define default command. 15 | # Set REMOTE_IP, REMOTE_USER, LOCAL_IP env variable on docker run using -e 16 | # docker run -e "REMOTE_IP=x.x.x.x" -e "REMOTE_USER=ubuntu" -e "LOCAL_IP=x.x.x.x" 17 | CMD sshuttle -r $REMOTE_USER@$REMOTE_IP $LOCAL_IP/32 18 | -------------------------------------------------------------------------------- /base/build/php/5.6/composer/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM rounds/10m-php:5.6 2 | MAINTAINER Ofir Petrushka @ Zendesk 3 | 4 | # Install composer package manager 5 | # https://getcomposer.org/download/ 6 | RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer 7 | 8 | # install mercurial for hg command 9 | RUN apt-get update && \ 10 | apt-get install -y mercurial && \ 11 | apt-get install -y php5-mcrypt php5-mysql && \ 12 | apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* 13 | 14 | RUN echo extension=$(dpkg -L php5-mcrypt | grep mcrypt.so) > /usr/local/etc/php/conf.d/mcrypt.ini 15 | -------------------------------------------------------------------------------- /base/build/php/5.6/fpm/composer/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM rounds/10m-php-fpm:5.6 2 | MAINTAINER Ofir Petrushka @ Zendesk 3 | 4 | # Install composer package manager 5 | # https://getcomposer.org/download/ 6 | RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer 7 | 8 | # install mercurial for hg command 9 | RUN apt-get update && \ 10 | apt-get install -y mercurial && \ 11 | apt-get install -y php5-mcrypt php5-mysql && \ 12 | apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* 13 | 14 | RUN echo extension=$(dpkg -L php5-mcrypt | grep mcrypt.so) > /usr/local/etc/php/conf.d/mcrypt.ini 15 | -------------------------------------------------------------------------------- /graphite_carbon/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM rounds/10m-python 2 | MAINTAINER Ofir Petrushka 3 | 4 | RUN \ 5 | apt-get update && \ 6 | apt-get install -y graphite-carbon && \ 7 | rm -fr /var/lib/apt/lists/* 8 | 9 | # No Deamon patch 10 | # https://github.com/graphite-project/carbon/commit/0d4407466d1a96765400cac0c1945108a34fbe80 11 | RUN curl https://raw.githubusercontent.com/graphite-project/carbon/0d4407466d1a96765400cac0c1945108a34fbe80/lib/carbon/util.py -o /usr/lib/python2.7/dist-packages/carbon/util.py 12 | RUN curl https://raw.githubusercontent.com/graphite-project/carbon/0d4407466d1a96765400cac0c1945108a34fbe80/lib/carbon/conf.py -o /usr/lib/python2.7/dist-packages/carbon/conf.py 13 | -------------------------------------------------------------------------------- /elastic_search_plugins/Dockerfile: -------------------------------------------------------------------------------- 1 | # 2 | # Ubuntu Dockerfile 3 | # 4 | # https://github.com/dockerfile/ubuntu 5 | # 6 | 7 | # Pull base image. 8 | FROM rounds/10m-elastic-search 9 | 10 | # Install Elastic Search plugins. 11 | RUN \ 12 | /usr/share/elasticsearch/bin/plugin --install royrusso/elasticsearch-HQ && \ 13 | /usr/share/elasticsearch/bin/plugin --install mobz/elasticsearch-head && \ 14 | /usr/share/elasticsearch/bin/plugin --install lmenezes/elasticsearch-kopf && \ 15 | /usr/share/elasticsearch/bin/plugin --url https://github.com/NLPchina/elasticsearch-sql/releases/download/1.3.5/elasticsearch-sql-1.3.5.zip --install sql && \ 16 | /usr/share/elasticsearch/bin/plugin --install elasticsearch/elasticsearch-cloud-gce/2.5.0 17 | -------------------------------------------------------------------------------- /logstash-forwarder/builder/README.md: -------------------------------------------------------------------------------- 1 | 10M logstash-forwarder - builder 2 | ================================ 3 | 4 | This container is a good example of how to use the build containers branch seperatly. 5 | We are taking the build tools container to build some external code. 6 | We don't care so much about cleanup here (although a good practive) since it won't be running it production. 7 | 8 | The entire purpose of this container is to spit out a packge file. 9 | This package will later be installed by the main Dockerfile which won't inherit usless files from here. (like build tools) 10 | 11 | We use docker-compose here to have the volume map in a clearly readable way without using a long parameter list which become hard to read. 12 | 13 | -------------------------------------------------------------------------------- /base/build/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM rounds/10m-base 2 | MAINTAINER Ory Band @ Rounds 3 | 4 | # install generic build dependencies 5 | # also add multiverse (non-free) apps 6 | RUN sed -i 's/# \(.*multiverse$\)/\1/g' /etc/apt/sources.list && \ 7 | apt-get update && \ 8 | apt-get -y upgrade && \ 9 | # TODO git shouldn't be installed here, 10 | # but in another image inheriting from this one 11 | # need to check no build we have will be broken once we do this 12 | apt-get install -y build-essential software-properties-common git && \ 13 | apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* 14 | 15 | # set environment variables 16 | ENV HOME /root 17 | 18 | WORKDIR /root 19 | 20 | CMD ["/bin/bash"] 21 | -------------------------------------------------------------------------------- /java/Dockerfile: -------------------------------------------------------------------------------- 1 | # 2 | # Oracle Java 8 Dockerfile 3 | # 4 | # https://github.com/dockerfile/java 5 | # https://github.com/dockerfile/java/tree/master/oracle-java8 6 | # 7 | 8 | # Pull base image. 9 | FROM rounds/10m-build 10 | 11 | # Install Java. 12 | RUN \ 13 | echo oracle-java8-installer shared/accepted-oracle-license-v1-1 select true | debconf-set-selections && \ 14 | add-apt-repository -y ppa:webupd8team/java && \ 15 | apt-get update && \ 16 | apt-get install -y oracle-java8-installer && \ 17 | rm -rf /var/lib/apt/lists/* && \ 18 | rm -rf /var/cache/oracle-jdk8-installer 19 | 20 | # Define working directory. 21 | WORKDIR /data 22 | 23 | # Define commonly used JAVA_HOME variable 24 | ENV JAVA_HOME /usr/lib/jvm/java-8-oracle 25 | 26 | # Define default command. 27 | CMD ["bash"] 28 | -------------------------------------------------------------------------------- /logstash-forwarder/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM rounds/10m-base 2 | MAINTAINER Ofir Petrushka ROUNDS 3 | 4 | # Generic (should be in base images if this issue https://github.com/docker/docker/issues/3639 is ever resolved) 5 | VOLUME ["/var/log"] 6 | 7 | # Here we are copying and installing the resulting package from the build docker. 8 | # To create the package (the makefile does it already): 9 | # cd builder && docker-compose run logstashforwarderbuilder 10 | COPY builder/logstash-forwarder_*_amd64.deb . 11 | 12 | RUN dpkg -i logstash-forwarder_*_amd64.deb && \ 13 | rm logstash-forwarder_*_amd64.deb 14 | 15 | # We run logstash forwarder with restarts every hour due to issues of not releasing delete log files. (might cause your disk to run out of space) 16 | CMD timeout 1h /etc/logstash-forwarder/run.sh 17 | -------------------------------------------------------------------------------- /graphite_web/local_settintgs.py.example: -------------------------------------------------------------------------------- 1 | ALLOWED_HOSTS = [ '*' ] 2 | TIME_ZONE = 'Etc/UTC' 3 | 4 | LOG_RENDERING_PERFORMANCE = True 5 | LOG_CACHE_PERFORMANCE = True 6 | LOG_METRIC_ACCESS = True 7 | 8 | DEBUG = True 9 | 10 | GRAPHITE_ROOT = '/usr/share/graphite-web' 11 | 12 | CONF_DIR = '/etc/graphite' 13 | STORAGE_DIR = '/var/lib/graphite/whisper' 14 | CONTENT_DIR = '/usr/share/graphite-web/static' 15 | 16 | SECRET_KEY = 'RANDOM_KEY' 17 | 18 | WHISPER_DIR = '/usr/storage/whisper' 19 | LOG_DIR = '/var/log/graphite' 20 | INDEX_FILE = '/var/lib/graphite/search_index' 21 | 22 | DATABASES = { 23 | 'default': { 24 | 'NAME': '/var/lib/graphite/graphite.db', 25 | 'ENGINE': 'django.db.backends.sqlite3', 26 | 'USER': '', 27 | 'PASSWORD': '', 28 | 'HOST': '', 29 | 'PORT': '' 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /hubot/hubot/scripts/zombies.coffee: -------------------------------------------------------------------------------- 1 | # Description: 2 | # Bring forth zombies 3 | # 4 | # Dependencies: 5 | # None 6 | # 7 | # Configuration: 8 | # None 9 | # 10 | # Commands: 11 | # (zombie) - Call in a zombie 12 | # 13 | # Author: 14 | # solap 15 | 16 | 17 | 18 | images = [ 19 | "http://24.media.tumblr.com/tumblr_m35jnyjTco1qikhvso1_100.gif", 20 | "http://www.netanimations.net/head2.gif", 21 | "http://www.netanimations.net/Animated-Zombie-Reverse.gif", 22 | "http://www.freewebs.com/echoeyy/zombie%20getting%20shot.gif", 23 | "https://i.chzbgr.com/maxW500/6360720640/h487AE90F/", 24 | "https://i.chzbgr.com/maxW500/5912815872/h8AB29CB2/", 25 | "https://i.chzbgr.com/maxW500/5299680512/h5120FD0B/" 26 | ] 27 | 28 | module.exports = (robot) -> 29 | robot.hear /zombi(e|es)/i, (msg) -> 30 | msg.send msg.random images 31 | -------------------------------------------------------------------------------- /hubot/hubot/scripts/marvin-quotes.coffee: -------------------------------------------------------------------------------- 1 | # Description: 2 | # Marvin, the Paranoid Android, from The Hitchhiker's Guide to the Galaxy 3 | # 4 | # Dependencies: 5 | # None 6 | # 7 | # Configuration: 8 | # None 9 | # 10 | # Commands: 11 | # hubot you saved me 12 | # hubot how is your life? 13 | # 14 | # Author: 15 | # jweslley 16 | 17 | quotes = [ 18 | "Life! Don't talk to me about life", 19 | "Life, loathe it or ignore it, you can't like it", 20 | "Life's bad enough as it is without wanting to invent any more of it", 21 | "Funny, how just when you think life can't possibly get any worse it suddenly does" 22 | ] 23 | 24 | module.exports = (robot) -> 25 | 26 | robot.hear /you saved me/, (msg) -> 27 | msg.send "I know. Wretched isn't it?" 28 | 29 | robot.hear /(.*)(life)(.*)/i, (msg) -> 30 | msg.send msg.random quotes 31 | -------------------------------------------------------------------------------- /hubot/hubot/scripts/reverse-dns.coffee: -------------------------------------------------------------------------------- 1 | # Description: 2 | # Get domains associated with a specific IP Address based on http://hackertarget.com/reverse-dns-lookup/ 3 | # 4 | # Dependencies: 5 | # None 6 | # 7 | # Configuration: 8 | # None 9 | # 10 | # Commands: 11 | # hubot reverse dns - Gets domains associated with an IP 12 | # 13 | # Author: 14 | # Scott J Roberts - @sroberts 15 | 16 | api_url = "http://api.hackertarget.com" 17 | 18 | module.exports = (robot) -> 19 | robot.respond /reverse dns (.*)/i, (msg) -> 20 | ip = msg.match[1].toLowerCase() 21 | robot.http(api_url + "/reversedns/?q=#{ip}") 22 | .get() (err, res, body) -> 23 | if res.statusCode is 200 24 | msg.send "The Reverse DNS for #{ip} is #{body}" 25 | else 26 | msg.send "Error: Couldn't access #{api_url}. Error Message: #{err}. Status Code: #{res.statusCode}" 27 | -------------------------------------------------------------------------------- /hubot/hubot/scripts/python_library.coffee: -------------------------------------------------------------------------------- 1 | # Description: 2 | # Allows hubot to get the link to a Python 2 or 3 libaray. 3 | # 4 | # Dependencies: 5 | # None 6 | # 7 | # Commands: 8 | # hubot python(2|3) library - Gets the url of the named library if it exists. 9 | # 10 | # Author: 11 | # Bryce Verdier (btv) 12 | 13 | module.exports = (robot) -> 14 | robot.respond /python(2|3) library (.*)/i, (msg) -> 15 | matches = msg.match 16 | libraryMe robot, matches[1], matches[2], (text) -> 17 | msg.send text 18 | 19 | libraryMe = (robot, version, lib, callback) -> 20 | url = "http://docs.python.org/#{version}/library/#{lib}.html" 21 | robot.http(url) 22 | .get() (err,res,body) -> 23 | if res.statusCode != 200 24 | callback "MERP! The library #{lib} does not exist!" 25 | else 26 | callback url 27 | 28 | -------------------------------------------------------------------------------- /hubot/hubot/scripts/gaye.coffee: -------------------------------------------------------------------------------- 1 | # Description: 2 | # Load a random Grumpy Cat from an array of images. 3 | # Based on pugme. 4 | # 5 | # Dependencies: 6 | # None 7 | # 8 | # Configuration: 9 | # None 10 | # 11 | # Commands: 12 | # hubot grumpycat me - Receive a Grumpy Cat 13 | # hubot grumpycat bomb N - get N Grumpy Cats 14 | # 15 | # Author: 16 | # trey 17 | 18 | imgs = [ 19 | "http://upload.wikimedia.org/wikipedia/commons/3/3a/Marvin_Gaye_%281973%29.png", 20 | "http://eil.com/images/main/Marvin-Gaye-Sanctified-Lady-304552.jpg", 21 | "http://www.rugusavay.com/wp-content/uploads/2012/11/Marvin-Gaye-Quotes-5.jpg", 22 | "http://performingsongwriter.com/wp-content/uploads/2011/04/marvin-gaye.jpg" 23 | ] 24 | 25 | module.exports = (robot) -> 26 | robot.respond /gaye/i, (msg) -> 27 | msg.send imgs[Math.floor(Math.random()*imgs.length)] 28 | 29 | robot.respond /gaye/i, (msg) -> 30 | msg.send "What's going on?" 31 | -------------------------------------------------------------------------------- /hubot/hubot/scripts/stage.coffee: -------------------------------------------------------------------------------- 1 | # Description: 2 | # None 3 | # 4 | # Dependencies: 5 | # None 6 | # 7 | # Configuration: 8 | # None 9 | # 10 | # Commands: 11 | # it's a trap - Display an Admiral Ackbar piece of wonder 12 | # 13 | # Author: 14 | # brilliantfantastic 15 | 16 | stages = [ 17 | "http://i.telegraph.co.uk/multimedia/archive/01737/richmond-antlers-b_1737366i.jpg", 18 | "https://s-media-cache-ak0.pinimg.com/736x/de/8a/6c/de8a6c9ddc385344304181255cdb6b4f.jpg", 19 | "http://www.inenglish.com/BPSOldWebsite/images/members%20images/Peter%20Basterfield%20ARPS%20DPAGB/album/slides/Red%20Deer%20Stag%20at%20Rut.jpg", 20 | "http://www.linkmesh2.com/scraper/data/alphacoders/Deer%20Wallpapers/247698.jpg", 21 | "https://urbangiraffe.com/images/blog/2010/11/stag-body.jpg" 22 | ] 23 | 24 | module.exports = (robot) -> 25 | robot.hear /XXXXXXXXXXXXXXXstageXXXXXXXXXXXXXXXXXXXXXX/i, (msg) -> 26 | msg.send msg.random stages 27 | -------------------------------------------------------------------------------- /hubot/hubot/scripts/geolocate-ip.coffee: -------------------------------------------------------------------------------- 1 | # Description: 2 | # Geolocate an IP Address 3 | # 4 | # Dependencies: 5 | # None 6 | # 7 | # Configuration: 8 | # None 9 | # 10 | # Commands: 11 | # hubot geolocate - Geolocates IP 12 | # 13 | # Author: 14 | # Scott J Roberts - @sroberts 15 | 16 | api_url = "http://api.hostip.info" 17 | 18 | module.exports = (robot) -> 19 | robot.respond /geolocate (.+)$/i, (msg) -> 20 | target_ip = msg.match[1].toLowerCase() 21 | request_url = api_url + "/get_json.php?ip=#{target_ip}" 22 | 23 | robot.http(request_url) 24 | .get() (err, res, body) -> 25 | if res.statusCode is 200 26 | geolocation_json = JSON.parse(body) 27 | msg.send "I'm pretty sure #{geolocation_json.ip} is from #{geolocation_json.city}, #{geolocation_json.country_name}." 28 | else 29 | msg.send "Something didn't work trying to geolocate#{target_ip} using #{api_url}. :frowning:" 30 | -------------------------------------------------------------------------------- /base/build/nginx/nginx_php_fcgi/files/etc/nginx/sites-enabled/php-fcgi: -------------------------------------------------------------------------------- 1 | server { 2 | listen 80; 3 | 4 | rewrite_log on; 5 | error_log /var/log/nginx/localhost.error_log debug; 6 | 7 | index index.php; 8 | 9 | location / { 10 | root /var/www/html; 11 | } 12 | 13 | # location / { 14 | # URLs to attempt, including pretty ones. 15 | #try_files $uri $uri/ /index.php?$query_string; 16 | 17 | # } 18 | 19 | # Remove trailing slash to please routing system. 20 | # if (!-d $request_filename) { 21 | # rewrite ^/(.+)/$ /$1 permanent; 22 | # } 23 | 24 | location ~ \.php(/|$) { 25 | rewrite ^/(.*)$ $1 last; 26 | fastcgi_split_path_info ^(.+?\.php)(/.*)$; 27 | fastcgi_pass fcgi:9000; 28 | fastcgi_index index.php; 29 | include fastcgi_params; 30 | fastcgi_split_path_info ^(.+\.php)(.*)$; 31 | fastcgi_param SCRIPT_FILENAME $fastcgi_script_name; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /graphite_carbon_relay/relay-rules.conf: -------------------------------------------------------------------------------- 1 | # Relay destination rules for carbon-relay. Entries are scanned in order, 2 | # and the first pattern a metric matches will cause processing to cease after sending 3 | # unless `continue` is set to true 4 | # 5 | # [name] 6 | # pattern = 7 | # destinations = 8 | # continue = # default: False 9 | # 10 | # name: Arbitrary unique name to identify the rule 11 | # pattern: Regex pattern to match against the metric name 12 | # destinations: Comma-separated list of destinations. 13 | # ex: 127.0.0.1, 10.1.2.3:2004, 10.1.2.4:2004:a, myserver.mydomain.com 14 | # continue: Continue processing rules if this rule matches (default: False) 15 | 16 | # You must have exactly one section with 'default = true' 17 | # Note that all destinations listed must also exist in carbon.conf 18 | # in the DESTINATIONS setting in the [relay] section 19 | [all] 20 | pattern = .* 21 | destinations = 127.0.0.1:2004 22 | 23 | [default] 24 | default = true 25 | destinations = 127.0.0.1:2004:a 26 | -------------------------------------------------------------------------------- /base/build/php/5.6/Makefile: -------------------------------------------------------------------------------- 1 | IMAGE_NAME=rounds/10m-php:5.6 2 | 3 | all: 4 | echo 'Usage: see https://github.com/rounds/10M-Docker-Images/blob/master/base/README.md' 5 | 6 | update: 7 | peru reup -f 8 | peru sync 9 | mv 5.6/* ./ 10 | rm -rf 5.6 11 | sed -i -e "s/^FROM .*/FROM rounds\/10m-build/" Dockerfile # Inherit from our own docker tree 12 | sed -i -e "s|./configure \\\|./configure --enable-zip --enable-opcache --enable-mbstring=all \\\|" Dockerfile # Enable extentions 13 | sed -i -e "1s/^/\ 14 | # *** DO NOT EDIT THIS FILE MANUALLY ***\n\ 15 | # *** Will be overwritten by 'make update' ***\n/" Dockerfile # Outside file warning 16 | find . -type f -name "docker-php-ext-*" -exec sed -i -e "1s/^/\ 17 | # *** DO NOT EDIT THIS FILE MANUALLY ***\n\ 18 | # *** Will be overwritten by 'make update' ***\n/" {} + # Outside file warning 19 | 20 | build: 21 | docker build --tag "$(IMAGE_NAME)" . 22 | 23 | build-parent: 24 | $(MAKE) -C .. build-cascade 25 | 26 | build-cascade: build-parent build 27 | 28 | clean: 29 | docker rmi -f $(IMAGE_NAME) 30 | 31 | clean-parent: 32 | $(MAKE) -C .. clean-cascade 33 | 34 | clean-cascade: clean clean-parent 35 | 36 | run: 37 | docker run --rm -it $(IMAGE_NAME) bash 38 | -------------------------------------------------------------------------------- /base/build/php/5.6/fpm/Makefile: -------------------------------------------------------------------------------- 1 | IMAGE_NAME=rounds/10m-php-fpm:5.6 2 | 3 | all: 4 | echo 'Usage: see https://github.com/rounds/10M-Docker-Images/blob/master/base/README.md' 5 | 6 | update: 7 | peru reup -f 8 | peru sync 9 | mv 5.6/fpm/* ./ 10 | rm -rf 5.6 11 | sed -i -e "s/^FROM .*/FROM rounds\/10m-build/" Dockerfile # Inherit from our own docker tree 12 | sed -i -e "s|./configure \\\|./configure --enable-zip --enable-opcache --enable-mbstring=all \\\|" Dockerfile # Enable extentions 13 | sed -i -e "1s/^/\ 14 | # *** DO NOT EDIT THIS FILE MANUALLY ***\n\ 15 | # *** Will be overwritten by 'make update' ***\n/" Dockerfile # Outside file warning 16 | find . -type f -name "docker-php-ext-*" -exec sed -i -e "1s/^/\ 17 | # *** DO NOT EDIT THIS FILE MANUALLY ***\n\ 18 | # *** Will be overwritten by 'make update' ***\n/" {} + # Outside file warning 19 | 20 | build: 21 | docker build --tag "$(IMAGE_NAME)" . 22 | 23 | build-parent: 24 | $(MAKE) -C .. build-cascade 25 | 26 | build-cascade: build-parent build 27 | 28 | clean: 29 | docker rmi -f $(IMAGE_NAME) 30 | 31 | clean-parent: 32 | $(MAKE) -C .. clean-cascade 33 | 34 | clean-cascade: clean clean-parent 35 | 36 | run: 37 | docker run --rm -it $(IMAGE_NAME) bash 38 | -------------------------------------------------------------------------------- /hubot/hubot/scripts/httpcat.coffee: -------------------------------------------------------------------------------- 1 | # Description: 2 | # Loads a specified HTTP cat error image from 3 | # http://httpcats.herokuapp.com/ 4 | # based on user input 5 | # 6 | # Dependencies: 7 | # none 8 | # 9 | # Configuration: 10 | # None 11 | # 12 | # Commands: 13 | # hubot httpcat - get your status cat image 14 | # 15 | # hubot httpcat help - explains usage 16 | # 17 | # Notes: 18 | # None 19 | # 20 | # Author: 21 | # @commadelimited 22 | 23 | codes = [100, 101, 200, 201, 202, 204, 206, 207, 300, 301, 303, 304, 24 | 305, 307, 400, 401, 402, 403, 404, 405, 406, 408, 409, 410, 25 | 411, 413, 414, 416, 417, 418, 422, 423, 424, 425, 426, 429, 26 | 431, 444, 450, 500, 502, 503, 506, 507, 508, 509, 599] 27 | 28 | module.exports = (robot) -> 29 | robot.respond /httpcat (.+)/i, (msg) -> 30 | status = parseInt(msg.match[1], 10) 31 | if (codes.indexOf( status ) > -1) 32 | msg.send 'http://httpcats.herokuapp.com/' + status + '.jpg' 33 | else 34 | msg.send "That's not a valid HTTP status code, sorry amigo!" 35 | 36 | 37 | robot.respond /httpcat help/i, (msg) -> 38 | msg.send "Usage: httpcat ; a number" -------------------------------------------------------------------------------- /hubot/hubot/scripts/code-name-generator.coffee: -------------------------------------------------------------------------------- 1 | # Description: 2 | # Generate code names for things 3 | # 4 | # Dependencies: 5 | # None 6 | # 7 | # Configuration: 8 | # None 9 | # 10 | # Commands: 11 | # hubot codewords - Generates a few potential codenames for you 12 | # 13 | # Author: 14 | # Scott J Roberts - @sroberts 15 | 16 | api_url = "https://gist.githubusercontent.com" 17 | request_url = api_url + "/sroberts/6529712/raw/1e979071f6a9e8747d2c44cf5af7c4998e068d49/wordlist" 18 | 19 | module.exports = (robot) -> 20 | robot.respond /codewords/i, (msg) -> 21 | robot.http(request_url) 22 | .get() (err, res, body) -> 23 | if res.statusCode is 200 24 | wordlist = body.split(",") 25 | msg.send """Here are some super secret codewords: 26 | - #{msg.random wordlist} #{msg.random wordlist} 27 | - #{msg.random wordlist} #{msg.random wordlist} 28 | - #{msg.random wordlist} #{msg.random wordlist} 29 | - #{msg.random wordlist} #{msg.random wordlist} 30 | - #{msg.random wordlist} #{msg.random wordlist} 31 | """ 32 | else 33 | msg.send "I couldn't connect to #{api_url} so I couldn't get the word list. Sorry. :frowning:" 34 | -------------------------------------------------------------------------------- /logstash-forwarder/README.md: -------------------------------------------------------------------------------- 1 | [![](https://badge.imagelayers.io/rounds/10m-logstash-forwarder:latest.svg)](https://imagelayers.io/?images=rounds/10m-logstash-forwarder:latest 'Get your own badge on imagelayers.io') 2 | 3 | 10M logstash-forwarder 4 | ====================== 5 | 6 | This is a clean logstash forwarder container that can be auto rebuilt from source. 7 | The final image is clean of the build tools. 8 | That is made possilbe using a seperate image for the autobuilds that does have the needed build tools. 9 | 10 | For Users 11 | ========= 12 | Just add config by either inheritance or mount of /etc/logstash-forwarder, see example config and further explination here: 13 | 14 | https://github.com/rounds/10M-Docker-Images/tree/master/logstash-forwarder/config-example 15 | 16 | For Contributers 17 | ================ 18 | 19 | Short version 20 | ============= 21 | 22 | Run: 23 | make 24 | 25 | It will both build a new logstash-forwarder exec, deb pacakge and a docker image containing it. 26 | 27 | Long version 28 | ============ 29 | /builder has a Dockerfile that knows how to build a new exec and package from the source of logstash-forwarder including all dependencies. 30 | 31 | ./Dockerfile is using the deb package in /builder/*.deb to create a docker images for a logstash forwarder client without the bloat of the build tools. 32 | -------------------------------------------------------------------------------- /logstash-forwarder/builder/Dockerfile: -------------------------------------------------------------------------------- 1 | # Image for building logstash-forwarder with all dependencies pre-installed 2 | 3 | FROM rounds/10m-build-go 4 | MAINTAINER Ofir Petrushka 5 | 6 | WORKDIR /tmp 7 | 8 | # Install ruby 2.1 for mustash depdency in Gemfile 9 | #RUN apt-get install -y python-software-properties 10 | RUN apt-add-repository ppa:brightbox/ruby-ng && \ 11 | apt-get update 12 | RUN apt-get install -y ruby2.1 ruby2.1-dev 13 | 14 | RUN apt-get install -y bundler 15 | 16 | # Install logstash-forwarder "Building it" 17 | # https://github.com/elasticsearch/logstash-forwarder 18 | RUN git clone git://github.com/elasticsearch/logstash-forwarder.git /tmp/logstash-forwarder 19 | WORKDIR /tmp/logstash-forwarder 20 | RUN bundle 21 | 22 | VOLUME ["/build/"] 23 | WORKDIR /build/ 24 | 25 | # Install logstash-forwarder "Building it" 26 | # https://github.com/elasticsearch/logstash-forwarder 27 | # "Packaging it" 28 | # https://github.com/elasticsearch/logstash-forwarder 29 | CMD cp -r /tmp/logstash-forwarder /build/logstash-forwarder && \ 30 | cd logstash-forwarder && \ 31 | git fetch && \ 32 | bundle && \ 33 | go build && \ 34 | make deb && \ 35 | rm /build/logstash-forwarder_*_amd64.deb && \ 36 | cp logstash-forwarder_*_amd64.deb /build && \ 37 | cd /tmp && \ 38 | rm -rf /build/logstash-forwarder 39 | -------------------------------------------------------------------------------- /redis/Dockerfile: -------------------------------------------------------------------------------- 1 | # This image minimal redis image based on https://hub.docker.com/r/nhoag/redis/ 2 | 3 | # Pull base image. 4 | FROM rounds/10m-base 5 | 6 | MAINTAINER Aviv Laufer, aviv@rounds.com 7 | 8 | ENV REDIS_VERSION 3.0.4 9 | ENV REDIS_DIR redis-${REDIS_VERSION} 10 | ENV REDIS_ARCHIVE ${REDIS_DIR}.tar.gz 11 | ENV REDIS_URL http://download.redis.io/releases/${REDIS_ARCHIVE} 12 | 13 | WORKDIR /tmp 14 | 15 | RUN apt-get update && \ 16 | apt-get install -y build-essential wget && \ 17 | wget -q ${REDIS_URL} && \ 18 | wget -q https://raw.githubusercontent.com/antirez/redis-hashes/master/README && \ 19 | cat README | grep ${REDIS_ARCHIVE} | awk '{print $4" "$2}' | shasum -c && \ 20 | tar xzf ${REDIS_ARCHIVE} && \ 21 | cd ${REDIS_DIR} && \ 22 | make && make install && \ 23 | cp -f src/redis-sentinel /usr/local/bin && \ 24 | mkdir -p /etc/redis && cp -f *.conf /etc/redis && \ 25 | rm -rf /tmp/${REDIS_DIR}* /tmp/README /var/lib/apt/lists/* && \ 26 | sed -i 's/^\(bind .*\)$/# \1/' /etc/redis/redis.conf && \ 27 | sed -i 's/^\(daemonize .*\)$/# \1/' /etc/redis/redis.conf && \ 28 | sed -i 's/^\(dir .*\)$/# \1\ndir \/data/' /etc/redis/redis.conf && \ 29 | sed -i 's/^\(logfile .*\)$/# \1/' /etc/redis/redis.conf 30 | 31 | VOLUME ["/data"] 32 | 33 | WORKDIR /data 34 | 35 | EXPOSE 6379 36 | 37 | CMD ["redis-server", "/etc/redis/redis.conf"] 38 | -------------------------------------------------------------------------------- /logstash-server/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM rounds/10m-java 2 | MAINTAINER Ofir Petrushka ROUNDS 3 | 4 | # Generic (should be in base images if this issue https://github.com/docker/docker/issues/3639 is ever resolved) 5 | VOLUME ["/var/log"] 6 | 7 | RUN wget -O - http://packages.elasticsearch.org/GPG-KEY-elasticsearch | apt-key add - && \ 8 | echo "deb http://packages.elasticsearch.org/logstash/1.4/debian stable main" > /etc/apt/sources.list.d/elasticsearch.list && \ 9 | apt-get update && \ 10 | apt-get install logstash logstash-contrib && \ 11 | apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \ 12 | sed --in-place=.orig 's/.err\" &$/.err\"/g' /etc/init.d/logstash 13 | # The sed makes the init.d non demonized, so it can be used by docker (script contains a lot of env exports... comes with logstash install) 14 | 15 | # Logstash input ports (not used in our setup) 16 | #EXPOSE 3333 3334 17 | 18 | # Logstash-forwarder Lumberjack port 19 | EXPOSE 12345 20 | 21 | # ElasticSearch discovery port 22 | # "If using the default protocol setting (“node”), your firewalls might need to permit port 9300 in both directions (from Logstash to Elasticsearch, and Elasticsearch to Logstash)" 23 | # http://logstash.net/docs/1.4.2/outputs/elasticsearch#bind_host 24 | EXPOSE 9300 25 | 26 | # Define default command. 27 | CMD [/etc/init.d/logstash start] 28 | -------------------------------------------------------------------------------- /base/README.md: -------------------------------------------------------------------------------- 1 | [![](https://badge.imagelayers.io/rounds/10m-base:latest.svg)](https://imagelayers.io/?images=rounds/10m-base:latest 'Get your own badge on imagelayers.io') 2 | 3 | Base 10M docker 4 | =============== 5 | This is the master branch of the tree, all other images inherit from it either directly or by cascade inheritance. 6 | 7 | Any change here should cause a cascade rebuild of the entire tree. 8 | 9 | Ways to use locally 10 | ================== 11 | Some of the images now have makefiles that allow the following: (example usage: make build) 12 | ``` 13 | build - Build docker image with tagging the right name like it has been published - Know what this means before using! 14 | build-cascade - Will cascade the builds from base until your current image locally, see notes on build. 15 | clean - Remove local image by current directory (forced) - this allows you to clean a local build so you will grub the offical ones out of the public repos next time around. 16 | clean-cascade - Removes all images cascading from here up the tree - this allows you to clean all local builds so you will grub the offical ones out of the public repos next time around. 17 | run - Run the current image in bash - very usfull for testing. 18 | update - On images that are reusing from public ones. This will update the local image to match the public one with the needed changes. NOTE: If on Mac/iOS need gnu-sed. 19 | ``` 20 | -------------------------------------------------------------------------------- /logstash-forwarder/config-example/README.md: -------------------------------------------------------------------------------- 1 | logstash-forwarder config example 2 | ================================= 3 | 4 | This is an example of configuring a docker image by inheritance. 5 | 6 | You can see the only thing we have in the Dockerfile is copying local files into the image. 7 | The etc directory is holding our example config, potentially this is your private config that you don't want to be publicly availible. 8 | 9 | This example doesn't work out of the box, you should replace the crt file with a real one you are using, (etc/logstash-forwarder/server.crt) 10 | and change logs.example.com to your real server inside etc/logstash-forwarder/logstash-forwarder-config.json 11 | 12 | This example json config tries to catch all files in the 1st 2 levels of /var/log which is a common log path. 13 | This would potentially allow you to have all your nodes run just one logstash forwarder container, as your log aggregator, no matter what application containers you are running. 14 | 15 | The resulting image shouldi potentially be stored as a private one, not in the public docker hub. 16 | 17 | How you can use this image: 18 | 1. Fork it and change what you need. (minimally just the 2 files mentioned above) 19 | 2. Just read it as an example usage that is valid for most of our other images. 20 | 3. you might still use this image with the volumes trick where you mount the config directory and change it locally on the node your deploy on. 21 | -------------------------------------------------------------------------------- /git_client/README.md: -------------------------------------------------------------------------------- 1 | [![](https://badge.imagelayers.io/rounds/10m-git-client:latest.svg)](https://imagelayers.io/?images=rounds/10m-git-client:latest 'Get your own badge on imagelayers.io') 2 | 3 | Git Client Docker 4 | ================= 5 | This containter can be used as a small utility for fetching and updating code stored in a git repository without installing git or keys on a node. 6 | 7 | This utility can be specially useful for private git repositories where you have secret keys that you don't want to expose but are needed to access your git tree. 8 | The 1st thing it allows you it to have these keys only in one place in your system and used by many nodes, this should make it fairly simple for example to rotate your keys. 9 | 10 | An even better use for security might be deploying systems in a way of: 11 | * Login to your secured docker image repository. 12 | * Fetch the git containter with the keys already in it. (might happen automatically by a run command) 13 | * Run a git checkout/pull command that will save your updated application code on the node. 14 | * Delete the container. 15 | * Logout of your secured docker image repository. 16 | 17 | Now the node that you just deployed to doens't have access to your private code repositories or to your secured docker image repository. 18 | And in the same time it should be almost as short of a deploy to "just update code" on the node. (if done right, it's a minimal keys fetch by docker + git pull) 19 | -------------------------------------------------------------------------------- /hubot/hubot/scripts/ackbar.coffee: -------------------------------------------------------------------------------- 1 | # Description: 2 | # None 3 | # 4 | # Dependencies: 5 | # None 6 | # 7 | # Configuration: 8 | # None 9 | # 10 | # Commands: 11 | # it's a trap - Display an Admiral Ackbar piece of wonder 12 | # 13 | # Author: 14 | # brilliantfantastic 15 | 16 | ackbars = [ 17 | "http://i.imgur.com/OTByx1b.jpg", 18 | "http://farm4.static.flickr.com/3572/3637082894_e23313f6fb_o.jpg", 19 | "http://6.asset.soup.io/asset/0610/8774_242b_500.jpeg", 20 | "http://files.g4tv.com/ImageDb3/279875_S/steampunk-ackbar.jpg", 21 | "http://farm6.staticflickr.com/5126/5725607070_b80e61b4b3_z.jpg", 22 | "http://farm6.static.flickr.com/5291/5542027315_ba79daabfb.jpg", 23 | "http://farm6.staticflickr.com/5250/5216539895_09f963f448_z.jpg", 24 | "http://static.fjcdn.com/pictures/Its_2031a3_426435.jpg", 25 | "http://www.millionaireplayboy.com/mpb/wp-content/uploads/2011/01/1293668358_bottom_trappy.jpeg", 26 | "http://31.media.tumblr.com/tumblr_lqrrkpAqjf1qiorsyo1_500.jpg", 27 | "https://i.chzbgr.com/maxW500/4930876416/hB0F640C6/", 28 | "http://i.qkme.me/356mr9.jpg", 29 | "http://24.media.tumblr.com/e4255aa10151ebddf57555dfa3fc8779/tumblr_mho9v9y5hE1r8gxxfo1_500.jpg", 30 | "http://farm2.staticflickr.com/1440/5170210261_fddb4c480c_z.jpg", 31 | "http://fashionablygeek.com/wp-content/uploads/2010/02/its-a-mouse-trap.jpg?cb5e28", 32 | "http://31.media.tumblr.com/tumblr_lmn8d1xFXN1qjs7yio1_500.jpg" 33 | ] 34 | 35 | module.exports = (robot) -> 36 | robot.hear /it['’]?s a trap\b/i, (msg) -> 37 | msg.send msg.random ackbars 38 | -------------------------------------------------------------------------------- /uml.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Exit on first error 4 | set -e 5 | 6 | 7 | save_and_shutdown() { 8 | # save built for host result 9 | # force clean shutdown 10 | echo $? > $WORKDIR/exit.status 11 | halt -f 12 | } 13 | 14 | # make sure we shut down cleanly 15 | trap save_and_shutdown EXIT SIGINT SIGTERM 16 | 17 | # go back to where we were invoked 18 | cd $WORKDIR 19 | 20 | # configure path to include /usr/local 21 | export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin 22 | 23 | # can't do much without proc! 24 | mount -t proc none /proc 25 | 26 | # pseudo-terminal devices 27 | mkdir -p /dev/pts 28 | mount -t devpts none /dev/pts 29 | 30 | # shared memory a good idea 31 | mkdir -p /dev/shm 32 | mount -t tmpfs none /dev/shm 33 | 34 | # sysfs a good idea 35 | mount -t sysfs none /sys 36 | 37 | # pidfiles and such like 38 | mkdir -p /var/run 39 | mount -t tmpfs none /var/run 40 | 41 | # takes the pain out of cgroups 42 | cgroups-mount 43 | 44 | # mount /var/lib/docker with a tmpfs 45 | mount -t tmpfs none /var/lib/docker 46 | 47 | # enable ipv4 forwarding for docker 48 | echo 1 > /proc/sys/net/ipv4/ip_forward 49 | 50 | # configure networking 51 | ip addr add 127.0.0.1 dev lo 52 | ip link set lo up 53 | ip addr add 10.1.1.1/24 dev eth0 54 | ip link set eth0 up 55 | ip route add default via 10.1.1.254 56 | 57 | # configure dns (google public) 58 | mkdir -p /run/resolvconf 59 | echo 'nameserver 8.8.8.8' > /run/resolvconf/resolv.conf 60 | mount --bind /run/resolvconf/resolv.conf /etc/resolv.conf 61 | 62 | # Start docker daemon 63 | docker -d & 64 | sleep 5 65 | 66 | # Use docker 67 | docker build . 68 | -------------------------------------------------------------------------------- /base/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:vivid 2 | MAINTAINER Ofir Petrushka @ Rounds , Ory Band @ Rounds 3 | 4 | # solves some issues and many messages in apt-get install 5 | ENV DEBIAN_FRONTEND noninteractive 6 | 7 | # set the locale 8 | # this avoids encoding problems in various apps 9 | RUN locale-gen en_US.UTF-8 10 | ENV LANG en_US.UTF-8 11 | ENV LANGUAGE en_US:en 12 | ENV LC_ALL en_US.UTF-8 13 | 14 | # solves docker/docker#9299 15 | ENV TERM=xterm 16 | 17 | # replace sh with bash 18 | RUN rm /bin/sh && ln -s /bin/bash /bin/sh 19 | 20 | # install essentials to most images 21 | RUN apt-get update && apt-get upgrade -y && \ 22 | apt-get install -y wget curl vim && \ 23 | apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* 24 | 25 | # install docker-gen and dockerize 26 | # NOTE that docker-gen requires mounting the docker api socket, READ-ONLY mode: 27 | # docker run -v /var/run/docker.sock:/tmp/docker.sock:ro ... 28 | ENV DOCKER_GEN_VERSION 0.4.3 29 | ENV DOCKERIZE_VERSION v0.0.3 30 | 31 | ENV DOCKER_GEN_FILE docker-gen-linux-amd64-$DOCKER_GEN_VERSION.tar.gz 32 | ENV DOCKERIZE_FILE dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz 33 | 34 | ENV DOCKER_GEN_URL https://github.com/jwilder/docker-gen/releases/download/$DOCKER_GEN_VERSION/$DOCKER_GEN_FILE 35 | ENV DOCKERIZE_URL https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/$DOCKERIZE_FILE 36 | 37 | RUN wget $DOCKER_GEN_URL $DOCKERIZE_URL && \ 38 | tar -C /usr/local/bin -xvzf $DOCKER_GEN_FILE && tar -C /usr/local/bin -xvzf $DOCKERIZE_FILE && \ 39 | rm $DOCKER_GEN_FILE $DOCKERIZE_FILE 40 | 41 | # we do want to treat logs the same in all of our images 42 | # see docker/docker#3639 43 | # VOLUME ["/var/log"] 44 | -------------------------------------------------------------------------------- /base/build/php/5.6/docker-php-ext-install: -------------------------------------------------------------------------------- 1 | # *** DO NOT EDIT THIS FILE MANUALLY *** 2 | # *** Will be overwritten by 'make update' *** 3 | #!/bin/bash 4 | set -e 5 | 6 | cd /usr/src/php/ext 7 | 8 | usage() { 9 | echo "usage: $0 [-jN] ext-name [ext-name ...]" 10 | echo " ie: $0 gd mysqli" 11 | echo " $0 pdo pdo_mysql" 12 | echo " $0 -j5 gd mbstring mysqli pdo pdo_mysql shmop" 13 | echo 14 | echo 'if custom ./configure arguments are necessary, see docker-php-ext-configure' 15 | echo 16 | echo 'Possible values for ext-name:' 17 | echo $(find /usr/src/php/ext -mindepth 2 -maxdepth 2 -type f -name 'config.m4' | cut -d/ -f6 | sort) 18 | } 19 | 20 | opts="$(getopt -o 'h?j:' --long 'help,jobs:' -- "$@" || { usage >&2 && false; })" 21 | eval set -- "$opts" 22 | 23 | j=1 24 | while true; do 25 | flag="$1" 26 | shift 27 | case "$flag" in 28 | --help|-h|'-?') usage && exit 0 ;; 29 | --jobs|-j) j="$1" && shift ;; 30 | --) break ;; 31 | *) 32 | { 33 | echo "error: unknown flag: $flag" 34 | usage 35 | } >&2 36 | exit 1 37 | ;; 38 | esac 39 | done 40 | 41 | exts=() 42 | while [ $# -gt 0 ]; do 43 | ext="$1" 44 | shift 45 | if [ -z "$ext" ]; then 46 | continue 47 | fi 48 | if [ ! -d "$ext" ]; then 49 | echo >&2 "error: $(pwd -P)/$ext does not exist" 50 | echo >&2 51 | usage >&2 52 | exit 1 53 | fi 54 | exts+=( "$ext" ) 55 | done 56 | 57 | if [ "${#exts[@]}" -eq 0 ]; then 58 | usage >&2 59 | exit 1 60 | fi 61 | 62 | for ext in "${exts[@]}"; do 63 | ( 64 | cd "$ext" 65 | [ -e Makefile ] || docker-php-ext-configure "$ext" 66 | make -j"$j" 67 | make -j"$j" install 68 | find modules -maxdepth 1 -name '*.so' -exec basename '{}' ';' | xargs --no-run-if-empty --verbose docker-php-ext-enable 69 | make -j"$j" clean 70 | ) 71 | done 72 | -------------------------------------------------------------------------------- /base/build/php/5.6/fpm/docker-php-ext-install: -------------------------------------------------------------------------------- 1 | # *** DO NOT EDIT THIS FILE MANUALLY *** 2 | # *** Will be overwritten by 'make update' *** 3 | #!/bin/bash 4 | set -e 5 | 6 | cd /usr/src/php/ext 7 | 8 | usage() { 9 | echo "usage: $0 [-jN] ext-name [ext-name ...]" 10 | echo " ie: $0 gd mysqli" 11 | echo " $0 pdo pdo_mysql" 12 | echo " $0 -j5 gd mbstring mysqli pdo pdo_mysql shmop" 13 | echo 14 | echo 'if custom ./configure arguments are necessary, see docker-php-ext-configure' 15 | echo 16 | echo 'Possible values for ext-name:' 17 | echo $(find /usr/src/php/ext -mindepth 2 -maxdepth 2 -type f -name 'config.m4' | cut -d/ -f6 | sort) 18 | } 19 | 20 | opts="$(getopt -o 'h?j:' --long 'help,jobs:' -- "$@" || { usage >&2 && false; })" 21 | eval set -- "$opts" 22 | 23 | j=1 24 | while true; do 25 | flag="$1" 26 | shift 27 | case "$flag" in 28 | --help|-h|'-?') usage && exit 0 ;; 29 | --jobs|-j) j="$1" && shift ;; 30 | --) break ;; 31 | *) 32 | { 33 | echo "error: unknown flag: $flag" 34 | usage 35 | } >&2 36 | exit 1 37 | ;; 38 | esac 39 | done 40 | 41 | exts=() 42 | while [ $# -gt 0 ]; do 43 | ext="$1" 44 | shift 45 | if [ -z "$ext" ]; then 46 | continue 47 | fi 48 | if [ ! -d "$ext" ]; then 49 | echo >&2 "error: $(pwd -P)/$ext does not exist" 50 | echo >&2 51 | usage >&2 52 | exit 1 53 | fi 54 | exts+=( "$ext" ) 55 | done 56 | 57 | if [ "${#exts[@]}" -eq 0 ]; then 58 | usage >&2 59 | exit 1 60 | fi 61 | 62 | for ext in "${exts[@]}"; do 63 | ( 64 | cd "$ext" 65 | [ -e Makefile ] || docker-php-ext-configure "$ext" 66 | make -j"$j" 67 | make -j"$j" install 68 | find modules -maxdepth 1 -name '*.so' -exec basename '{}' ';' | xargs --no-run-if-empty --verbose docker-php-ext-enable 69 | make -j"$j" clean 70 | ) 71 | done 72 | -------------------------------------------------------------------------------- /hubot/hubot/scripts/newrelic.coffee: -------------------------------------------------------------------------------- 1 | # Description: 2 | # Display current app performance stats from New Relic 3 | # 4 | # Dependencies: 5 | # "xml2js": "0.2.0" 6 | # 7 | # Configuration: 8 | # HUBOT_NEWRELIC_ACCOUNT_ID 9 | # HUBOT_NEWRELIC_APP_ID 10 | # HUBOT_NEWRELIC_API_KEY 11 | # 12 | # Commands: 13 | # hubot newrelic me - Returns summary application stats from New Relic 14 | # 15 | # Notes: 16 | # How to find these settings: 17 | # After signing into New Relic, select your application 18 | # Given: https://rpm.newrelic.com/accounts/xxx/applications/yyy 19 | # xxx is your Account ID and yyy is your App ID 20 | # Account Settings > API + Web Integrations > API Access > "API key" 21 | # 22 | # Author: 23 | # briandoll 24 | 25 | Parser = require("xml2js").Parser 26 | 27 | module.exports = (robot) -> 28 | fetchData = (accountId, appId, apiKey, msg) -> 29 | msg.http("https://rpm.newrelic.com/accounts/#{accountId}/applications/#{appId}/threshold_values?api_key=#{apiKey}") 30 | .get() (err, res, body) -> 31 | if err 32 | msg.send "New Relic says: #{err}" 33 | return 34 | 35 | (new Parser).parseString body, (err, json)-> 36 | threshold_values = json['threshold-values']['threshold_value'] || [] 37 | lines = threshold_values.map (threshold_value) -> 38 | "#{threshold_value['$']['name']}: #{threshold_value['$']['formatted_metric_value']}" 39 | 40 | msg.send lines.join("\n"), "https://rpm.newrelic.com/accounts/#{accountId}/applications/#{appId}" 41 | 42 | robot.respond /newrelic me/i, (msg) -> 43 | accountId = process.env.HUBOT_NEWRELIC_ACCOUNT_ID 44 | appIds = process.env.HUBOT_NEWRELIC_APP_ID.split(',') 45 | apiKey = process.env.HUBOT_NEWRELIC_API_KEY 46 | fetchData(accountId, appId, apiKey, msg) for appId in appIds 47 | 48 | -------------------------------------------------------------------------------- /hubot/hubot/scripts/yoda-quotes.coffee: -------------------------------------------------------------------------------- 1 | # Description: 2 | # None 3 | # 4 | # Dependencies: 5 | # None 6 | # 7 | # Configuration: 8 | # None 9 | # 10 | # Commands: 11 | # yoda quote - Returns a random yoda quote 12 | # 13 | # Author: 14 | # vquaiato 15 | 16 | quotes = [ 17 | "Agree with you, the council does. Your apprentice, Skywalker will be.", 18 | "Always two there are, no more, no less: a master and an apprentice.", 19 | "Fear is the path to the Dark Side. Fear leads to anger, anger leads to hate; hate leads to suffering. I sense much fear in you.", 20 | "Qui-Gon's defiance I sense in you.", 21 | "Truly wonderful the mind of a child is.", 22 | "Around the survivors a perimeter create.", 23 | "Lost a planet Master Obi-Wan has. How embarrassing. how embarrassing.", 24 | "Victory, you say? Master Obi-Wan, not victory. The shroud of the Dark Side has fallen. Begun the Clone War has.", 25 | "Much to learn you still have...my old padawan... This is just the beginning!", 26 | "Twisted by the Dark Side young Skywalker has become.", 27 | "The boy you trained, gone he is, consumed by Darth Vader.", 28 | "The fear of loss is a path to the Dark Side.", 29 | "If into the security recordings you go, only pain will you find.", 30 | "Not if anything to say about it I have.", 31 | "Great warrior, hmm? Wars not make one great.", 32 | "Do or do not; there is no try.", 33 | "Size matters not. Look at me. Judge me by my size, do you?", 34 | "That is why you fail.", 35 | "No! No different. Only different in your mind. You must unlearn what you have learned.", 36 | "Always in motion the future is.", 37 | "Reckless he is. Matters are worse.", 38 | "When nine hundred years old you reach, look as good, you will not.", 39 | "No. There is... another... Sky... walker..." 40 | ] 41 | 42 | module.exports = (robot) -> 43 | robot.hear /.*(yoda quote).*/i, (msg) -> 44 | msg.send msg.random quotes 45 | 46 | -------------------------------------------------------------------------------- /hubot/hubot/scripts/grumpycat.coffee: -------------------------------------------------------------------------------- 1 | # Description: 2 | # Load a random Grumpy Cat from an array of images. 3 | # Based on pugme. 4 | # 5 | # Dependencies: 6 | # None 7 | # 8 | # Configuration: 9 | # None 10 | # 11 | # Commands: 12 | # hubot grumpycat me - Receive a Grumpy Cat 13 | # hubot grumpycat bomb N - get N Grumpy Cats 14 | # 15 | # Author: 16 | # trey 17 | 18 | cats = [ 19 | "http://mlkshk.com/r/M6EO.gif", # rabbit in a hat 20 | "http://mlkshk.com/r/M17S.gif", # dress 21 | "http://mlkshk.com/r/M15O.gif", # le mis 22 | "http://mlkshk.com/r/M01A.gif", # cartoons 23 | "http://mlkshk.com/r/LZ7U.gif", # fuck this 24 | "http://mlkshk.com/r/LXP2.gif", # grumpy tardar sauce 25 | "http://mlkshk.com/r/LWNG.gif", # grandma got run over 26 | "http://mlkshk.com/r/LVVR.gif", # double deal with it 27 | "http://mlkshk.com/r/LV0S.gif", # mural 28 | "http://mlkshk.com/r/LUYE.gif", # stahp 29 | "http://mlkshk.com/r/LUO2.gif", # good 30 | "http://mlkshk.com/r/LS6R.gif", # shut the fuck up 31 | "http://mlkshk.com/r/LSWD.gif", # Tardar Bonepart 32 | "http://mlkshk.com/r/LPCN.gif", # drawing 33 | "http://mlkshk.com/r/LLVD.gif", # terrible time of the year 34 | "http://mlkshk.com/r/LKTG.gif", # Citizen Kane 35 | "http://mlkshk.com/r/LEF8.gif", # emotions 36 | "http://mlkshk.com/r/LEFR.gif", # skate deck 37 | "http://mlkshk.com/r/L337.gif", # look askance 38 | "http://mlkshk.com/r/KV8K.gif", # sitting 39 | "http://mlkshk.com/r/KU1S.gif", # 3 grump moon 40 | "http://mlkshk.com/r/KRBA.gif", # rabbit painting 41 | "http://mlkshk.com/r/KL19.gif" # lying on the ground 42 | ] 43 | 44 | module.exports = (robot) -> 45 | robot.respond /grumpycat me/i, (msg) -> 46 | msg.send cats[Math.floor(Math.random()*cats.length)] 47 | 48 | robot.respond /grumpycat bomb( (\d+))?/i, (msg) -> 49 | count = msg.match[2] || 5 50 | for i in [1..count] by 1 51 | msg.send cats[Math.floor(Math.random()*cats.length)] 52 | 53 | robot.respond /how many grumpycats are there/i, (msg) -> 54 | msg.send "There are #{cats.length} grumpycats." 55 | -------------------------------------------------------------------------------- /hubot/hubot/scripts/working-on.coffee: -------------------------------------------------------------------------------- 1 | # Description: 2 | # Tell Hubot what you're working on so he can give out status updates when asked 3 | # 4 | # Dependencies: 5 | # None 6 | # 7 | # Configuration: 8 | # None 9 | # 10 | # Commands: 11 | # hubot i am working on - Set what you're working on 12 | # hubot what is everyone working on? - Find out what everyone is working on 13 | # 14 | # Author: 15 | # beezee 16 | 17 | module.exports = (robot) -> 18 | 19 | robot.respond /(?:what\'s|what is|whats) @?([\w .\-]+) working on(?:\?)?$/i, (msg) -> 20 | name = msg.match[1].trim() 21 | 22 | if name is "you" 23 | msg.send "I dunno, robot things I guess." 24 | else if name.toLowerCase() is robot.name.toLowerCase() 25 | msg.send "World domination!" 26 | else if name.match(/(everybody|everyone)/i) 27 | messageText = ''; 28 | users = robot.brain.users() 29 | for k, u of users 30 | if u.workingon 31 | messageText += "#{u.name} is working on #{u.workingon}\n" 32 | else 33 | messageText += "" 34 | if messageText.trim() is "" then messageText = "Nobody told me a thing." 35 | msg.send messageText 36 | else 37 | users = robot.brain.usersForFuzzyName(name) 38 | if users.length is 1 39 | user = users[0] 40 | user.workingon = user.workingon or [ ] 41 | if user.workingon.length > 0 42 | msg.send "#{name} is working on #{user.workingon}." 43 | else 44 | msg.send "#{name} is slacking off." 45 | else if users.length > 1 46 | msg.send getAmbiguousUserText users 47 | else 48 | msg.send "#{name}? Who's that?" 49 | 50 | robot.respond /(?:i\'m|i am|im) working on (.*)/i, (msg) -> 51 | name = msg.message.user.name 52 | user = robot.brain.userForName name 53 | 54 | if typeof user is 'object' 55 | user.workingon = msg.match[1] 56 | msg.send "Okay #{user.name}, got it." 57 | else if typeof user.length > 1 58 | msg.send "I found #{user.length} people named #{name}" 59 | else 60 | msg.send "I have never met #{name}" 61 | 62 | -------------------------------------------------------------------------------- /hubot/hubot/scripts/excuse.coffee: -------------------------------------------------------------------------------- 1 | # Description: 2 | # Get a random developer or designer excuse 3 | # 4 | # Dependencies: 5 | # None 6 | # 7 | # Configuration: 8 | # None 9 | # 10 | # Commands: 11 | # hubot developer excuse me - Get a random developer excuse 12 | # hubot developer excuse - Get a random developer excuse 13 | # hubot excuse - Get a random developer excuse 14 | # 15 | # hubot designer excuse me - Get a random designer excuse 16 | # hubot designer excuse - Get a random designer excuse 17 | # 18 | # Author: 19 | # ianmurrays, hopkinschris 20 | 21 | DESIGNER_EXCUSES = [ 22 | "That won't fit the grid.", 23 | "That's not in the wireframes.", 24 | "That's a developer thing.", 25 | "I didn't mock it up that way.", 26 | "The developer must have changed it.", 27 | "Did you try hitting refresh?", 28 | "No one uses IE anyway.", 29 | "That's not how I designed it.", 30 | "That's way too skeuomorphic.", 31 | "That's way too flat.", 32 | "Just put a long shadow on it.", 33 | "It wasn't designed for that kind of content.", 34 | "Josef Müller-Brockmann.", 35 | "That must be a server thing.", 36 | "It only looks bad if it's not on Retina.", 37 | "Are you looking at it in IE or something?", 38 | "That's not a recognised design pattern.", 39 | "It wasn't designed to work with this content.", 40 | "The users will never notice that.", 41 | "The users might not notice it, but they'll feel it.", 42 | "These brand guidelines are shit.", 43 | "You wouldn't get it, it's a design thing.", 44 | "Jony wouldn't do it like this.", 45 | "That's a dark pattern.", 46 | "I don't think that's very user friendly.", 47 | "That's not what the research says.", 48 | "I didn't get a change request for that." 49 | ] 50 | 51 | module.exports = (robot) -> 52 | robot.respond /(?:developer excuse|excuse)(?: me)?/i, (msg) -> 53 | robot.http("http://developerexcuses.com") 54 | .get() (err, res, body) -> 55 | matches = body.match /]+>(.+)<\/a>/i 56 | 57 | if matches and matches[1] 58 | msg.send matches[1] 59 | 60 | robot.respond /designer excuse(?: me)?/i, (msg) -> 61 | msg.send msg.random(DESIGNER_EXCUSES) 62 | -------------------------------------------------------------------------------- /base/build/php/5.6/docker-php-ext-enable: -------------------------------------------------------------------------------- 1 | # *** DO NOT EDIT THIS FILE MANUALLY *** 2 | # *** Will be overwritten by 'make update' *** 3 | #!/bin/bash 4 | set -e 5 | 6 | cd "$(php -r 'echo ini_get("extension_dir");')" 7 | 8 | usage() { 9 | echo "usage: $0 [options] module-name [module-name ...]" 10 | echo " ie: $0 gd mysqli" 11 | echo " $0 pdo pdo_mysql" 12 | echo " $0 --ini-name 0-apc.ini apcu apc" 13 | echo 14 | echo 'Possible values for module-name:' 15 | echo $(find -maxdepth 1 -type f -name '*.so' -exec basename '{}' ';' | sort) 16 | } 17 | 18 | opts="$(getopt -o 'h?' --long 'help,ini-name:' -- "$@" || { usage >&2 && false; })" 19 | eval set -- "$opts" 20 | 21 | iniName= 22 | while true; do 23 | flag="$1" 24 | shift 25 | case "$flag" in 26 | --help|-h|'-?') usage && exit 0 ;; 27 | --ini-name) iniName="$1" && shift ;; 28 | --) break ;; 29 | *) 30 | { 31 | echo "error: unknown flag: $flag" 32 | usage 33 | } >&2 34 | exit 1 35 | ;; 36 | esac 37 | done 38 | 39 | modules=() 40 | while [ $# -gt 0 ]; do 41 | module="$1" 42 | shift 43 | if [ -z "$module" ]; then 44 | continue 45 | fi 46 | if [ -f "$module.so" -a ! -f "$module" ]; then 47 | # allow ".so" to be optional 48 | module+='.so' 49 | fi 50 | if [ ! -f "$module" ]; then 51 | echo >&2 "error: $(readlink -f "$module") does not exist" 52 | echo >&2 53 | usage >&2 54 | exit 1 55 | fi 56 | modules+=( "$module" ) 57 | done 58 | 59 | if [ "${#modules[@]}" -eq 0 ]; then 60 | usage >&2 61 | exit 1 62 | fi 63 | 64 | for module in "${modules[@]}"; do 65 | if nm -g "$module" | grep -q ' zend_extension_entry$'; then 66 | # https://wiki.php.net/internals/extensions#loading_zend_extensions 67 | line="zend_extension=$(readlink -f "$module")" 68 | else 69 | line="extension=$module" 70 | fi 71 | 72 | ext="$(basename "$module")" 73 | ext="${ext%.*}" 74 | if php -r 'exit(extension_loaded("'"$ext"'") ? 0 : 1);'; then 75 | # this isn't perfect, but it's better than nothing 76 | # (for example, 'opcache.so' presents inside PHP as 'Zend OPcache', not 'opcache') 77 | echo >&2 78 | echo >&2 "warning: $ext ($module) is already loaded!" 79 | echo >&2 80 | continue 81 | fi 82 | 83 | ini="/usr/local/etc/php/conf.d/${iniName:-"docker-php-ext-$ext.ini"}" 84 | if ! grep -q "$line" "$ini" 2>/dev/null; then 85 | echo "$line" >> "$ini" 86 | fi 87 | done 88 | -------------------------------------------------------------------------------- /base/build/php/5.6/fpm/docker-php-ext-enable: -------------------------------------------------------------------------------- 1 | # *** DO NOT EDIT THIS FILE MANUALLY *** 2 | # *** Will be overwritten by 'make update' *** 3 | #!/bin/bash 4 | set -e 5 | 6 | cd "$(php -r 'echo ini_get("extension_dir");')" 7 | 8 | usage() { 9 | echo "usage: $0 [options] module-name [module-name ...]" 10 | echo " ie: $0 gd mysqli" 11 | echo " $0 pdo pdo_mysql" 12 | echo " $0 --ini-name 0-apc.ini apcu apc" 13 | echo 14 | echo 'Possible values for module-name:' 15 | echo $(find -maxdepth 1 -type f -name '*.so' -exec basename '{}' ';' | sort) 16 | } 17 | 18 | opts="$(getopt -o 'h?' --long 'help,ini-name:' -- "$@" || { usage >&2 && false; })" 19 | eval set -- "$opts" 20 | 21 | iniName= 22 | while true; do 23 | flag="$1" 24 | shift 25 | case "$flag" in 26 | --help|-h|'-?') usage && exit 0 ;; 27 | --ini-name) iniName="$1" && shift ;; 28 | --) break ;; 29 | *) 30 | { 31 | echo "error: unknown flag: $flag" 32 | usage 33 | } >&2 34 | exit 1 35 | ;; 36 | esac 37 | done 38 | 39 | modules=() 40 | while [ $# -gt 0 ]; do 41 | module="$1" 42 | shift 43 | if [ -z "$module" ]; then 44 | continue 45 | fi 46 | if [ -f "$module.so" -a ! -f "$module" ]; then 47 | # allow ".so" to be optional 48 | module+='.so' 49 | fi 50 | if [ ! -f "$module" ]; then 51 | echo >&2 "error: $(readlink -f "$module") does not exist" 52 | echo >&2 53 | usage >&2 54 | exit 1 55 | fi 56 | modules+=( "$module" ) 57 | done 58 | 59 | if [ "${#modules[@]}" -eq 0 ]; then 60 | usage >&2 61 | exit 1 62 | fi 63 | 64 | for module in "${modules[@]}"; do 65 | if nm -g "$module" | grep -q ' zend_extension_entry$'; then 66 | # https://wiki.php.net/internals/extensions#loading_zend_extensions 67 | line="zend_extension=$(readlink -f "$module")" 68 | else 69 | line="extension=$module" 70 | fi 71 | 72 | ext="$(basename "$module")" 73 | ext="${ext%.*}" 74 | if php -r 'exit(extension_loaded("'"$ext"'") ? 0 : 1);'; then 75 | # this isn't perfect, but it's better than nothing 76 | # (for example, 'opcache.so' presents inside PHP as 'Zend OPcache', not 'opcache') 77 | echo >&2 78 | echo >&2 "warning: $ext ($module) is already loaded!" 79 | echo >&2 80 | continue 81 | fi 82 | 83 | ini="/usr/local/etc/php/conf.d/${iniName:-"docker-php-ext-$ext.ini"}" 84 | if ! grep -q "$line" "$ini" 2>/dev/null; then 85 | echo "$line" >> "$ini" 86 | fi 87 | done 88 | -------------------------------------------------------------------------------- /hubot/Dockerfile: -------------------------------------------------------------------------------- 1 | # This image minimal redis image based on https://hub.docker.com/r/nhoag/hubo & 2 | # https://github.com/pgarbe/tatsu-hubo 3 | 4 | # Pull base image. 5 | FROM rounds/10m-base 6 | 7 | MAINTAINER Aviv Laufer, aviv@rounds.com 8 | RUN apt-get update && \ 9 | apt-get install -y software-properties-common 10 | 11 | RUN apt-get -y install expect nodejs npm python-pip 12 | 13 | RUN apt-get clean && \ 14 | rm -rf /var/lib/apt/lists/* 15 | 16 | RUN ln -s /usr/bin/nodejs /usr/bin/node 17 | 18 | RUN npm install -g coffee-script 19 | RUN npm install -g yo generator-hubot 20 | 21 | # Create hubot user 22 | RUN useradd -d /hubot -m -s /bin/bash -U hubot 23 | # 24 | # # Log in as hubot user and change directory 25 | USER hubot 26 | WORKDIR /hubot 27 | # 28 | # # Install hubot 29 | RUN yo hubot --owner="Golem " --name="marvin" --description="Marvin the Paranoid Android" --defaults 30 | # 31 | # # Some adapters / scripts 32 | RUN npm install hubot-slack --save && npm install 33 | RUN npm install hubot-standup-alarm --save && npm install 34 | RUN npm install hubot-auth --save && npm install 35 | RUN npm install hubot-google-translate --save && npm install 36 | RUN npm install hubot-alias --save && npm install 37 | RUN npm install hubot-youtube --save && npm install 38 | 39 | RUN npm install hubot-diagnostics --save && npm install 40 | RUN npm install hubot-google-images --save && npm install 41 | RUN npm install hubot-help --save && npm install 42 | RUN npm install hubot-pugme --save && npm install 43 | RUN npm install hubot-redis-brain --save && npm install 44 | RUN npm install hubot-rules --save && npm install 45 | RUN npm install hubot-scripts --save && npm install 46 | RUN npm install hubot-shipit --save && npm install 47 | RUN npm install hubot-devops-reactions --save && npm install 48 | RUN npm install hubot-has-no-idea --save && npm install 49 | RUN npm install moment --save && npm install 50 | RUN npm install htmlparser --save && npm install 51 | RUN npm install soupselect --save && npm install 52 | RUN npm install xml2js --save && npm install 53 | RUN npm install hubot-seen --save && npm install 54 | # 55 | # # Activate some built-in scripts 56 | ADD hubot/hubot-scripts.json /hubot/ 57 | ADD hubot/external-scripts.json /hubot/ 58 | # 59 | RUN npm install cheerio --save && npm install 60 | ADD hubot/scripts/* /hubot/scripts/ 61 | # 62 | # # And go 63 | #CMD ["/bin/sh", "-c", "aws s3 cp --region eu-west-1 s3://pgarbe-secrets/env.sh .; . ./env.sh; bin/hubot --adapter slack"] 64 | #: 65 | RUN sed -e'/^export/a export REDIS_URL="${REDIS_PORT}"' bin/hubot > bin/hubot.run 66 | RUN chmod +x bin/hubot.run 67 | CMD bin/hubot.run --adapter slack 68 | -------------------------------------------------------------------------------- /base/build/php/5.6/Dockerfile: -------------------------------------------------------------------------------- 1 | # *** DO NOT EDIT THIS FILE MANUALLY *** 2 | # *** Will be overwritten by 'make update' *** 3 | FROM rounds/10m-build 4 | 5 | # persistent / runtime deps 6 | RUN apt-get update && apt-get install -y ca-certificates curl librecode0 libsqlite3-0 libxml2 --no-install-recommends && rm -r /var/lib/apt/lists/* 7 | 8 | # phpize deps 9 | RUN apt-get update && apt-get install -y autoconf file g++ gcc libc-dev make pkg-config re2c --no-install-recommends && rm -r /var/lib/apt/lists/* 10 | 11 | ENV PHP_INI_DIR /usr/local/etc/php 12 | RUN mkdir -p $PHP_INI_DIR/conf.d 13 | 14 | #### 15 | #### 16 | 17 | ENV GPG_KEYS 0BD78B5F97500D450838F95DFE857D9A90D90EC1 6E4F6AB321FDC07F2C332E3AC2BF0BC433CFC8B3 18 | RUN set -xe \ 19 | && for key in $GPG_KEYS; do \ 20 | gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ 21 | done 22 | 23 | ENV PHP_VERSION 5.6.17 24 | ENV PHP_FILENAME php-5.6.17.tar.xz 25 | ENV PHP_SHA256 ea9d5749380c7c7171e131616466deacd7cb124b5010eafc34e551b0a7b0fb2c 26 | 27 | # --enable-mysqlnd is included below because it's harder to compile after the fact the extensions are (since it's a plugin for several extensions, not an extension in itself) 28 | RUN buildDeps=" \ 29 | $PHP_EXTRA_BUILD_DEPS \ 30 | libcurl4-openssl-dev \ 31 | libreadline6-dev \ 32 | librecode-dev \ 33 | libsqlite3-dev \ 34 | libssl-dev \ 35 | libxml2-dev \ 36 | xz-utils \ 37 | " \ 38 | && set -x \ 39 | && apt-get update && apt-get install -y $buildDeps --no-install-recommends && rm -rf /var/lib/apt/lists/* \ 40 | && curl -fSL "http://php.net/get/$PHP_FILENAME/from/this/mirror" -o "$PHP_FILENAME" \ 41 | && echo "$PHP_SHA256 *$PHP_FILENAME" | sha256sum -c - \ 42 | && curl -fSL "http://php.net/get/$PHP_FILENAME.asc/from/this/mirror" -o "$PHP_FILENAME.asc" \ 43 | && gpg --verify "$PHP_FILENAME.asc" \ 44 | && mkdir -p /usr/src/php \ 45 | && tar -xf "$PHP_FILENAME" -C /usr/src/php --strip-components=1 \ 46 | && rm "$PHP_FILENAME"* \ 47 | && cd /usr/src/php \ 48 | && ./configure --enable-zip --enable-opcache --enable-mbstring=all \ 49 | --with-config-file-path="$PHP_INI_DIR" \ 50 | --with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \ 51 | $PHP_EXTRA_CONFIGURE_ARGS \ 52 | --disable-cgi \ 53 | --enable-mysqlnd \ 54 | --with-curl \ 55 | --with-openssl \ 56 | --with-readline \ 57 | --with-recode \ 58 | --with-zlib \ 59 | && make -j"$(nproc)" \ 60 | && make install \ 61 | && { find /usr/local/bin /usr/local/sbin -type f -executable -exec strip --strip-all '{}' + || true; } \ 62 | && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false -o APT::AutoRemove::SuggestsImportant=false $buildDeps \ 63 | && make clean 64 | 65 | COPY docker-php-ext-* /usr/local/bin/ 66 | 67 | #### 68 | CMD ["php", "-a"] 69 | #### 70 | -------------------------------------------------------------------------------- /hubot/hubot/scripts/example.coffee: -------------------------------------------------------------------------------- 1 | # Description: 2 | # Example scripts for you to examine and try out. 3 | # 4 | # Notes: 5 | # They are commented out by default, because most of them are pretty silly and 6 | # wouldn't be useful and amusing enough for day to day huboting. 7 | # Uncomment the ones you want to try and experiment with. 8 | # 9 | # These are from the scripting documentation: https://github.com/github/hubot/blob/master/docs/scripting.md 10 | 11 | module.exports = (robot) -> 12 | 13 | # robot.hear /badger/i, (msg) -> 14 | # msg.send "Badgers? BADGERS? WE DON'T NEED NO STINKIN BADGERS" 15 | # 16 | # robot.respond /open the (.*) doors/i, (msg) -> 17 | # doorType = msg.match[1] 18 | # if doorType is "pod bay" 19 | # msg.reply "I'm afraid I can't let you do that." 20 | # else 21 | # msg.reply "Opening #{doorType} doors" 22 | # 23 | # robot.hear /I like pie/i, (msg) -> 24 | # msg.emote "makes a freshly baked pie" 25 | # 26 | # lulz = ['lol', 'rofl', 'lmao'] 27 | # 28 | # robot.respond /lulz/i, (msg) -> 29 | # msg.send msg.random lulz 30 | # 31 | # robot.topic (msg) -> 32 | # msg.send "#{msg.message.text}? That's a Paddlin'" 33 | # 34 | # 35 | # enterReplies = ['Hi', 'Target Acquired', 'Firing', 'Hello friend.', 'Gotcha', 'I see you'] 36 | # leaveReplies = ['Are you still there?', 'Target lost', 'Searching'] 37 | # 38 | # robot.enter (msg) -> 39 | # msg.send msg.random enterReplies 40 | # robot.leave (msg) -> 41 | # msg.send msg.random leaveReplies 42 | # 43 | # answer = process.env.HUBOT_ANSWER_TO_THE_ULTIMATE_QUESTION_OF_LIFE_THE_UNIVERSE_AND_EVERYTHING 44 | # 45 | # robot.respond /what is the answer to the ultimate question of life/, (msg) -> 46 | # unless answer? 47 | # msg.send "Missing HUBOT_ANSWER_TO_THE_ULTIMATE_QUESTION_OF_LIFE_THE_UNIVERSE_AND_EVERYTHING in environment: please set and try again" 48 | # return 49 | # msg.send "#{answer}, but what is the question?" 50 | # 51 | # robot.respond /you are a little slow/, (msg) -> 52 | # setTimeout () -> 53 | # msg.send "Who you calling 'slow'?" 54 | # , 60 * 1000 55 | # 56 | # annoyIntervalId = null 57 | # 58 | # robot.respond /annoy me/, (msg) -> 59 | # if annoyIntervalId 60 | # msg.send "AAAAAAAAAAAEEEEEEEEEEEEEEEEEEEEEEEEIIIIIIIIHHHHHHHHHH" 61 | # return 62 | # 63 | # msg.send "Hey, want to hear the most annoying sound in the world?" 64 | # annoyIntervalId = setInterval () -> 65 | # msg.send "AAAAAAAAAAAEEEEEEEEEEEEEEEEEEEEEEEEIIIIIIIIHHHHHHHHHH" 66 | # , 1000 67 | # 68 | # robot.respond /unannoy me/, (msg) -> 69 | # if annoyIntervalId 70 | # msg.send "GUYS, GUYS, GUYS!" 71 | # clearInterval(annoyIntervalId) 72 | # annoyIntervalId = null 73 | # else 74 | # msg.send "Not annoying you right now, am I?" 75 | # 76 | # 77 | # robot.router.post '/hubot/chatsecrets/:room', (req, res) -> 78 | # room = req.params.room 79 | # data = JSON.parse req.body.payload 80 | # secret = data.secret 81 | # 82 | # robot.messageRoom room, "I have a secret: #{secret}" 83 | # 84 | # res.send 'OK' 85 | # 86 | # robot.error (err, msg) -> 87 | # robot.logger.error "DOES NOT COMPUTE" 88 | # 89 | # if msg? 90 | # msg.reply "DOES NOT COMPUTE" 91 | # 92 | # robot.respond /have a soda/i, (msg) -> 93 | # # Get number of sodas had (coerced to a number). 94 | # sodasHad = robot.brain.get('totalSodas') * 1 or 0 95 | # 96 | # if sodasHad > 4 97 | # msg.reply "I'm too fizzy.." 98 | # 99 | # else 100 | # msg.reply 'Sure!' 101 | # 102 | # robot.brain.set 'totalSodas', sodasHad+1 103 | # 104 | # robot.respond /sleep it off/i, (msg) -> 105 | # robot.brain.set 'totalSodas', 0 106 | # robot.respond 'zzzzz' 107 | -------------------------------------------------------------------------------- /base/build/php/5.6/fpm/Dockerfile: -------------------------------------------------------------------------------- 1 | # *** DO NOT EDIT THIS FILE MANUALLY *** 2 | # *** Will be overwritten by 'make update' *** 3 | FROM rounds/10m-build 4 | 5 | # persistent / runtime deps 6 | RUN apt-get update && apt-get install -y ca-certificates curl librecode0 libsqlite3-0 libxml2 --no-install-recommends && rm -r /var/lib/apt/lists/* 7 | 8 | # phpize deps 9 | RUN apt-get update && apt-get install -y autoconf file g++ gcc libc-dev make pkg-config re2c --no-install-recommends && rm -r /var/lib/apt/lists/* 10 | 11 | ENV PHP_INI_DIR /usr/local/etc/php 12 | RUN mkdir -p $PHP_INI_DIR/conf.d 13 | 14 | #### 15 | ENV PHP_EXTRA_CONFIGURE_ARGS --enable-fpm --with-fpm-user=www-data --with-fpm-group=www-data 16 | #### 17 | 18 | ENV GPG_KEYS 0BD78B5F97500D450838F95DFE857D9A90D90EC1 6E4F6AB321FDC07F2C332E3AC2BF0BC433CFC8B3 19 | RUN set -xe \ 20 | && for key in $GPG_KEYS; do \ 21 | gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ 22 | done 23 | 24 | ENV PHP_VERSION 5.6.17 25 | ENV PHP_FILENAME php-5.6.17.tar.xz 26 | ENV PHP_SHA256 ea9d5749380c7c7171e131616466deacd7cb124b5010eafc34e551b0a7b0fb2c 27 | 28 | # --enable-mysqlnd is included below because it's harder to compile after the fact the extensions are (since it's a plugin for several extensions, not an extension in itself) 29 | RUN buildDeps=" \ 30 | $PHP_EXTRA_BUILD_DEPS \ 31 | libcurl4-openssl-dev \ 32 | libreadline6-dev \ 33 | librecode-dev \ 34 | libsqlite3-dev \ 35 | libssl-dev \ 36 | libxml2-dev \ 37 | xz-utils \ 38 | " \ 39 | && set -x \ 40 | && apt-get update && apt-get install -y $buildDeps --no-install-recommends && rm -rf /var/lib/apt/lists/* \ 41 | && curl -fSL "http://php.net/get/$PHP_FILENAME/from/this/mirror" -o "$PHP_FILENAME" \ 42 | && echo "$PHP_SHA256 *$PHP_FILENAME" | sha256sum -c - \ 43 | && curl -fSL "http://php.net/get/$PHP_FILENAME.asc/from/this/mirror" -o "$PHP_FILENAME.asc" \ 44 | && gpg --verify "$PHP_FILENAME.asc" \ 45 | && mkdir -p /usr/src/php \ 46 | && tar -xf "$PHP_FILENAME" -C /usr/src/php --strip-components=1 \ 47 | && rm "$PHP_FILENAME"* \ 48 | && cd /usr/src/php \ 49 | && ./configure --enable-zip --enable-opcache --enable-mbstring=all \ 50 | --with-config-file-path="$PHP_INI_DIR" \ 51 | --with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \ 52 | $PHP_EXTRA_CONFIGURE_ARGS \ 53 | --disable-cgi \ 54 | --enable-mysqlnd \ 55 | --with-curl \ 56 | --with-openssl \ 57 | --with-readline \ 58 | --with-recode \ 59 | --with-zlib \ 60 | && make -j"$(nproc)" \ 61 | && make install \ 62 | && { find /usr/local/bin /usr/local/sbin -type f -executable -exec strip --strip-all '{}' + || true; } \ 63 | && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false -o APT::AutoRemove::SuggestsImportant=false $buildDeps \ 64 | && make clean 65 | 66 | COPY docker-php-ext-* /usr/local/bin/ 67 | 68 | #### 69 | WORKDIR /var/www/html 70 | 71 | RUN set -ex \ 72 | && cd /usr/local/etc \ 73 | && if [ -d php-fpm.d ]; then \ 74 | # for some reason, upstream's php-fpm.conf.default has "include=NONE/etc/php-fpm.d/*.conf" 75 | sed 's!=NONE/!=!g' php-fpm.conf.default | tee php-fpm.conf > /dev/null; \ 76 | cp php-fpm.d/www.conf.default php-fpm.d/www.conf; \ 77 | else \ 78 | # PHP 5.x don't use "include=" by default, so we'll create our own simple config that mimics PHP 7+ for consistency 79 | mkdir php-fpm.d; \ 80 | cp php-fpm.conf.default php-fpm.d/www.conf; \ 81 | { \ 82 | echo '[global]'; \ 83 | echo 'include=etc/php-fpm.d/*.conf'; \ 84 | } | tee php-fpm.conf; \ 85 | fi \ 86 | && { \ 87 | echo '[global]'; \ 88 | echo 'error_log = /proc/self/fd/2'; \ 89 | echo; \ 90 | echo '[www]'; \ 91 | echo '; if we send this to /proc/self/fd/1, it never appears'; \ 92 | echo 'access.log = /proc/self/fd/2'; \ 93 | echo; \ 94 | echo 'clear_env = no'; \ 95 | echo; \ 96 | echo '; Ensure worker stdout and stderr are sent to the main error log.'; \ 97 | echo 'catch_workers_output = yes'; \ 98 | } | tee php-fpm.d/docker.conf \ 99 | && { \ 100 | echo '[global]'; \ 101 | echo 'daemonize = no'; \ 102 | echo; \ 103 | echo '[www]'; \ 104 | echo 'listen = [::]:9000'; \ 105 | } | tee php-fpm.d/zz-docker.conf 106 | 107 | EXPOSE 9000 108 | CMD ["php-fpm"] 109 | #### 110 | -------------------------------------------------------------------------------- /hubot/hubot/scripts/sensu.coffee: -------------------------------------------------------------------------------- 1 | # Description: 2 | # Sensu API hubot client 3 | # 4 | # Dependencies: 5 | # "moment": ">=1.6.0" 6 | # 7 | # Configuration: 8 | # HUBOT_SENSU_API_UR - URL for the sensu api service. http://sensu.yourdomain.com:4567 9 | # HUBOT_SENSU_DOMAIN - Domain to force on all clients. Not used if blank/unset 10 | # 11 | # Commands: 12 | # hubot sensu info - show sensu api info 13 | # hubot sensu stashes - show contents of the sensu stash 14 | # hubot sensu silence [/service] [for \d+[unit]] - silence an alert for an optional period of time (default 1h) 15 | # hubot sensu remove stash - remove a stash from sensu 16 | # hubot sensu clients - show all clients 17 | # hubot sensu client [ history] - show a specific client['s history] 18 | # hubot sensu sensu remove client - remove a client from sensu 19 | # hubot sensu events[ for ] - show all events or for a specific client 20 | # hubot sensu resolve event / - resolve a sensu event 21 | # 22 | # Notes: 23 | # Requires Sensu >= 0.12 because of expire parameter on stashes and updated /resolve and /request endpoints 24 | # Checks endpoint not implemented (http://docs.sensuapp.org/0.12/api/checks.html) -- also note /check/request is deprecated in favor of /request 25 | # Aggregates endpoint not implemented (http://docs.sensuapp.org/0.12/api/aggregates.html) 26 | # 27 | # Author: 28 | # Justin Lambert - jlambert121 29 | # 30 | 31 | config = 32 | sensu_api: process.env.HUBOT_SENSU_API_URL 33 | 34 | moment = require('moment') 35 | 36 | module.exports = (robot) -> 37 | 38 | validateVars = () -> 39 | unless config.sensu_api 40 | robot.logger.error "HUBOT_SENSU_API_URL is unset" 41 | msg.send "Please set the HUBOT_SENSU_API_URL environment variable." 42 | return 43 | 44 | ###################### 45 | #### Info methods #### 46 | ###################### 47 | robot.respond /sensu help/i, (msg) -> 48 | cmds = robot.helpCommands() 49 | cmds = (cmd for cmd in cmds when cmd.match(/(sensu)/)) 50 | msg.send cmds.join("\n") 51 | 52 | robot.respond /sensu info/i, (msg) -> 53 | validateVars 54 | robot.http(config.sensu_api + '/info') 55 | .get() (err, res, body) -> 56 | if err 57 | msg.send "Sensu says: #{err}" 58 | return 59 | if res.statusCode is 200 60 | result = JSON.parse(body) 61 | message = "Sensu version: #{result['sensu']['version']}" 62 | message = message + '\nRabbitMQ: ' + result['transport']['connected'] + ', redis: ' + result['redis']['connected'] 63 | message = message + '\nRabbitMQ keepalives (messages/consumers): (' + result['transport']['keepalives']['messages'] + '/' + result['transport']['keepalives']['consumers'] + ')' 64 | message = message + '\nRabbitMQ results (messages/consumers):' + result['transport']['results']['messages'] + '/' + result['transport']['results']['consumers'] + ')' 65 | msg.send message 66 | else 67 | msg.send "An error occurred retrieving sensu info (#{res.statusCode}: #{body})" 68 | 69 | 70 | ####################### 71 | #### Stash methods #### 72 | ####################### 73 | robot.respond /(?:sensu)? stashes/i, (msg) -> 74 | validateVars 75 | robot.http(config.sensu_api + '/stashes') 76 | .get() (err, res, body) -> 77 | if err 78 | msg.send "Sensu says: #{err}" 79 | return 80 | results = JSON.parse(body) 81 | output = [] 82 | for result,value of results 83 | console.log value 84 | message = value['path'] + ' added on ' + moment.unix(value['content']['timestamp']).format('HH:MM M/D/YY') 85 | if value['content']['by'] 86 | message = message + ' by ' + value['content']['by'] 87 | if value['expire'] and value['expire'] > 0 88 | message = message + ', expires in ' + value['expire'] + ' seconds' 89 | output.push message 90 | msg.send output.sort().join('\n') 91 | 92 | robot.respond /(?:sensu)? silence ([^\s\/]*)(?:\/)?([^\s]*)?(?: for (\d+)(\w))?/i, (msg) -> 93 | # msg.match[1] = client 94 | # msg.match[2] = event (optional) 95 | # msg.match[3] = duration (optional) 96 | # msg.match[4] = units (required if duration) 97 | 98 | validateVars 99 | client = addClientDomain(msg.match[1]) 100 | 101 | if msg.match[2] 102 | path = client + '/' + msg.match[2] 103 | else 104 | path = client 105 | 106 | duration = msg.match[3] 107 | if msg.match[4] 108 | unit = msg.match[4] 109 | switch unit 110 | when 's' 111 | expiration = duration * 1 112 | when 'm' 113 | expiration = duration * 60 114 | 115 | when 'h' 116 | expiration = duration * 3600 117 | when 'd' 118 | expiration = duration * 24 * 3600 119 | else 120 | msg.send 'Unknown duration (' + unit + '). I know s (seconds), m (minutes), h (hours), and d (days)' 121 | return 122 | human_d = duration + unit 123 | else 124 | expiration = 3600 125 | human_d = '1h' 126 | 127 | data = {} 128 | data['content'] = {} 129 | data['content']['timestamp'] = moment().unix() 130 | data['content']['by'] = msg.message.user.name 131 | data['expire'] = expiration 132 | data['path'] = 'silence/' + path 133 | 134 | robot.http(config.sensu_api + '/stashes') 135 | .post(JSON.stringify(data)) (err, res, body) -> 136 | if res.statusCode is 201 137 | msg.send path + ' silenced for ' + human_d 138 | else if res.statusCode is 400 139 | msg.send 'API returned malformed error for path silence/' + path + '\ndata: ' + JSON.stringify(data) 140 | else 141 | msg.send "API returned an error for path silence/#{path}\ndata: #{JSON.stringify(data)}\nresponse:#{res.statusCode}: #{body}" 142 | 143 | robot.respond /(?:sensu)? remove stash (.*)/i, (msg) -> 144 | validateVars 145 | 146 | stash = msg.match[1] 147 | unless stash.match /^silence\// 148 | stash = 'silence/' + stash 149 | 150 | # If it is only a hostname, verify domain name 151 | unless stash.match /^silence\/(.*)\// 152 | stash = addClientDomain(stash) 153 | 154 | robot.http(config.sensu_api + '/stashes/' + stash) 155 | .delete() (err, res, body) -> 156 | if err 157 | msg.send "Sensu says: #{err}" 158 | return 159 | if res.statusCode is 204 160 | msg.send stash + ' removed' 161 | else if res.statusCode is 404 162 | msg.send stash + ' not found' 163 | else 164 | msg.send "API returned an error removing #{stash} (#{res.statusCode}: #{body})" 165 | 166 | ######################## 167 | #### Client methods #### 168 | ######################## 169 | robot.respond /sensu clients/i, (msg) -> 170 | validateVars 171 | robot.http(config.sensu_api + '/clients') 172 | .get() (err, res, body) -> 173 | if err 174 | msg.send "Sensu says: #{err}" 175 | return 176 | results = JSON.parse(body) 177 | output = [] 178 | for result,value of results 179 | output.push value['name'] + ' (' + value['address'] + ') subscriptions: ' + value['subscriptions'].sort().join(', ') 180 | 181 | if output.length is 0 182 | msg.send 'No clients' 183 | else 184 | msg.send output.sort().join('\n') 185 | 186 | robot.respond /sensu client (.*)( history)/i, (msg) -> 187 | validateVars 188 | client = addClientDomain(msg.match[1]) 189 | 190 | robot.http(config.sensu_api + '/clients/' + client + '/history') 191 | .get() (err, res, body) -> 192 | if err 193 | msg.send "Sensu says: #{err}" 194 | return 195 | if res.statusCode is 200 196 | results = JSON.parse(body) 197 | output = [] 198 | for result,value of results 199 | output.push value['check'] + ' (last execution: ' + moment.unix(value['last_execution']).format('HH:MM M/D/YY') + ') history: ' + value['history'].join(', ') 200 | 201 | if output.length is 0 202 | msg.send 'No history found for ' + client 203 | else 204 | message = 'History for ' + client 205 | message = message + output.sort().join('\n') 206 | msg.send message 207 | else if res.statusCode is 404 208 | msg.send client + ' not found' 209 | else 210 | msg.send "An error occurred looking up #{client}'s history (#{res.statusCode}: #{body})" 211 | 212 | 213 | robot.respond /sensu client (.*)/i, (msg) -> 214 | validateVars 215 | client = addClientDomain(msg.match[1]) 216 | 217 | robot.http(config.sensu_api + '/clients/' + client) 218 | .get() (err, res, body) -> 219 | if err 220 | msg.send "Sensu says: #{err}" 221 | return 222 | if res.statusCode is 200 223 | result = JSON.parse(body) 224 | msg.send result['name'] + ' (' + result['address'] + ') subscriptions: ' + result['subscriptions'].sort().join(', ') 225 | else if res.statusCode is 404 226 | msg.send client + ' not found' 227 | else 228 | msg.send "An error occurred looking up #{client} #{res.statusCode}: #{body}" 229 | 230 | 231 | robot.respond /(?:sensu)? remove client (.*)/i, (msg) -> 232 | validateVars 233 | client= addClientDomain(msg.match[1]) 234 | 235 | robot.http(config.sensu_api + '/clients/' + client) 236 | .delete() (err, res, body) -> 237 | if err 238 | msg.send "Sensu says: #{err}" 239 | return 240 | if res.statusCode is 202 241 | msg.send client + ' removed' 242 | else if res.statusCode is 404 243 | msg.send client + ' not found' 244 | else 245 | msg.send "API returned an error removing #{client} (#{res.statusCode}: #{res.body})" 246 | 247 | ####################### 248 | #### Event methods #### 249 | ####################### 250 | robot.respond /sensu events(?: for (.*))?/i, (msg) -> 251 | validateVars 252 | if msg.match[1] 253 | client = '/' + addClientDomain(msg.match[1]) 254 | else 255 | client = '' 256 | 257 | robot.http(config.sensu_api + '/events' + client) 258 | .get() (err, res, body) -> 259 | if err 260 | msg.send "Sensu says: #{err}" 261 | return 262 | results = JSON.parse(body) 263 | output = [] 264 | for result,value of results 265 | if value['flapping'] 266 | flapping = ', flapping' 267 | else 268 | flapping = '' 269 | output.push value['client'] + ' (' + value['check'] + flapping + ') - ' + value['output'] 270 | if output.length is 0 271 | message = 'No events' 272 | if client != '' 273 | message = message + ' for ' + msg.match[1] 274 | msg.send message 275 | msg.send output.sort().join('\n') 276 | 277 | robot.respond /(?:sensu)? resolve event (.*)(?:\/)(.*)/i, (msg) -> 278 | validateVars 279 | client = addClientDomain(msg.match[1]) 280 | 281 | data = {} 282 | data['client'] = client 283 | data['check'] = msg.match[2] 284 | 285 | robot.http(config.sensu_api + '/resolve') 286 | .post(JSON.stringify(data)) (err, res, body) -> 287 | if err 288 | msg.send "Sensu says: #{err}" 289 | return 290 | if res.statusCode is 202 291 | msg.send 'Event resolved' 292 | else if res.statusCode is 404 293 | msg.send msg.match[1] + '/' + msg.match[2] + ' not found' 294 | else 295 | msg.send "API returned an error resolving #{msg.match[1]}/#{msg.match[2]} (#{res.statusCode}: #{res.body})" 296 | 297 | addClientDomain = (client) -> 298 | if process.env.HUBOT_SENSU_DOMAIN != undefined 299 | domainMatch = new RegExp("\.#{process.env.HUBOT_SENSU_DOMAIN}$", 'i') 300 | unless domainMatch.test(client) 301 | client = client + '.' + process.env.HUBOT_SENSU_DOMAIN 302 | client 303 | -------------------------------------------------------------------------------- /hubot/hubot/scripts/emoji-me.coffee: -------------------------------------------------------------------------------- 1 | # Description: 2 | # Hubot picks random emojis. 3 | # 4 | # Dependencies: 5 | # None 6 | # 7 | # Configuration: 8 | # None 9 | # 10 | # Commands: 11 | # hubot emoji me - Returns a random emoji 12 | # hubot emoji spin me - Spin the emoji slots 13 | # hubot emoji card me - Returns a random card against humanity with emoji 14 | # 15 | # Author: 16 | # sandbochs 17 | 18 | emoji = "bowtie,smile,laughing,blush,smiley,relaxed,smirk,heart_eyes,kissing_heart,kissing_closed_eyes,flushed,relieved,satisfied,grin,wink,stuck_out_tongue_winking_eye,stuck_out_tongue_closed_eyes,grinning,kissing,kissing_smiling_eyes,stuck_out_tongue,sleeping,worried,frowning,anguished,open_mouth,grimacing,confused,hushed,expressionless,unamused,sweat_smile,sweat,disappointed_relieved,weary,pensive,disappointed,confounded,fearful,cold_sweat,persevere,cry,sob,joy,astonished,scream,neckbeard,tired_face,angry,rage,triumph,sleepy,yum,mask,sunglasses,dizzy_face,imp,smiling_imp,neutral_face,no_mouth,innocent,alien,yellow_heart,blue_heart,purple_heart,heart,green_heart,broken_heart,heartbeat,heartpulse,two_hearts,revolving_hearts,cupid,sparkling_heart,sparkles,star,star2,dizzy,boom,collision,anger,exclamation,question,grey_exclamation,grey_question,zzz,dash,sweat_drops,notes,musical_note,fire,hankey,poop,shit,+1,thumbsup,-1,thumbsdown,ok_hand,punch,facepunch,fist,v,wave,hand,open_hands,point_up,point_down,point_left,point_right,raised_hands,pray,point_up_2,clap,muscle,metal,fu,walking,runner,running,couple,family,two_men_holding_hands,two_women_holding_hands,dancer,dancers,ok_woman,no_good,information_desk_person,raised_hand,bride_with_veil,person_with_pouting_face,person_frowning,bow,couplekiss,couple_with_heart,massage,haircut,nail_care,boy,girl,woman,man,baby,older_woman,older_man,person_with_blond_hair,man_with_gua_pi_mao,man_with_turban,construction_worker,cop,angel,princess,smiley_cat,smile_cat,heart_eyes_cat,kissing_cat,smirk_cat,scream_cat,crying_cat_face,joy_cat,pouting_cat,japanese_ogre,japanese_goblin,see_no_evil,hear_no_evil,speak_no_evil,guardsman,skull,feet,lips,kiss,droplet,ear,eyes,nose,tongue,love_letter,bust_in_silhouette,busts_in_silhouette,speech_balloon,thought_balloon,feelsgood,finnadie,goberserk,godmode,hurtrealbad,rage1,rage2,rage3,rage4,suspect,trollface,sunny,umbrella,cloud,snowflake,snowman,zap,cyclone,foggy,ocean,cat,dog,mouse,hamster,rabbit,wolf,frog,tiger,koala,bear,pig,pig_nose,cow,boar,monkey_face,monkey,horse,racehorse,camel,sheep,elephant,panda_face,snake,bird,baby_chick,hatched_chick,hatching_chick,chicken,penguin,turtle,bug,honeybee,ant,beetle,snail,octopus,tropical_fish,fish,whale,whale2,dolphin,cow2,ram,rat,water_buffalo,tiger2,rabbit2,dragon,goat,rooster,dog2,pig2,mouse2,ox,dragon_face,blowfish,crocodile,dromedary_camel,leopard,cat2,poodle,paw_prints,bouquet,cherry_blossom,tulip,four_leaf_clover,rose,sunflower,hibiscus,maple_leaf,leaves,fallen_leaf,herb,mushroom,cactus,palm_tree,evergreen_tree,deciduous_tree,chestnut,seedling,blossom,ear_of_rice,shell,globe_with_meridians,sun_with_face,full_moon_with_face,new_moon_with_face,new_moon,waxing_crescent_moon,first_quarter_moon,waxing_gibbous_moon,full_moon,waning_gibbous_moon,last_quarter_moon,waning_crescent_moon,last_quarter_moon_with_face,first_quarter_moon_with_face,moon,earth_africa,earth_americas,earth_asia,volcano,milky_way,partly_sunny,octocat,squirrel,bamboo,gift_heart,dolls,school_satchel,mortar_board,flags,fireworks,sparkler,wind_chime,rice_scene,jack_o_lantern,ghost,santa,christmas_tree,gift,bell,no_bell,tanabata_tree,tada,confetti_ball,balloon,crystal_ball,cd,dvd,floppy_disk,camera,video_camera,movie_camera,computer,tv,iphone,phone,telephone,telephone_receiver,pager,fax,minidisc,vhs,sound,speaker,mute,loudspeaker,mega,hourglass,hourglass_flowing_sand,alarm_clock,watch,radio,satellite,loop,mag,mag_right,unlock,lock,lock_with_ink_pen,closed_lock_with_key,key,bulb,flashlight,high_brightness,low_brightness,electric_plug,battery,calling,email,mailbox,postbox,bath,bathtub,shower,toilet,wrench,nut_and_bolt,hammer,seat,moneybag,yen,dollar,pound,euro,credit_card,money_with_wings,e-mail,inbox_tray,outbox_tray,envelope,incoming_envelope,postal_horn,mailbox_closed,mailbox_with_mail,mailbox_with_no_mail,door,smoking,bomb,gun,hocho,pill,syringe,page_facing_up,page_with_curl,bookmark_tabs,bar_chart,chart_with_upwards_trend,chart_with_downwards_trend,scroll,clipboard,calendar,date,card_index,file_folder,open_file_folder,scissors,pushpin,paperclip,black_nib,pencil2,straight_ruler,triangular_ruler,closed_book,green_book,blue_book,orange_book,notebook,notebook_with_decorative_cover,ledger,books,bookmark,name_badge,microscope,telescope,newspaper,football,basketball,soccer,baseball,tennis,8ball,rugby_football,bowling,golf,mountain_bicyclist,bicyclist,horse_racing,snowboarder,swimmer,surfer,ski,spades,hearts,clubs,diamonds,gem,ring,trophy,musical_score,musical_keyboard,violin,space_invader,video_game,black_joker,flower_playing_cards,game_die,dart,mahjong,clapper,memo,pencil,book,art,microphone,headphones,trumpet,saxophone,guitar,shoe,sandal,high_heel,lipstick,boot,shirt,tshirt,necktie,womans_clothes,dress,running_shirt_with_sash,jeans,kimono,bikini,ribbon,tophat,crown,womans_hat,mans_shoe,closed_umbrella,briefcase,handbag,pouch,purse,eyeglasses,fishing_pole_and_fish,coffee,tea,sake,baby_bottle,beer,beers,cocktail,tropical_drink,wine_glass,fork_and_knife,pizza,hamburger,fries,poultry_leg,meat_on_bone,spaghetti,curry,fried_shrimp,bento,sushi,fish_cake,rice_ball,rice_cracker,rice,ramen,stew,oden,dango,egg,bread,doughnut,custard,icecream,ice_cream,shaved_ice,birthday,cake,cookie,chocolate_bar,candy,lollipop,honey_pot,apple,green_apple,tangerine,lemon,cherries,grapes,watermelon,strawberry,peach,melon,banana,pear,pineapple,sweet_potato,eggplant,tomato,corn,house,house_with_garden,school,office,post_office,hospital,bank,convenience_store,love_hotel,hotel,wedding,church,department_store,european_post_office,city_sunrise,city_sunset,japanese_castle,european_castle,tent,factory,tokyo_tower,japan,mount_fuji,sunrise_over_mountains,sunrise,stars,statue_of_liberty,bridge_at_night,carousel_horse,rainbow,ferris_wheel,fountain,roller_coaster,ship,speedboat,boat,sailboat,rowboat,anchor,rocket,airplane,helicopter,steam_locomotive,tram,mountain_railway,bike,aerial_tramway,suspension_railway,mountain_cableway,tractor,blue_car,oncoming_automobile,car,red_car,taxi,oncoming_taxi,articulated_lorry,bus,oncoming_bus,rotating_light,police_car,oncoming_police_car,fire_engine,ambulance,minibus,truck,train,station,train2,bullettrain_front,bullettrain_side,light_rail,monorail,railway_car,trolleybus,ticket,fuelpump,vertical_traffic_light,traffic_light,warning,construction,beginner,atm,slot_machine,busstop,barber,hotsprings,checkered_flag,crossed_flags,izakaya_lantern,moyai,circus_tent,performing_arts,round_pushpin,triangular_flag_on_post,jp,kr,cn,us,fr,es,it,ru,gb,uk,de".split(',') 19 | lose_responses = ['You lose!'] 20 | win_responses = ['You win!'] 21 | black_cards = "TSA guidelines now prohibit __________ on airplanes.<>It's a pity that kids these days are all getting involved with __________.<>In 1,000 years, when paper money is but a distant memory, __________ will be our currency.<>Major League Baseball has banned __________ for giving players an unfair advantage.<>What is Batman's guilty pleasure?<>Next from J.K. Rowling: Harry Potter and the Chamber of __________.<>I'm sorry, Professor, but I couldn't complete my homework because of __________.<>What did I bring back from Mexico?<>__________? There's an app for that.<>Betcha can't have just one!<>What's my anti-drug?<>While the United States raced the Soviet Union to the moon, the Mexican government funneled millions of pesos into research on __________.<>In the new Disney Channel Original Movie, Hannah Montana struggles with __________ for the first time.<>What's my secret power?<>What's the new fad diet?<>What did Vin Diesel eat for dinner?<>When Pharaoh remained unmoved, Moses called down a Plague of __________.<>How am I maintaining my relationship status?<>What's the crustiest?<>When I'm in prison, I'll have __________ smuggled in.<>After Hurricane Katrina, Sean Penn brought __________ to the people of New Orleans.<>Instead of coal, Santa now gives the bad children __________.<>Life was difficult for cavemen before __________.<>What's Teach for America using to inspire inner city students to succeed?<>Who stole the cookies from the cookie jar?<>In Michael Jackson's final moments, he thought about __________.<>White people like __________.<>Why do I hurt all over?<>A romantic candlelit dinner would be incomplete without __________.<>What will I bring back in time to convince people that I am a powerful wizard?<>BILLY MAYS HERE FOR __________.<>The class field trip was completely ruined by __________.<>What's a girl's best friend?<>I wish I hadn't lost the instruction manual for __________.<>When I am President of the United States, I will create the Department of __________.<>What are my parents hiding from me?<>What never fails to liven up the party?<>What gets better with age?<>__________: good to the last drop.<>I got 99 problems but __________ ain't one.<>It's a trap!<>MTV's new reality show features eight washed-up celebrities living with __________.<>What would grandma find disturbing, yet oddly charming?<>What's the most emo?<>During sex, I like to think about __________.<>What ended my last relationship?<>What's that sound?<>__________. That's how I want to die.<>Why am I sticky?<>What's the next Happy Meal® toy?<>What's there a ton of in heaven?<>I do not know with what weapons World War III will be fought, but World War IV will be fought with __________.<>What will always get you laid?<>__________: kid tested, mother approved.<>Why can't I sleep at night?<>What's that smell?<>What helps Obama unwind?<>This is the way the world ends \ This is the way the world ends \ Not with a bang but with __________.<>Coming to Broadway this season, __________: The Musical.<>Anthropologists have recently discovered a primitive tribe that worships __________.<>But before I kill you, Mr. Bond, I must show you __________.<>Studies show that lab rats navigate mazes 50% faster after being exposed to __________.<>Due to a PR fiasco, Walmart no longer offers __________.<>When I am a billionaire, I shall erect a 50-foot statue to commemorate __________.<>In an attempt to reach a wider audience, the Smithsonian Museum of Natural History has opened an interactive exhibit on __________.<>War! What is it good for?<>What gives me uncontrollable gas?<>What do old people smell like?<>Sorry everyone, I just __________.<>Alternative medicine is now embracing the curative powers of __________.<>The U.S. has begun airdropping __________ to the children of Afghanistan.<>What does Dick Cheney prefer?<>During Picasso's often-overlooked Brown Period, he produced hundreds of paintings of __________.<>What don't you want to find in your Chinese food?<>I drink to forget __________.<>TSA guidelines now prohibit __________ on airplanes.<>It's a pity that kids these days are all getting involved with __________.<>In 1,000 years, when paper money is but a distant memory, __________ will be our currency.<>Major League Baseball has banned __________ for giving players an unfair advantage.<>What is Batman's guilty pleasure?<>Next from J.K. Rowling: Harry Potter and the Chamber of __________.<>I'm sorry, Professor, but I couldn't complete my homework because of __________.<>What did I bring back from Mexico?<>__________? There's an app for that.<>__________. Betcha can't have just one!<>What's my anti-drug?<>While the United States raced the Soviet Union to the moon, the Mexican government funneled millions of pesos into research on __________.<>In the new Disney Channel Original Movie, Hannah Montana struggles with __________ for the first time. <>What's my secret power?<>What's the new fad diet?<>What did Vin Diesel eat for dinner?<>When Pharaoh remained unmoved, Moses called down a Plague of __________.<>How am I maintaining my relationship status?<>What's the crustiest?<>In L.A. County Jail, word is you can trade 200 cigarettes for __________.<>After the earthquake, Sean Penn brought __________ to the people of Haiti.<>Instead of coal, Santa now gives the bad children __________.<>Life for American Indians was forever changed when the White Man introduced them to __________.<>What's Teach for America using to inspire inner city students to succeed?<>Maybe she's born with it. Maybe it's __________.<>In Michael Jackson's final moments, he thought about __________.<>White people like __________.<>Why do I hurt all over?<>A romantic, candlelit dinner would be incomplete without __________.<>What will I bring back in time to convince people that I am a powerful wizard?<>BILLY MAYS HERE FOR __________.<>The class field trip was completely ruined by __________.<>What's a girl's best friend?<>Dear Abby, I'm having some trouble with __________ and would like your advice.<>When I am President of the United States, I will create the Department of __________.<>What are my parents hiding from me?<>What never fails to liven up the party?<>What gets better with age?<>__________: Good to the last drop.<>I got 99 problems but __________ ain't one.<>__________. It's a trap!<>MTV's new reality show features eight washed-up celebrities living with __________.<>What would grandma find disturbing, yet oddly charming?<>What's the most emo?<>During sex, I like to think about __________.<>What ended my last relationship?<>What's that sound?<>__________. That's how I want to die.<>Why am I sticky?<>What's the next Happy Meal toy?<>What's there a ton of in heaven?<>I do not know with what weapons World War III will be fought, but World War IV will be fought with __________.<>What will always get you laid?<>__________: Kid-tested, mother-approved.<>Why can't I sleep at night?<>What's that smell?<>What helps Obama unwind?<>This is the way the world ends / This is the way the world ends / Not with a bang but with __________.<>Coming to Broadway this season, __________: The Musical.<>Anthropologists have recently discovered a primitive tribe that worships __________.<>But before I kill you, Mr. Bond, I must show you __________.<>Studies show that lab rats navigate mazes 50% faster after being exposed to __________.<>Next on ESPN2: The World Series of __________.<>When I am a billionaire, I shall erect a 50-foot statue to commemorate __________.<>In an attempt to reach a wider audience, the Smithsonian Museum of Natural History has opened an interactive exhibit on __________.<>War! What is it good for?<>What gives me uncontrollable gas?<>What do old people smell like?<>What am I giving up for Lent?<>Alternative medicine is now embracing the curative powers of __________.<>What did the US airdrop to the children of Afghanistan?<>What does Dick Cheney prefer?<>During Picasso's often-overlooked Brown Period, he produced hundreds of paintings of __________.<>What don't you want to find in your Chinese food?<>I drink to forget __________.<>__________. High five, bro.<>He who controls __________ controls the world.<>The CIA now interrogates enemy agents by repeatedly subjecting them to __________.<>In Rome, there are whisperings that the Vatican has a secret room devoted to __________.<>Science will never explain the origin of __________.<>When all else fails, I can always masturbate to __________.<>I learned the hard way that you can't cheer up a grieving friend with __________.<>In its new tourism campaign, Detroit proudly proclaims that it has finally eliminated __________.<>The socialist governments of Scandinavia have declared that access to __________ is a basic human right.<>In his new self-produced album, Kanye West raps over the sounds of __________.<>What's the gift that keeps on giving?<>This season on Man vs. Wild, Bear Grylls must survive in the depths of the Amazon with only __________ and his wits. <>When I pooped, what came out of my butt?<>In the distant future, historians will agree that __________ marked the beginning of America's decline.<>What has been making life difficult at the nudist colony?<>And I would have gotten away with it, too, if it hadn't been for __________.<>What brought the orgy to a grinding halt?<>That's right, I killed __________. How, you ask? __________.<>And the Academy Award for __________ goes to __________.<>For my next trick, I will pull __________ out of __________.<>In his new summer comedy, Rob Schneider is __________ trapped in the body of __________.<>When I was tripping on acid, __________ turned into __________.<>__________ is a slippery slope that leads to __________.<>In a world ravaged by __________, our only solace is __________.<>In M. Night Shyamalan's new movie, Bruce Willis discovers that __________ had really been __________ all along.<>I never truly understood __________ until I encountered __________.<>Rumor has it that Vladimir Putin's favorite dish is __________ stuffed with __________.<>Lifetime® presents __________, the story of __________.<>What's the next superhero/sidekick duo?".split('<>') 22 | 23 | module.exports = (robot) -> 24 | robot.respond /emoji( me)?$/i, (message) -> 25 | message.send random_emoji() 26 | robot.respond /emoji spin( me)?/i, (message) -> 27 | message.send spin_emoji() 28 | robot.respond /emoji card( me)?/i, (message) -> 29 | message.send card_emoji() 30 | 31 | random_emoji = (num = 1) -> 32 | return ":#{emoji[random_index(emoji)]}:" if num == 1 33 | 34 | emojis = [] 35 | 36 | while emojis.length < num 37 | r_emoji = emoji[random_index(emoji)] 38 | emojis.push(":#{r_emoji}:") unless includes(emojis, r_emoji) 39 | 40 | emojis 41 | 42 | spin_emoji = -> 43 | pool = random_emoji 4 44 | spin = [] 45 | counts = [0, 0, 0, 0] 46 | win = false 47 | 48 | while spin.length < 3 49 | index = random_index(pool) 50 | spin.push pool[index] 51 | counts[index] += 1 52 | 53 | for count in counts 54 | win = true if count == 3 55 | 56 | if win == true 57 | response = win_responses[random_index(win_responses)] 58 | else 59 | response = lose_responses[random_index(lose_responses)] 60 | 61 | "#{spin.join(' |')} : #{response}" 62 | 63 | card_emoji = -> 64 | replaced = false 65 | card = black_cards[random_index(black_cards)].split(' ') 66 | 67 | for word in card 68 | if word.match(/_{10}/) 69 | card[_i] = random_emoji() 70 | replaced = true 71 | 72 | card.push " #{random_emoji()}" if replaced == false 73 | card.join " " 74 | 75 | 76 | random_index = (array) -> 77 | Math.floor(Math.random() * array.length) 78 | 79 | includes = (array, element) -> 80 | for el in array 81 | return true if el == element 82 | 83 | false 84 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 2, June 1991 3 | 4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc., 5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 6 | Everyone is permitted to copy and distribute verbatim copies 7 | of this license document, but changing it is not allowed. 8 | 9 | Preamble 10 | 11 | The licenses for most software are designed to take away your 12 | freedom to share and change it. By contrast, the GNU General Public 13 | License is intended to guarantee your freedom to share and change free 14 | software--to make sure the software is free for all its users. This 15 | General Public License applies to most of the Free Software 16 | Foundation's software and to any other program whose authors commit to 17 | using it. (Some other Free Software Foundation software is covered by 18 | the GNU Lesser General Public License instead.) You can apply it to 19 | your programs, too. 20 | 21 | When we speak of free software, we are referring to freedom, not 22 | price. Our General Public Licenses are designed to make sure that you 23 | have the freedom to distribute copies of free software (and charge for 24 | this service if you wish), that you receive source code or can get it 25 | if you want it, that you can change the software or use pieces of it 26 | in new free programs; and that you know you can do these things. 27 | 28 | To protect your rights, we need to make restrictions that forbid 29 | anyone to deny you these rights or to ask you to surrender the rights. 30 | These restrictions translate to certain responsibilities for you if you 31 | distribute copies of the software, or if you modify it. 32 | 33 | For example, if you distribute copies of such a program, whether 34 | gratis or for a fee, you must give the recipients all the rights that 35 | you have. You must make sure that they, too, receive or can get the 36 | source code. And you must show them these terms so they know their 37 | rights. 38 | 39 | We protect your rights with two steps: (1) copyright the software, and 40 | (2) offer you this license which gives you legal permission to copy, 41 | distribute and/or modify the software. 42 | 43 | Also, for each author's protection and ours, we want to make certain 44 | that everyone understands that there is no warranty for this free 45 | software. If the software is modified by someone else and passed on, we 46 | want its recipients to know that what they have is not the original, so 47 | that any problems introduced by others will not reflect on the original 48 | authors' reputations. 49 | 50 | Finally, any free program is threatened constantly by software 51 | patents. We wish to avoid the danger that redistributors of a free 52 | program will individually obtain patent licenses, in effect making the 53 | program proprietary. To prevent this, we have made it clear that any 54 | patent must be licensed for everyone's free use or not licensed at all. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | GNU GENERAL PUBLIC LICENSE 60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 61 | 62 | 0. This License applies to any program or other work which contains 63 | a notice placed by the copyright holder saying it may be distributed 64 | under the terms of this General Public License. The "Program", below, 65 | refers to any such program or work, and a "work based on the Program" 66 | means either the Program or any derivative work under copyright law: 67 | that is to say, a work containing the Program or a portion of it, 68 | either verbatim or with modifications and/or translated into another 69 | language. (Hereinafter, translation is included without limitation in 70 | the term "modification".) Each licensee is addressed as "you". 71 | 72 | Activities other than copying, distribution and modification are not 73 | covered by this License; they are outside its scope. The act of 74 | running the Program is not restricted, and the output from the Program 75 | is covered only if its contents constitute a work based on the 76 | Program (independent of having been made by running the Program). 77 | Whether that is true depends on what the Program does. 78 | 79 | 1. You may copy and distribute verbatim copies of the Program's 80 | source code as you receive it, in any medium, provided that you 81 | conspicuously and appropriately publish on each copy an appropriate 82 | copyright notice and disclaimer of warranty; keep intact all the 83 | notices that refer to this License and to the absence of any warranty; 84 | and give any other recipients of the Program a copy of this License 85 | along with the Program. 86 | 87 | You may charge a fee for the physical act of transferring a copy, and 88 | you may at your option offer warranty protection in exchange for a fee. 89 | 90 | 2. You may modify your copy or copies of the Program or any portion 91 | of it, thus forming a work based on the Program, and copy and 92 | distribute such modifications or work under the terms of Section 1 93 | above, provided that you also meet all of these conditions: 94 | 95 | a) You must cause the modified files to carry prominent notices 96 | stating that you changed the files and the date of any change. 97 | 98 | b) You must cause any work that you distribute or publish, that in 99 | whole or in part contains or is derived from the Program or any 100 | part thereof, to be licensed as a whole at no charge to all third 101 | parties under the terms of this License. 102 | 103 | c) If the modified program normally reads commands interactively 104 | when run, you must cause it, when started running for such 105 | interactive use in the most ordinary way, to print or display an 106 | announcement including an appropriate copyright notice and a 107 | notice that there is no warranty (or else, saying that you provide 108 | a warranty) and that users may redistribute the program under 109 | these conditions, and telling the user how to view a copy of this 110 | License. (Exception: if the Program itself is interactive but 111 | does not normally print such an announcement, your work based on 112 | the Program is not required to print an announcement.) 113 | 114 | These requirements apply to the modified work as a whole. If 115 | identifiable sections of that work are not derived from the Program, 116 | and can be reasonably considered independent and separate works in 117 | themselves, then this License, and its terms, do not apply to those 118 | sections when you distribute them as separate works. But when you 119 | distribute the same sections as part of a whole which is a work based 120 | on the Program, the distribution of the whole must be on the terms of 121 | this License, whose permissions for other licensees extend to the 122 | entire whole, and thus to each and every part regardless of who wrote it. 123 | 124 | Thus, it is not the intent of this section to claim rights or contest 125 | your rights to work written entirely by you; rather, the intent is to 126 | exercise the right to control the distribution of derivative or 127 | collective works based on the Program. 128 | 129 | In addition, mere aggregation of another work not based on the Program 130 | with the Program (or with a work based on the Program) on a volume of 131 | a storage or distribution medium does not bring the other work under 132 | the scope of this License. 133 | 134 | 3. You may copy and distribute the Program (or a work based on it, 135 | under Section 2) in object code or executable form under the terms of 136 | Sections 1 and 2 above provided that you also do one of the following: 137 | 138 | a) Accompany it with the complete corresponding machine-readable 139 | source code, which must be distributed under the terms of Sections 140 | 1 and 2 above on a medium customarily used for software interchange; or, 141 | 142 | b) Accompany it with a written offer, valid for at least three 143 | years, to give any third party, for a charge no more than your 144 | cost of physically performing source distribution, a complete 145 | machine-readable copy of the corresponding source code, to be 146 | distributed under the terms of Sections 1 and 2 above on a medium 147 | customarily used for software interchange; or, 148 | 149 | c) Accompany it with the information you received as to the offer 150 | to distribute corresponding source code. (This alternative is 151 | allowed only for noncommercial distribution and only if you 152 | received the program in object code or executable form with such 153 | an offer, in accord with Subsection b above.) 154 | 155 | The source code for a work means the preferred form of the work for 156 | making modifications to it. For an executable work, complete source 157 | code means all the source code for all modules it contains, plus any 158 | associated interface definition files, plus the scripts used to 159 | control compilation and installation of the executable. However, as a 160 | special exception, the source code distributed need not include 161 | anything that is normally distributed (in either source or binary 162 | form) with the major components (compiler, kernel, and so on) of the 163 | operating system on which the executable runs, unless that component 164 | itself accompanies the executable. 165 | 166 | If distribution of executable or object code is made by offering 167 | access to copy from a designated place, then offering equivalent 168 | access to copy the source code from the same place counts as 169 | distribution of the source code, even though third parties are not 170 | compelled to copy the source along with the object code. 171 | 172 | 4. You may not copy, modify, sublicense, or distribute the Program 173 | except as expressly provided under this License. Any attempt 174 | otherwise to copy, modify, sublicense or distribute the Program is 175 | void, and will automatically terminate your rights under this License. 176 | However, parties who have received copies, or rights, from you under 177 | this License will not have their licenses terminated so long as such 178 | parties remain in full compliance. 179 | 180 | 5. You are not required to accept this License, since you have not 181 | signed it. However, nothing else grants you permission to modify or 182 | distribute the Program or its derivative works. These actions are 183 | prohibited by law if you do not accept this License. Therefore, by 184 | modifying or distributing the Program (or any work based on the 185 | Program), you indicate your acceptance of this License to do so, and 186 | all its terms and conditions for copying, distributing or modifying 187 | the Program or works based on it. 188 | 189 | 6. Each time you redistribute the Program (or any work based on the 190 | Program), the recipient automatically receives a license from the 191 | original licensor to copy, distribute or modify the Program subject to 192 | these terms and conditions. You may not impose any further 193 | restrictions on the recipients' exercise of the rights granted herein. 194 | You are not responsible for enforcing compliance by third parties to 195 | this License. 196 | 197 | 7. If, as a consequence of a court judgment or allegation of patent 198 | infringement or for any other reason (not limited to patent issues), 199 | conditions are imposed on you (whether by court order, agreement or 200 | otherwise) that contradict the conditions of this License, they do not 201 | excuse you from the conditions of this License. If you cannot 202 | distribute so as to satisfy simultaneously your obligations under this 203 | License and any other pertinent obligations, then as a consequence you 204 | may not distribute the Program at all. For example, if a patent 205 | license would not permit royalty-free redistribution of the Program by 206 | all those who receive copies directly or indirectly through you, then 207 | the only way you could satisfy both it and this License would be to 208 | refrain entirely from distribution of the Program. 209 | 210 | If any portion of this section is held invalid or unenforceable under 211 | any particular circumstance, the balance of the section is intended to 212 | apply and the section as a whole is intended to apply in other 213 | circumstances. 214 | 215 | It is not the purpose of this section to induce you to infringe any 216 | patents or other property right claims or to contest validity of any 217 | such claims; this section has the sole purpose of protecting the 218 | integrity of the free software distribution system, which is 219 | implemented by public license practices. Many people have made 220 | generous contributions to the wide range of software distributed 221 | through that system in reliance on consistent application of that 222 | system; it is up to the author/donor to decide if he or she is willing 223 | to distribute software through any other system and a licensee cannot 224 | impose that choice. 225 | 226 | This section is intended to make thoroughly clear what is believed to 227 | be a consequence of the rest of this License. 228 | 229 | 8. If the distribution and/or use of the Program is restricted in 230 | certain countries either by patents or by copyrighted interfaces, the 231 | original copyright holder who places the Program under this License 232 | may add an explicit geographical distribution limitation excluding 233 | those countries, so that distribution is permitted only in or among 234 | countries not thus excluded. In such case, this License incorporates 235 | the limitation as if written in the body of this License. 236 | 237 | 9. The Free Software Foundation may publish revised and/or new versions 238 | of the General Public License from time to time. Such new versions will 239 | be similar in spirit to the present version, but may differ in detail to 240 | address new problems or concerns. 241 | 242 | Each version is given a distinguishing version number. If the Program 243 | specifies a version number of this License which applies to it and "any 244 | later version", you have the option of following the terms and conditions 245 | either of that version or of any later version published by the Free 246 | Software Foundation. If the Program does not specify a version number of 247 | this License, you may choose any version ever published by the Free Software 248 | Foundation. 249 | 250 | 10. If you wish to incorporate parts of the Program into other free 251 | programs whose distribution conditions are different, write to the author 252 | to ask for permission. For software which is copyrighted by the Free 253 | Software Foundation, write to the Free Software Foundation; we sometimes 254 | make exceptions for this. Our decision will be guided by the two goals 255 | of preserving the free status of all derivatives of our free software and 256 | of promoting the sharing and reuse of software generally. 257 | 258 | NO WARRANTY 259 | 260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY 261 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN 262 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES 263 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED 264 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 265 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS 266 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE 267 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, 268 | REPAIR OR CORRECTION. 269 | 270 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 271 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR 272 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, 273 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING 274 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED 275 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY 276 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER 277 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE 278 | POSSIBILITY OF SUCH DAMAGES. 279 | 280 | END OF TERMS AND CONDITIONS 281 | 282 | How to Apply These Terms to Your New Programs 283 | 284 | If you develop a new program, and you want it to be of the greatest 285 | possible use to the public, the best way to achieve this is to make it 286 | free software which everyone can redistribute and change under these terms. 287 | 288 | To do so, attach the following notices to the program. It is safest 289 | to attach them to the start of each source file to most effectively 290 | convey the exclusion of warranty; and each file should have at least 291 | the "copyright" line and a pointer to where the full notice is found. 292 | 293 | {description} 294 | Copyright (C) {year} {fullname} 295 | 296 | This program is free software; you can redistribute it and/or modify 297 | it under the terms of the GNU General Public License as published by 298 | the Free Software Foundation; either version 2 of the License, or 299 | (at your option) any later version. 300 | 301 | This program is distributed in the hope that it will be useful, 302 | but WITHOUT ANY WARRANTY; without even the implied warranty of 303 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 304 | GNU General Public License for more details. 305 | 306 | You should have received a copy of the GNU General Public License along 307 | with this program; if not, write to the Free Software Foundation, Inc., 308 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 309 | 310 | Also add information on how to contact you by electronic and paper mail. 311 | 312 | If the program is interactive, make it output a short notice like this 313 | when it starts in an interactive mode: 314 | 315 | Gnomovision version 69, Copyright (C) year name of author 316 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 317 | This is free software, and you are welcome to redistribute it 318 | under certain conditions; type `show c' for details. 319 | 320 | The hypothetical commands `show w' and `show c' should show the appropriate 321 | parts of the General Public License. Of course, the commands you use may 322 | be called something other than `show w' and `show c'; they could even be 323 | mouse-clicks or menu items--whatever suits your program. 324 | 325 | You should also get your employer (if you work as a programmer) or your 326 | school, if any, to sign a "copyright disclaimer" for the program, if 327 | necessary. Here is a sample; alter the names: 328 | 329 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program 330 | `Gnomovision' (which makes passes at compilers) written by James Hacker. 331 | 332 | {signature of Ty Coon}, 1 April 1989 333 | Ty Coon, President of Vice 334 | 335 | This General Public License does not permit incorporating your program into 336 | proprietary programs. If your program is a subroutine library, you may 337 | consider it more useful to permit linking proprietary applications with the 338 | library. If this is what you want to do, use the GNU Lesser General 339 | Public License instead of this License. 340 | 341 | --------------------------------------------------------------------------------