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
View aws-prefixes.txt
vikrum / AndroidManifest.xml
Last active Dec 31, 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 / .osx
Last active Dec 18, 2019
Vikrum's Most Excellent Antiques, Curiosities, and Dotfiles
View .osx
defaults write IncludeDebugMenu 1
defaults write no-bouncing -bool TRUE
defaults write bannerTime 1
defaults write -g ApplePressAndHoldEnabled -bool false
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
# -*- coding: utf-8 -*-
This script will delete all of the tweets in the specified account.
You may need to hit the "more" button on the bottom of your twitter profile
page every now and then as the script runs, this is due to a bug in twitter.
You will need to get a consumer key and consumer secret token to use this
script, you can do so by registering a twitter application at
@requirements: Python 2.5+, Tweepy (
View index.html
<!DOCTYPE html>
<html lang="en">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href=".css">
<script src=".js"></script>
vikrum / oneliners.txt
Last active Mar 3, 2017
Various One Liners
View oneliners.txt
# On bash + Linux
# Show TCP sockstats every 5 seconds
$ while [ : ]; do echo -n `date`; echo -n ": "; cat /proc/net/sockstat | sed 'N;s/\n/ /;' | grep TCP; sleep 5; done
# Show netstat connection state counts every 5 seconds
$ while [ : ]; do echo -n `date`; echo -n ": "; netstat -n | awk '/^tcp/ {t[$NF]++}END{for(state in t){print state, t[state]} }' | tr '\n' ' '; echo ; sleep 5; done
# Show top 25 established IPs and their counts
$ lsof -n|grep TCP|grep ESTABLISHED|awk '{print $9}' |grep -e "->"|awk -F '->' '{print $2}'|awk -F ':' '{print $1}'|sort -t . -k 1,1n -k 2,2n -k 3,3n -k 4,4n|uniq -c|sort -rn|head -25
vikrum / 401k
Last active Jan 18, 2017
Quantopian 401K simplified SPY model; front loaded (4 pay cycles) VS throughout year (26 pay cycles) of $27k
View 401k
def initialize(context):
# Reference to SPY
context.spy = sid(8554)
schedule_function(buySpread, date_rules.week_start(), time_rules.market_open())
def buyFront(context, data):
weekno = get_datetime('US/Eastern').isocalendar()[1]
# Invest in first 4 pay cycles
if (weekno % 2 == 0) and (weekno <=8):
if data.can_trade(context.spy):
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.