Skip to content

Instantly share code, notes, and snippets.

View kashyapp's full-sized avatar

Kashyap Paidimarri kashyapp

View GitHub Profile
@kashyapp
kashyapp / access2plot.sh
Last active December 15, 2015 17:49
access log => gnuplota
zgrep -h configuration cfgsvc-access*
|awk '{print $4, $11}'
|colrm 1 1
|perl -MDate::Parse -ane 'print str2time($F[0]) . " $F[1]\n"'
> all.csv
# gnuplot> plot 'all.csv' using 1:2 with points pointtype 4
@kashyapp
kashyapp / java-dns-custom.txt
Created March 24, 2013 03:24
Custom dns server with java system property
http://slackhacker.com/2010/07/21/how-to-set-a-custom-dns-server-with-java-system-properties/
@kashyapp
kashyapp / gnuplot.sh
Last active December 14, 2015 21:19
Gnuplot reference (Pummel.Step => Gnuplot)
#!/bin/sh -e
FILE=$1
gnuplot << EOF
set noautoscale
set autoscale x
set autoscale ymax
set autoscale y2max
set logscale x
@kashyapp
kashyapp / oss.md
Last active December 14, 2015 20:58
Open source - state of the union
  1. kairosdb - opentsdb fork with cassandra support
  2. ning/galaxy, airship - deployment system
  3. leveldb, hawtdb - kv database
  4. snappy, lzf - compression library
  5. swift, nifty - thrift
  6. jcommander, airlift - cli getopt
  7. async-http-client
  8. grizzly, netty, atmosphere, vert.x
  9. lessfs - dedup fs
  10. eventsourced
@kashyapp
kashyapp / jackson-custom-serializer.java
Created March 11, 2013 06:33
Jackson Custom Deserializer - pick up only keys of map and return as list.
@JsonDeserialize(contentUsing = Foo.class)
private static class Permissions extends HashMap<String, List<String>> {
}
private static class Foo extends StdDeserializer<Collection<String>> {
protected Foo() {
super(Collection.class);
}
@kashyapp
kashyapp / Notes.md
Last active December 19, 2017 06:09
Shiro + CAS + Dropwizard
@kashyapp
kashyapp / lrsync.lua
Last active December 3, 2020 16:41
lsyncd and configuration
local hostname = os.getenv("HOSTNAME")
local package = os.getenv("PACKAGE")
assert(hostname, "HOSTNAME env variable is not set")
assert(package, "PACKAGE env variable is not set")
local privateKey = "/usr/share/" .. package .. "/etc/id_rsa"
settings {
statusFile = "/var/run/" .. package .. "/lsyncd.stat",
statusInterval = 60,
@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 ;.*/;
@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 / 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;