This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
var kafka = require('kafka-node'); | |
var winston = require('winston'); | |
var _ = require('lodash'); | |
// Wraps a kafka consumer | |
// https://github.com/SOHU-Co/kafka-node#consumer | |
// We intentionally only allow a single topic, group, partition per consumer. | |
// |
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
"kafka": { | |
"consumers": [{ | |
"client": { | |
"connectionString": "localhost:2181" | |
}, | |
"consumer": { | |
"topic": "job_result", | |
"groupId": "job_result" | |
} | |
}] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
var Promise = require("bluebird"); | |
// function dosomething(n) { | |
// if (n === 7) { | |
// var err = new Error('seven error'); | |
// return Promise.reject(err); | |
// //throw err; | |
// } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
from glob import glob | |
DOCUMENTATION = ''' | |
--- | |
module: stop_apps | |
short_description: Stop all (upstart) jobs that start with given prefixes. | |
description: | |
- Calls stop on every upstart job that begins with one of the given | |
prefixes. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
IFS="," | |
topic="@option.topic@" | |
for t in $topic | |
do | |
echo "Expiring topics: $t" | |
/opt/tap-kafka/bin/kafka-topics.sh --zookeeper `awk -F'=' '/zookeeper.connect=/ {print $2}' /opt/tap-kafka/config/server.properties | sed -e 's/\/tap-kafka//'`/tap-kafka --alter --topic $t --config retention.bytes=0 | |
/opt/tap-kafka/bin/kafka-topics.sh --zookeeper `awk -F'=' '/zookeeper.connect=/ {print $2}' /opt/tap-kafka/config/server.properties | sed -e 's/\/tap-kafka//'`/tap-kafka --describe --topic $t | |
done |
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
--- | |
- template: | |
src: cust_info.json.j2 | |
dest: /var/tmp/cust_info.json | |
mode: 0777 | |
- command: cat /var/tmp/cust_info.json | |
register: cust_info | |
- uri: |
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
ubuntu@tmpc1:/etc/syslog-ng$ cat syslog-ng.conf | |
@version: 3.5 | |
@include "scl.conf" | |
@include "`scl-root`/system/tty10.conf" | |
# Syslog-ng configuration file, compatible with default Debian syslogd | |
# installation. | |
# First, set some global options. | |
options { chain_hostnames(off); flush_lines(0); use_dns(no); use_fqdn(no); |
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
ubuntu@tmpc1:/etc/syslog-ng$ cat scl.conf | |
############################################################################# | |
# Copyright (c) 2010-2012 BalaBit IT Ltd, Budapest, Hungary | |
# | |
# This program is free software; you can redistribute it and/or modify it | |
# under the terms of the GNU General Public License version 2 as published | |
# by the Free Software Foundation, or (at your option) any later version. | |
# | |
# This program is distributed in the hope that it will be useful, | |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
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
Show hidden characters
{ | |
"in_process_packages": | |
[ | |
], | |
"installed_packages": | |
[ | |
"GitGutter", | |
"JsFormat", | |
"Markdown Preview", | |
"Package Control", |
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
{ | |
"color_scheme": "Packages/User/SublimeLinter/Twilight (SL).tmTheme", | |
"font_face": "Hack", | |
"font_size": 17, | |
"ignored_packages": | |
[ | |
"Vintage" | |
], | |
"rulers": | |
[ |