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 ...
#!/bin/env python | |
import sys | |
import SocketServer | |
import BaseHTTPServer | |
import SimpleHTTPServer | |
class ThreadingSimpleServer(SocketServer.ThreadingMixIn, | |
BaseHTTPServer.HTTPServer): |
LOGGING = { | |
'version': 1, | |
'disable_existing_loggers': False, | |
'formatters': { | |
'large': { | |
'format': '%(asctime)s %(levelname)s %(process)d %(pathname)s ' + | |
'%(funcName)s %(lineno)d %(message)s ' | |
} | |
}, | |
'handlers': { |
# import dependencies | |
import smtplib | |
from email.mime.multipart import MIMEMultipart | |
from email.mime.text import MIMEText | |
import email | |
import email.mime.application | |
from django.utils.html import strip_tags | |
# create message |
disposable_emails = [ | |
"yopmail.com", | |
"0-mail.com", | |
"0815.ru", | |
"0clickemail.com", | |
"0wnd.net", | |
"0wnd.org", | |
"10minutemail.com", | |
"20minutemail.com", | |
"2prong.com", |
# | |
# Printing square of all numbers less than number n. | |
# n is provided at runtime. | |
# Author: https://www.pythoncircle.com | |
# | |
if __name__ == '__main__': | |
n = int(input()) | |
for x in range(n): | |
print(x*x) |
# | |
# Program to confirm is a given year is leap year or not | |
# year is provided at runtime. | |
# Author: https://www.pythoncircle.com | |
# | |
def is_leap(year): | |
leap = False | |
if year % 4 == 0: | |
if year % 100 == 0: |
# | |
# Text based snake and ladder game | |
# Author - https://www.pythoncircle.com | |
# | |
import time | |
import random | |
import sys | |
# just of effects. add a delay of 1 second before performing any action |
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 ...