Skip to content

Instantly share code, notes, and snippets.

@yashk
yashk / shardcalc.py
Created February 25, 2019 17:46 — forked from colmmacc/shardcalc.py
Calculate the blast radius of a shuffle shard
import sys
def factorial(n):
if n == 0:
return 1
else:
return n * factorial(n - 1)
def choose(n, m):
return factorial(n) / (factorial(m) * factorial(n - m))
@yashk
yashk / plog.py
Created June 22, 2018 12:56
python subprocess logging
import sys
import subprocess
import logging
import shlex
from logging.handlers import RotatingFileHandler
def log_handler(log_file):
log_handler = RotatingFileHandler(filename=log_file,maxBytes=200000,
backupCount=5)
@yashk
yashk / install-redhat-td-agent-bit.sh
Last active June 1, 2018 15:04
install-redhat-td-agent-bit.sh
echo "=============================="
echo " td-agent Installation Script "
echo "=============================="
echo "This script requires superuser access to install rpm packages."
echo "You will be prompted for your password by sudo."
# clear any previous sudo permission
sudo -k
# run inside sudo
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Random;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
/**
@yashk
yashk / Int Collections
Last active December 2, 2017 14:45
Int Collections
Java Questions
https://github.com/MaximAbramchuck/awesome-interview-questions#java
Whats new in Java 8
https://leanpub.com/whatsnewinjava8/read
2017-06-28 13:04:15 INFO starting gh-ost 1.0.36
2017-06-28 13:04:15 INFO Migrating `ghost`.`ghost_test`
2017-06-28 13:04:15 INFO connection validated on localhost:3306
2017-06-28 13:04:15 INFO User has ALL privileges
2017-06-28 13:04:15 INFO binary logs validated on localhost:3306
2017-06-28 13:04:15 INFO Restarting replication on localhost:3306 to make sure binlog settings apply to replication thread
2017-06-28 13:04:15 DEBUG Replication restarted
2017-06-28 13:04:15 INFO Inspector initiated on prod-db-us-58.mashery.com:3306, version 5.5.40-log
2017-06-28 13:04:15 INFO Table found. Engine=InnoDB
2017-06-28 13:04:15 DEBUG Estimated number of rows via STATUS: 171229248
@yashk
yashk / Tibco_jobs.md
Last active June 19, 2017 13:29
Tibco_jobs.md

TIBCO Technical Architect: Establish and lead the TIBCO projects technically. Lead large-scale integration efforts involving the entire TIBCO product suite giving direction to systems integration partners, client and PSG resources. These projects should include the full integration lifecycle from POC to production. Take ownership and responsibility to deliver a complete solution. Participate on requirements gathering, lead architecture discussions, complete documentation of the solution architecture and the demo scenarios to enable consultants to implement projects on TIBCO technology. Work as an Architect on TIBCO SOA or MDM or BPM or BO (BE/GI) based application

@yashk
yashk / gist:f2ed7474635d78d72360d6adf25b9d5e
Created June 5, 2017 08:46
download youtube songs as audio
youtube-dl --extract-audio --audio-quality 0 https://www.youtube.com/watch\?v\=VbxgYlcNxE8