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 / pmap.rb
Created March 17, 2016 09:05 — forked from sczizzo/pmap.rb
Simple, plain Ruby implementation of parallel map/each
#!/usr/bin/env ruby
require 'thread'
Thread.abort_on_exception = true
module Enumerable
def peach n=nil, &block
pmap n, &block
self
end
@seeker815
seeker815 / chef_dsl.rb
Created May 3, 2016 16:13 — forked from sczizzo/chef_dsl.rb
How one might implement Chef's Recipe DSL
# Basics
module Chef
class Resource
attr_reader :name
def initialize name
@name = name
end
@seeker815
seeker815 / knife cheat
Created August 24, 2016 08:08 — forked from ipedrazas/knife cheat
Hello!
# knife cheat
## Search Examples
knife search "name:ip*"
knife search "platform:ubuntu*"
knife search "platform:*" -a macaddress
knife search "platform:ubuntu*" -a uptime
knife search "platform:ubuntu*" -a virtualization.system
knife search "platform:ubuntu*" -a network.default_gateway
@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 / 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 / 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 / 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
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 / 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?

@seeker815
seeker815 / notes.txt
Created August 18, 2019 10:31 — forked from miguelmota/notes.txt
runc vs gvisor (runsc) vs rkt vs KataContainers vs NablaContainers
knowledge dump on container runtimes
KataContainers
- image coupled with kernel
- light vm layer
- can run in nested virturalization environments if hardware supports and you can enable it in bios (ex. only bare metal EC2 instances, limits many cloud providers)
- slower startup time
- OCI compliant
- previously known as ClearContainers by Intel