Skip to content

Instantly share code, notes, and snippets.

View seeker815's full-sized avatar

Sai Kothapalle seeker815

  • self
  • Bangalore, India
View GitHub Profile
@seeker815
seeker815 / vpn.md
Created May 19, 2019 10:00 — forked from joepie91/vpn.md
Don't use VPN services.

Don't use VPN services.

No, seriously, don't. You're probably reading this because you've asked what VPN service to use, and this is the answer.

Note: The content in this post does not apply to using VPN for their intended purpose; that is, as a virtual private (internal) network. It only applies to using it as a glorified proxy, which is what every third-party "VPN provider" does.

(A Russian translation of this article can be found here, contributed by Timur Demin.)

Why not?

FILE SPACING:
# double space a file
sed G
# double space a file which already has blank lines in it. Output file
# should contain no more than one blank line between lines of text.
sed '/^$/d;G'
@seeker815
seeker815 / docker-compose-cheatsheet.sh
Created August 21, 2018 21:44 — forked from buonzz/docker-compose-cheatsheet.sh
docker-compose cheatsheet
$ docker-compose up -d # start containers in background
$ docker-compose kill # stop containers
$ docker-compose up -d --build # force rebuild of Dockerfiles
$ docker-compose rm # remove stopped containers
$ docker ps # see list of running containers
$ docker exec -ti [NAME] bash # ssh to the container
# list all images
docker images
@seeker815
seeker815 / startstopinstanceswithtag.py
Created July 13, 2018 14:42 — forked from coingraham/startstopinstanceswithtag.py
Python - start stopped or stop running instances with particular tag
import boto3
tagname = "Name"
tagvalue = "Value"
ec2 = boto3.resource('ec2')
ec2.instances.filter(Filters=[
{'Name': 'tag': [tagname], 'Values': [tagvalue]},
{'Name': 'instance-state-name', 'Values': ['running']}
]).start()
ec2.instances.filter(Filters=[
@seeker815
seeker815 / kafka_benchmark.sh
Created June 12, 2018 11:47
Benchmark kafka
#!/bin/bash
# Purpose: To run kafka Kafka Producer / Consumer benchmark for Indix cluster
#
export TOPIC_NAME="benchmark_2_400"
export CLUSTER_SIZE=3
export DRIVE_COUNT=1
export BROKER_ADDRESS="10.181.18.63:9092"
export ZOOKEEPER_ADDRESS="10.181.18.63:2181"
@seeker815
seeker815 / benchmark.sh
Created June 12, 2018 05:53 — forked from ambud/benchmark.sh
Kafka Benchmark
#!/bin/bash
#
# Author: Ambud Sharma
#
# Purpose: To run kafka Kafka Producer / Consumer benchmark and create results
#
export NUM_RECORDS=10000000
export TOPIC_NAME_PREFIX="perf"
export CLUSTER_SIZE=3
export DRIVE_COUNT=1
@seeker815
seeker815 / benchmark-commands.txt
Created June 11, 2018 05:16 — forked from zodvik/benchmark-commands.txt
Kafka (1.0.0) Benchmark Commands
Producer
Setup
bin/kafka-topics.sh --zookeeper localhost:2181/kafka-local --create --topic test-rep-one --partitions 6 --replication-factor 1
bin/kafka-topics.sh --zookeeper localhost:2181/kafka-local --create --topic test-rep-two --partitions 6 --replication-factor 3
Single thread, no replication
bin/kafka-run-class.sh org.apache.kafka.tools.ProducerPerformance --print-metrics --topic test-rep-one --num-records 6000000 --throughput 100000 --record-size 100 --producer-props bootstrap.servers=kafka_host:9092 buffer.memory=67108864 batch.size=8196
Single-thread, async 3x replication
@seeker815
seeker815 / boostrap_2.sh
Created May 24, 2018 11:19
trap with EXIT
#!/bin/bash
# trap1
trap suicide EXIT SIGINT SIGQUIT
suicide (){
if [ $? -ne 0 ]; then
echo "You hit Cntrl+c, exiting"
fi
exit
}
count=0
@seeker815
seeker815 / trap_bash_errors.sh
Created May 24, 2018 11:09
Pattern to trap signals to make your bash script robust
#!/bin/bash
# trap
trap suicide SIGINT SIGHUP SIGQUIT
suicide (){
echo $?
echo "You hit Cntrl+c, exiting"
exit
}
<clusterMetrics>
<appsSubmitted>183</appsSubmitted>
<appsCompleted>181</appsCompleted>
<appsPending>0</appsPending>
<appsRunning>0</appsRunning>
<appsFailed>0</appsFailed>
<appsKilled>2</appsKilled>
<reservedMB>0</reservedMB>
<availableMB>0</availableMB>
<allocatedMB>0</allocatedMB>