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 / gitRepoDownloader
Created June 16, 2014 16:38
Script to download all of a users/orgs public git repos
###
# This is a script to clone all of a users repositories off of github
# You need the git cli installed and the node-github pkg (npm install github)
# CLI Usage Examples:
# coffee gitScraper.coffee user :username
# coffee gitScraper.coffee org :orgname
###
process = require 'process'
githubApi = require 'github'
{spawn} = require 'child_process'
@kaustavha
kaustavha / Lua get file perm octal
Created July 17, 2015 16:52
The lua(luvit) way of retrieving file permissions
--[[ data is returned from fs.stat call to desired file]]--
octalFilePerm[file] = bit.band(data.mode, tonumber('777', 8))
`luajit -bs timer.lua - | wc -c` to count raw bytes of bytecode
luajit -bl file.lua to list the bytecode
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
@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)
@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);

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 / 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:

@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 / 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'
}
}