Skip to content

Instantly share code, notes, and snippets.


Vikrum vikrum

Block or report user

Report or block vikrum

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
vikrum / AndroidManifest.xml
Last active Jul 21, 2019
Firebase+Android sample app with background Service + local notifications.
View AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android=""
android:versionName="1.0" >
android:targetSdkVersion="17" />
vikrum / pacific-zulu.txt
Created Mar 28, 2013
Super lazy mode lookup table for Pacific to Zulu time.
View pacific-zulu.txt
01:00 02:00 09:00
02:00 03:00 10:00
03:00 04:00 11:00
04:00 05:00 12:00
05:00 06:00 13:00
06:00 07:00 14:00
07:00 08:00 15:00
08:00 09:00 16:00
09:00 10:00 17:00
vikrum /
Last active Dec 13, 2015
Probe SSL server for supported ciphers. (Modified from: )
#!/usr/bin/env bash
# OpenSSL requires the port number.
ciphers=$(openssl ciphers 'ALL:eNULL' | sed -e 's/:/ /g')
echo Obtaining cipher list from $(openssl version).
for cipher in ${ciphers[@]}
vikrum /
Created Feb 11, 2013
Quick hack to dump an image to JSON.
package com.firebase.sandbox;
import java.awt.Color;
import java.awt.image.BufferedImage;
import javax.imageio.ImageIO;
import org.json.JSONObject;
public class Png2Json {
public static void main(String[] args) {
vikrum /
Created Feb 4, 2013
Oh, don't mind me, I'm just running roughshod over your processes.
# seek and kill a mem hog fork()'d child
while [ : ]; do
echo Snoozing for $SNOOZE
vikrum /
Last active Dec 11, 2015
display linux interface bandwidths on a regular interval ( Modified to: 1) include aggregates; 2) average packet sizes; and, 3) scaled totals.
#!/usr/bin/perl -w
# display linux interface bandwidths on a regular interval
# dep: yum -y install perl-Time-HiRes
# Copyright (c) 2005 Dean Gaudet <>
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
vikrum / firedns.js
Created Jan 14, 2013
A custom DNS server in NodeJS that saves off queries to Firebase so they can be retrieved later. Accompanying blog post:
View firedns.js
var crypto = require('crypto');
var dns = require('native-dns');
var rest = require('restler');
var server = dns.createServer();
server.on('request', function (request, response) {
var domain = request.question[0].name;
if(domain == '') {
// Don't log this because it can't be uniquely identified and subsequently retrieved
vikrum / gist:4005258
Created Nov 3, 2012
Various distributions of the alphabet
View gist:4005258
var naturalDist = "abcdefghiklmnopqrstuvwxyz";
var scrabbleDist = "aaaaaaaaabbccddddeeeeeeeeeeeeffggghhiiiiiiiiijkllllmmnnnnnnooooooooppqrrrrrrssssttttttuuuuvvwwxyyz";
var englishDist = "aaaaaaaabbcccddddeeeeeeeeeeeefffgghhhhhhiiiiiiijkllllmmnnnnnnnooooooooppqrrrrrrssssssstttttttttuuuvwwwxyyz";
vikrum /
Created Jul 2, 2012
Twitter's JVM startup template
# Courtesy @marius, April 2012
# "Our most common type of system are mostly stateless, high volume,
# low latency RPC systems. For these, we generally use this template:"
HEAP_OPTS="-Xmx17G -Xms17G -XX:NewSize=15G -XX:+UseNUMA"
GC_OPTS="-XX:+UseConcMarkSweepGC -XX:SurvivorRatio=40 -XX:+CMSScavengeBeforeRemark"
GC_LOG_OPTS="-verbosegc -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintGCDateStamps -XX:+PrintTenuringDistribution -XX:+PrintHeapAtGC"
vikrum / App.scala
Created Jun 26, 2012
Scala REPL exposed via Netty
View App.scala
object App extends Logging {
def main(args: Array[String]) = {
* Setup Netty for things like logging, etc. This should happen first. Do not get rid of this.
* You'll have a calamity on your hands if it needs to log under stress and it is unable to.
You can’t perform that action at this time.