bin/kafka-topics.sh --zookeeper localhost:2181 --list
bin/kafka-topics.sh --zookeeper localhost:2181 --describe --topic mytopic
bin/kafka-topics.sh --zookeeper localhost:2181 --alter --topic mytopic --config retention.ms=1000
... wait a minute ...
ls -l -ad dev-* |
# Try to get the original filename (present in the header) of the gz file. | |
# Check http://www.onicos.com/staff/iz/formats/gzip.html | |
def get_original_fileName(path): | |
with open(path, 'rb') as f: | |
magic = f.read(2) | |
if magic != '\037\213': | |
raise IOError, 'Not a gzipped file' |
def listSubdirectoriesRecursively( | |
directory: Path, | |
list: mutable.ListBuffer[Path] = new mutable.ListBuffer[Path] | |
): List[Path] = { | |
val iterator = fs.listLocatedStatus(directory) | |
while (iterator.hasNext) { | |
val pathStatus = iterator.next() | |
val path = pathStatus.getPath |
FROM python:latest | |
RUN pip install ansible | |
WORKDIR "/root/project" |
FROM openjdk:8-jdk | |
#INIT | |
RUN apt-get update && \ | |
apt-get install -y jq uuid-runtime unzip | |
ENV CONFLUENT_VERSION 4.1.3 | |
ENV CONFLUENT_URL http://packages.confluent.io/archive/4.1/confluent-oss-4.1.3-2.11.tar.gz |
bin/kafka-topics.sh --zookeeper localhost:2181 --list
bin/kafka-topics.sh --zookeeper localhost:2181 --describe --topic mytopic
bin/kafka-topics.sh --zookeeper localhost:2181 --alter --topic mytopic --config retention.ms=1000
... wait a minute ...
import org.json4s.DefaultFormats | |
import org.json4s.JsonAST.JValue | |
import org.json4s.jackson.JsonMethods._ | |
case class Channel(name: String, ch: String) | |
case class Category(id: String) | |
object JsonM3uTransformer extends App { |
Preconditions:
- POSIX or Windows system
- Install Docker
- A GitHub repo that already builds on Travis
Postcondition:
team_name = TOREPLACE | |
username = TOREPLACE | |
password = TOREPLACE | |
urlStr= "https://bitbucket.org/!api/2.0/repositories/${team_name}/${Repository}/refs/branches?sort=-target.date&fields=pagelen,next,page,size,values.name&pagelen=100" | |
branches = [] | |
def getBranches(url) { | |
def baseUrl = new URL(url) |
import java.util.{Collections, Map => JavaMap} | |
import scala.collection.JavaConverters._ | |
trait EnvHacker { | |
/** | |
* Portable method for setting env vars on both *nix and Windows. | |
* @see http://stackoverflow.com/a/7201825/293064 | |
*/ | |
def setEnv(newEnv: Map[String, String]): Unit = { | |
try { |