Skip to content

Instantly share code, notes, and snippets.

View gingermat's full-sized avatar
🙃

Victor Elfimov gingermat

🙃
View GitHub Profile
# Install kafka-python before use
# pip install kafka-python
#
import argparse
from kafka import KafkaConsumer, TopicPartition
def main():
parser = argparse.ArgumentParser(description='Kafka Listener')
@gingermat
gingermat / gist:c88a20e93574738fbb81f1bbc8ebbbcc
Created June 1, 2022 10:50
Check container process is alive (process periodically update `.up`-file)
is_alive() {
test -f .up && find .up -fstype local -mmin -1
};
echo $(is_alive)
# Return my IP address
function myip() {
dig -4 TXT +short o-o.myaddr.l.google.com @ns1.google.com
}