View run node exporter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Start Prometheus node-exporter | |
docker run -d \ | |
--net="host" \ | |
--pid="host" \ | |
-v "/proc:/host/proc:ro" \ | |
-v "/proc:/host/sys:ro" \ | |
--restart always \ | |
--name node-exporter \ | |
quay.io/prometheus/node-exporter:v0.16.0 \ | |
--path.procfs /host/proc \ |
View AWS Cognito with ALB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resource "aws_lb_listener" "monitoring" { | |
load_balancer_arn = "${aws_lb.monitoring.arn}" | |
port = "${var.alb_listener_port}" | |
protocol = "HTTPS" | |
certificate_arn = "${aws_iam_server_certificate.cert.arn}" | |
default_action { | |
type = "fixed-response" | |
fixed_response { |
View plato-generate-report.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
d=2016-08-17 | |
while [ "$d" != 2017-03-17 ]; do | |
d=$(date -I -d "$d + 1 month") | |
git checkout "master@{$d 00:00:00}" | |
plato -r -d /tmp/report -D $(date -d "$d 00:00:00" +"%s") app/ | |
done |
View Dockerfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM library/java:8-jre | |
ENV NODE_VERSION 4.2.0 | |
ENV NVM_DIR /usr/local/nvm | |
ENV DISPLAY :10 | |
ENV DEBIAN_FRONTEND noninteractive | |
# Replace shell with bash so we can source files | |
RUN rm /bin/sh && ln -s /bin/bash /bin/sh |
View gist:0b42b6267c520dd22e9a
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var kafkaHost="kafka.example.com:2181" | |
var kafka = require('kafka-node'), | |
Producer = kafka.Producer, | |
Consumer = kafka.Consumer, | |
client = new kafka.Client(kafkaHost, "default_topic"), | |
consumer = new Consumer( | |
client, | |
[ |
View chef provisioning docker 1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'chef/provisioning/docker_driver' | |
with_chef_server "https://api.opscode.com/organizations/ossom", | |
:client_name => Chef::Config[:node_name], | |
:signing_key_filename => Chef::Config[:client_key] | |
machine_image 'web_server' do | |
recipe 'nginx' | |
machine_options :docker_options => { |
View gist:4628ddf1a1811f659d25
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var WebSocketServer = require('ws').Server | |
, wss = new WebSocketServer({ port: 8080 }); | |
wss.broadcast = function broadcast(data) { | |
wss.clients.forEach(function each(client) { | |
client.send(JSON.stringify(data)); | |
}); | |
}; | |
var kafka = require('kafka-node'), |
View demo-websocket-client.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
npm install ws | |
node demo-websocket-client.js | |
( ---> curl 'localhost:9200/myindex/_search') | |
Ctrl-C | |
*/ | |
var WebSocket = require('ws') |
View update-openssl-on-cluster.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
array=( | |
10.0.0.1 | |
10.0.0.2 | |
10.0.0.3 | |
10.0.0.4 | |
10.0.0.5 | |
) | |
for i in "${array[@]}" | |
do |
View chef allow cluster communication
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# open iptables for each node | |
iptables_ng_rule 'cluster' do | |
name '01-cluster-access' | |
chain 'INPUT' | |
rule search(:node,"chef_environment:#{node.chef_environment}").map {|node| "--source #{node[:ipaddress]} --jump ACCEPT" } | |
ip_version 4 | |
end |
NewerOlder