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 / lookup.md
Last active December 24, 2015 22:49
million inserts and lookups on ruby hash vs redis vs postgres

Time to generate 1 million hash entries:

  • Ruby hash = 3.5 secs
  • Redis = 91 secs
  • Postgres = 179 secs

Time to lookup 1 million entires in hash:

  • Ruby hash = 1.35 seconds
  • Redis = 71 secs
@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 / iperf.md
Created September 30, 2013 22:54
iperf usage

Start server on one machine using:

iperf -s -i 1
  • -i specifies the interval at which the output is specified
  • -s specified to start server

Start client on another machine using:

@ashrithr
ashrithr / video_on_html5.md
Created September 15, 2013 01:32
video on html5

Installing required convertors on mac:

  1. HandBrake CLI for H.264/AAC/MP4
http://handbrake.fr/downloads2.php
  1. ffmpeg for VP8/Vorbis/WebM
@ashrithr
ashrithr / Compare_Emails.vb
Last active December 22, 2015 22:49
Excel VBA subroutine to get email columns from tow sheets and dump the difference to another sheet
Function CreateSheetIf(strSheetName As String) As Boolean
'Returns false if does not creates a worksheet
'Returns true if it creates a worksheet
Dim wsTest As Worksheet
CreateSheetIf = False
'Check to see if the worksheet exist, if does not exists wsTest will be "Nothing"
'otherwise wsTest will be assigned to the worksheet
Set wsTest = Nothing
@ashrithr
ashrithr / buildScalaProject.sh
Last active November 18, 2022 08:24
creates scala project structure using sbt 0.13
#!/bin/bash
function usage () {
script=$0
cat <<USAGE
Creates scala project structure to be used with sbt
Syntax
`basename $script` project_name artifact_id
@ashrithr
ashrithr / storm.md
Last active December 22, 2015 11:39
Intro to storm

Storm

Storm is a distributed and fault-tolerant realtime computation system

###Features of storm:

  • Scalable and robust
  • Fault-tolrant (automatic reassigning of tasks)
  • Reliable (all messages are processed at least once)
  • Fast
@ashrithr
ashrithr / sinatra.md
Last active December 31, 2016 04:58
Intro to Sinatra

Sinatra

Installation:

Dependencies: ruby

gem install sinatra

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns             
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs

Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs

@ashrithr
ashrithr / usage.md
Created September 4, 2013 16:28
html5 presentations using ruby gem keydown

##Install keydown:

gem install keydown

##Generate Template

keydown generate demo_presentation