Skip to content

Instantly share code, notes, and snippets.

View kaustavha's full-sized avatar
:octocat:
:electron: :atom: :shipit: 🚀 🌟 🇮🇳 🇺🇸 🇨🇦 Ethereum fanboi

Kaustav Haldar kaustavha

:octocat:
:electron: :atom: :shipit: 🚀 🌟 🇮🇳 🇺🇸 🇨🇦 Ethereum fanboi
View GitHub Profile
@kaustavha
kaustavha / logstash.conf
Last active February 20, 2016 00:20
Logstash kafka benchmark
input {
kafka {
topic_id => 'observations.json'
zk_connect => 'localhost:2181'
type => 'kafka'
auto_offset_reset => 'smallest'
consumer_threads => 12
codec => 'snappy'
}
}
@kaustavha
kaustavha / README.md
Created February 20, 2016 00:06
Kafka pixy kafka consumer benchmarks

This is code used to benchmark throughput using the kafka-pixy kafka client.

Setup:

curl -L https://github.com/mailgun/kafka-pixy/releases/download/v0.10.1/kafka-pixy-v0.10.1-linux-amd64.tar.gz | tar xz
cd kafka-pixy-v0.10.1-linux-amd64
./kafka-pixy --kafkaPeers "localhost:9092", --zookeeperPeers "localhost:2181"

Usage:

@kaustavha
kaustavha / README.md
Last active February 14, 2024 21:49
Nodejs kafka consumer benchmark

Kafka-node consumer benchmark

This code can be used to benchmark throughput for a kafka cluster. Args:

groupId -- (str) kafka consumer group id, default: bench
concurrency -- (int) Number of worker threads to spawn, defaults to number of cpus on current host
duration -- (int) How long to run the benchmark for, default: 20s
topic -- (str) the kafka topic to consume from, defaults to observations.json
zk -- (str) zookeeper url, defaults to localhost:2181
@kaustavha
kaustavha / Readme.md
Last active March 1, 2016 18:17
Using node to generate applescript for sending emails

This is an example of using nodejs to generate applescript for sending out emails.

node example.js

Will output the applescript to console. On a mac with microsoft outlook configured and applescript one can create an applescript file and run it. e.g.

osascript out.osascript

This will send an email that looks like email.txt

@kaustavha
kaustavha / keybase.md
Created January 8, 2016 22:33
keybase.md

Keybase proof

I hereby claim:

  • I am kaustavha on github.
  • I am kaustavha (https://keybase.io/kaustavha) on keybase.
  • I have a public key whose fingerprint is 477F 6368 DEA0 991E F063 F874 8C4D 36CC 74A3 EACB

To claim this, I am signing this object:

I.e. what you will need to do to run facebookarchive/scribe/scribe_cat Good luck mate.

On ubuntu 14.04 LTS

mkdir fbhell && cd fbhell
sudo apt-get install git

First we need folly

@kaustavha
kaustavha / linkedin_connect.js
Created October 8, 2015 04:25
linkedin_connect.js
setInterval(function() { var connectBtns = document.getElementsByClassName('bt-request-buffed'); for(var i =0; i < connectBtns.length; i++) { console.log(connectBtns[i].parentNode.children[0].children[1].children[0].children[0].textContent);connectBtns[i].click()}}, 500);
@kaustavha
kaustavha / runner.coffee
Last active August 29, 2015 14:27
generator runner
# This script, when placed inside the meteor-kitchen-examples root project folder
# Can be used to run all the examples and generate output for jade, coffee and plain from json and yaml
fs = require 'fs'
{spawn} = require 'child_process'
path = require 'path'
async = require 'async'
dir = fs.readdirSync(__dirname)
dir = dir.filter((e, i, a) -> if e.indexOf('.') is -1 then return e)
humandirs = dir.filter((e, i, a) -> if e.indexOf('human') isnt -1 then return e)
git config --local --add gc.auto 0
git checkout master
git pull
git checkout your_branch
git reset --soft commit_hash_before_your_changes //(can be found by doing git log)
git stash
git merge master --ff
git stash apply
git commit
git push -f origin your_branch
`luajit -bs timer.lua - | wc -c` to count raw bytes of bytecode
luajit -bl file.lua to list the bytecode