Skip to content

Instantly share code, notes, and snippets.

View ashrithr's full-sized avatar
🎯
Focusing

Ashrith Mekala ashrithr

🎯
Focusing
View GitHub Profile
@ashrithr
ashrithr / ycsb_hbase.sh
Created March 8, 2015 22:05
YCSB stress test hbase commands
#!/usr/bin/env bash
#
# Simulates mixed workload on HBase using YCSB
# Author: Ashrith (ashrith at cloudwick dot com)
# Date: Wed, 16 2014
#
#
# You may want to tweak these variables to change the workload's behavior
#
@ashrithr
ashrithr / FileSystemOperations.java
Last active April 11, 2022 07:23
Sample java class illustrating hdfs driver
package com.cloudwick.hdfs;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
@ashrithr
ashrithr / compare_file_age.sh
Created May 20, 2013 18:38
bash function to compare if a file is older than 28 hours or not
#######BEGIN SCRIPT############
#!/bin/bash
# This checks that the specified file is less than 28 hours old.
# returns 0 if younger than 28 hours.
# returns 1 if older than 28 hours.
#funtion arguments -> filename to comapre against curr time
function comparedate() {
if [ ! -f $1 ]; then
echo "file $1 does not exist"
@ashrithr
ashrithr / YarnClientTest.java
Last active November 16, 2021 09:48
YarnClient example for deleteing user applications
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import org.apache.hadoop.yarn.api.records.ApplicationId;
import org.apache.hadoop.yarn.api.records.ApplicationReport;
import org.apache.hadoop.yarn.api.records.YarnApplicationState;
import org.apache.hadoop.yarn.client.api.YarnClient;
import org.apache.hadoop.yarn.conf.YarnConfiguration;
import org.apache.hadoop.yarn.exceptions.YarnException;
@ashrithr
ashrithr / vagrant_centos_multi.rb
Last active August 29, 2021 16:31
vagrant multi machine centos
# -*- mode: ruby -*-
# vi: set ft=ruby :
boxes = [
{
name: "server1.local",
eth1: "192.168.0.101",
mem: 1024,
cpu: 1
},
@ashrithr
ashrithr / darkify_slack.sh
Created April 9, 2019 02:47 — forked from ryanpcmcquen/darkify_slack.sh
Darkify your Slack.
#!/bin/sh
# Darkify Slack on Mac OS or Linux.
# curl https://gist.githubusercontent.com/ryanpcmcquen/8a7ddc72460eca0dc1f2dc389674dde1/raw/darkify_slack.sh | sh
if [ "`uname -s`" = "Darwin" ]; then
SLACK_INTEROP_JS="/Applications/Slack.app/Contents/Resources/app.asar.unpacked/src/static/ssb-interop.js"
else
SLACK_INTEROP_JS="/usr/lib/slack/resources/app.asar.unpacked/src/static/ssb-interop.js"
fi
@ashrithr
ashrithr / instructions.md
Created October 1, 2020 00:23 — forked from henrebotha/instructions.md
Karabiner Elements: Caps Lock + I/J/K/L to Arrow Keys (a la Pok3r)

Instructions

  1. Install Karabiner Elements
  2. Open your karabiner.json file (it will be in ~/.config/karabiner/karabiner.json).
  3. Find complex_modifications. It will have a key rules that takes a list ("rules": [...]).
  4. Inside the square brackets, paste this:
{
    "description": "Change Caps Lock + I/J/K/L to Arrow Keys",
@ashrithr
ashrithr / graphite.md
Last active September 27, 2020 20:10
Installing graphite 0.10, collectd and grafana on centos 6

Installing Graphite:

Graphite does two things:

  1. Store numeric time-series data
  2. Render graphs of this data on demand

What Graphite does not do is collect data for you, however there are some tools out there that know

@ashrithr
ashrithr / akka_vs_play.txt
Created January 6, 2017 03:52
akka-http vs play-netty-server
# 2k was used as warmup
Projects used:
https://github.com/schmitch/performance
Hardware Client: MacBook Pro 11,3 - Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz with a Broadcom NetXtreme Gigabit Ethernet Controller
Network Switch: Consumer grade 5 Port
Hardware Server: Intel(R) Xeon(R) CPU E5-2670 0 @ 2.60GHz (HT enabled)
@ashrithr
ashrithr / build-gcc.sh
Created August 31, 2018 09:39 — forked from jeetsukumaran/build-gcc.sh
Build and Install GCC Suite from Scratch
#! /bin/bash
GCC_VERSION="5.2.0"
WORKDIR="$HOME/src/"
INSTALLDIR="/platform"
## NOTE: XCode must be installed (through App Store) and the following run to install command-line tools.
## THIS IS IMPORTANT! Among other things, it creates '/usr/include' and installs the system header files.
# xcode-select --install