Skip to content

Instantly share code, notes, and snippets.

View kashyapp's full-sized avatar

Kashyap Paidimarri kashyapp

View GitHub Profile
@kashyapp
kashyapp / foo.sh
Created January 2, 2010 09:46
simple mod to pgrep
#!/bin/bash
top -n1
@kashyapp
kashyapp / gist:1301959
Created October 20, 2011 18:52
questions
Questions
• remove spaces
• second highest
• binary search
• reverse byteorder
• search for pattern in a binary tree
• sum in a sorted list
• binary tree serialize, deserialize
• atoi, atof
@kashyapp
kashyapp / heroku-build.log
Created May 17, 2012 06:07
jruby/heroku-buildpack-jruby has trouble when Gemfile contains a git gem
-----> Heroku receiving push
-----> Fetching custom buildpack... done
-----> JRuby app detected
-----> Downloading and unpacking JRuby
-----> Installing JRuby-OpenSSL, Bundler and Rake
Successfully installed bouncy-castle-java-1.5.0146.1
Successfully installed jruby-openssl-0.7.6.1
Successfully installed bundler-1.1.3
Successfully installed rake-0.9.2.2
4 gems installed
@kashyapp
kashyapp / gitio
Last active October 14, 2015 01:08 — forked from defunkt/gitio
# Barf like a dog
@kashyapp
kashyapp / mmap-fork.c
Last active June 8, 2022 01:39
sample code to test out fork and mmap of shared memory
#include <time.h>
#include <unistd.h>
#include <string.h>
#include <stdio.h>
#include <sys/mman.h>
#include <sys/types.h>
#include <stdlib.h>
#include <sys/stat.h> /* For mode constants */
#include <fcntl.h> /* For O_* constants */
@kashyapp
kashyapp / another.md
Last active December 10, 2015 05:08
Testing Gist.io

Headline of the second file

Sweet stuff this is Some of it is too sweet perhaps

I had some of it and I am left shell shocked, really!

@kashyapp
kashyapp / README.md
Last active December 10, 2015 05:18
7 segment display

A scaling 7 segment lcd display

An html/js implementation to the LCD Display problem on UVA.

Instructions

Should be self explanatory but the number field takes digits and the hyphen(-) character. And then there's the scale.

Demo

http://bl.ocks.org/4386850

@kashyapp
kashyapp / index.html
Last active December 10, 2015 14:18
Dancing Psy on Youtube
<!doctype html>
<html>
<head>
<style>
#psy {
height: 30px;
width: 20px;
border-bottom: 5px double black;
background: url(logo_dancing_psy-vflsJl9hC.gif) no-repeat -73px 1px;
position: absolute;
@kashyapp
kashyapp / sysstat-carbon.sh
Created January 8, 2013 13:20
Stupid script to read from sysstat and send to carbon
#!/bin/bash
set -e
#set -x
SEND="nc -v -v -q2 w3-api3 2003"
#SEND=cat
SED="sed s/[%/]//gI"
SADF="sadf -s $1 /var/log/sysstat/$2 --"
$SADF -d | grep 'dev254-[278]' | $SED | awk '{print "sys.hostmetrics." $1 ".deviceio." $4 "." $5 ".per_min", $6, $3}' | $SEND
@kashyapp
kashyapp / nsca-slave-lag.pl
Created January 8, 2013 13:21
Scrape nsca.log and generate carbon formatted strings
#!/usr/bin/perl -w
use Sys::Hostname;
use Date::Parse;
# extract date string and time
# convert date string to epoch
# format string for carbon
# publish
m/\[(.*)\]:.*: (.*)s ;.*/;