Jon Warbrick, July 2014, V3.2 (for Ansible 1.7)
First one found from of
# Create a topic if a topic with the same name does NOT exist | |
bin/kafka-topics.sh --zookeeper zookeeper1:2181/kafka \ | |
--create \ | |
--topic topic-1 \ | |
--replication-factor 1 \ | |
--partitions 3 \ | |
--if-not-exists | |
# Alter the number of partitions (can only go up) | |
bin/kafka-topics.sh --zookeeper zookeeper1:2181/kafka \ |
Jon Warbrick, July 2014, V3.2 (for Ansible 1.7)
First one found from of
by Bjørn Friese
Beautiful is better than ugly. Explicit is better than implicit.
I frequently deal with collections of things in the programs I write. Collections of droids, jedis, planets, lightsabers, starfighters, etc. When programming in Python, these collections of things are usually represented as lists, sets and dictionaries. Oftentimes, what I want to do with collections is to transform them in various ways. Comprehensions is a powerful syntax for doing just that. I use them extensively, and it's one of the things that keep me coming back to Python. Let me show you a few examples of the incredible usefulness of comprehensions.
Install tcpkill
yum -y install dsniff --enablerepo=epel
View connections
netstat -tnpa | grep ESTABLISHED.*sshd.
Block with ip tables
iptables -A INPUT -s IP-ADDRESS -j DROP
Kill connection
#!/bin/sh | |
# /share/MD0_DATA/.qpkg/autorun/autorun-plexconnect.sh | |
# chmod +x /share/MD0_DATA/.qpkg/autorun/autorun-plexconnect.sh | |
curl -L https://gist.github.com/tommeier/6255771/raw/update_plex_connect.sh | bash & |
Work in progress, I'll write this up properly when I'm done.
Almost all credit goes to @maxogden for putting me on to this and pointing me in the right direction for each of these items.
Prerequisites: