Skip to content

Instantly share code, notes, and snippets.

View kashyapp's full-sized avatar

Kashyap Paidimarri kashyapp

View GitHub Profile
@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 / Notes.md
Last active December 19, 2017 06:09
Shiro + CAS + Dropwizard
@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 / 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 / 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 / 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 / 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 / FreshExpiringLoadingCache.java
Last active October 14, 2018 19:40
Loading cache that keeps keys fresh until expiry.
import com.yammer.dropwizard.util.Duration;
import com.google.common.cache.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.concurrent.*;
import static com.google.common.base.Throwables.propagateIfInstanceOf;
public class LocalAppConfigStorage implements AppConfigStorage {
@kashyapp
kashyapp / migrate.js
Created April 7, 2013 03:04
Migrate from list to sortedset for irc archives.
var r = require('redis');
r.debug_mode = true;
var redis = r.createClient(),
allRows = [],
migrated = 0;
redis.on("end", function(){
console.log("we should be done here");
});
@kashyapp
kashyapp / gollum-custom.css
Created May 3, 2013 06:03
custom css for github/gollum
@import url(http://fonts.googleapis.com/css?family=Open+Sans:300);
body {
font-family: helvetica,arial,freesans,clean,sans-serif;
}
#head h1,
.markdown-body h2,
.markdown-body h1 {
font-weight: 300;
font-family: 'Open Sans', helvetica, sans-serif;