Skip to content

Instantly share code, notes, and snippets.

View ambud's full-sized avatar

Ambud ambud

View GitHub Profile
@ambud
ambud / RegexPrincipalToLocal.java
Created April 10, 2017 23:15
Storm Regex Principal Mapper
/**
* Copyright 2017 Ambud Sharma
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@ambud
ambud / harden.sh
Last active August 16, 2019 07:39
HDP Kafka ZK Hardening script
#!/bin/bash
# Author: Ambud Sharma
# License: Apache 2.0
USER=$1
if [ -z $USER ]; then
USER="kafka"
fi
@ambud
ambud / NodeRecovery.java
Last active June 13, 2018 19:13
AWS EBS Instance Autostart
package com.srotya.lambda.noderecovery;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import com.amazonaws.auth.AWSCredentialsProvider;
import com.amazonaws.auth.DefaultAWSCredentialsProviderChain;
import com.amazonaws.services.ec2.AmazonEC2;
import com.amazonaws.services.ec2.AmazonEC2ClientBuilder;
@ambud
ambud / install-driver.sh
Last active January 4, 2023 07:15
AWS ENA Driver Installation
#!/bin/bash
#
# Author: Ambud Sharma
# Purpose: Install AWS ENA driver for Enhanced Networking
#
sudo yum -y install kernel-devel-$(uname -r)
sudo yum -y install gcc git
git clone https://github.com/amzn/amzn-drivers.git
cd amzn-drivers/kernel/linux/ena
@ambud
ambud / benchmark.sh
Created March 20, 2017 16:10
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
@ambud
ambud / fio.fio
Last active February 27, 2017 23:46
FIO
# Test job that demonstrates how to use the latency target
# profiling. Fio will find the queue depth between 1..128
# that fits within the latency constraints of this 4k random
# read workload.
[global]
bs=4k
rw=randrw
random_generator=lfsr
direct=1
@ambud
ambud / docker-compose.yml
Created February 21, 2017 22:02
Docker Compose - Elasticsearch Kibana
version: '2'
services:
elasticsearch:
image: elasticsearch
ports:
- "9200:9200"
- "9300:9300"
kibana:
image: kibana
ports:
@ambud
ambud / flux.html
Created February 3, 2017 01:42
Flux Viewer
<html>
<!--
Copyright 2017 Ambud Sharma
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
@ambud
ambud / Reader.java
Last active September 23, 2016 23:34
OpenTSDB Java Embedded Read Write
import java.util.Calendar;
import java.util.HashMap;
import java.util.Map;
import net.opentsdb.core.Aggregators;
import net.opentsdb.core.DataPoints;
import net.opentsdb.core.Query;
import net.opentsdb.core.TSDB;
import net.opentsdb.utils.Config;
@ambud
ambud / deploy-topology.sh
Created August 23, 2016 00:00
Checks if topology exists and kills it to deploy a new version of the topology
#!/bin/bash
#
# Author: Ambud Sharma
#
set -eu
export STORM_LOC=/tmp/apache-storm-1.0.2
CONFIG=""