Skip to content

Instantly share code, notes, and snippets.

View vikrum's full-sized avatar
🎯
Focusing

vikrum vikrum

🎯
Focusing
View GitHub Profile
@vikrum
vikrum / Png2Json.java
Created February 11, 2013 23:04
Quick hack to dump an image to JSON.
package com.firebase.sandbox;
import java.awt.Color;
import java.awt.image.BufferedImage;
import java.io.File;
import javax.imageio.ImageIO;
import org.json.JSONObject;
public class Png2Json {
public static void main(String[] args) {
@vikrum
vikrum / probe.sh
Last active December 13, 2015 18:39
Probe SSL server for supported ciphers. (Modified from: http://superuser.com/a/224263/199361 )
#!/usr/bin/env bash
# OpenSSL requires the port number.
SERVER=$1:443
DELAY=1
ciphers=$(openssl ciphers 'ALL:eNULL' | sed -e 's/:/ /g')
echo Obtaining cipher list from $(openssl version).
for cipher in ${ciphers[@]}
@vikrum
vikrum / pacific-zulu.txt
Created March 28, 2013 01:00
Super lazy mode lookup table for Pacific to Zulu time.
PST PDT GMT
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
vikrum / AndroidManifest.xml
Last active April 6, 2024 12:00
Firebase+Android sample app with background Service + local notifications.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.bgfirebaseapp"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="16"
android:targetSdkVersion="17" />
@vikrum
vikrum / 95th.py
Created December 31, 2013 21:50
Get 95th percentile from stdin
#!/usr/bin/env python
#
# based on http://stackoverflow.com/a/2753343o
#
# input needs to be presorted
#
import math
import functools
import fileinput

Keybase proof

I hereby claim:

  • I am vikrum on github.
  • I am vikrum (https://keybase.io/vikrum) on keybase.
  • I have a public key whose fingerprint is C7D6 A287 0BF0 3A38 474A 5EC5 3215 E45A E1F4 FD83

To claim this, I am signing this object:

@vikrum
vikrum / spin.c
Created April 1, 2014 18:03
Terminal screensaver/session activity bumper thing.
/* .. spin ..
*
* $ gcc spin.c -o spin -lncurses -Wall -O3
*
* vsn - 2006
*/
#include <stdlib.h> // srand
#include <time.h> // time
#include <string.h>
# -*- 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 https://dev.twitter.com/apps
@requirements: Python 2.5+, Tweepy (http://pypi.python.org/pypi/tweepy/1.7.1)
@vikrum
vikrum / dcurl.sh
Last active August 29, 2015 14:04
curl debug
curl -so /dev/null -w "url_effective = %{url_effective}\n http_code = %{http_code}\n http_connect = %{http_connect}\n time_total = %{time_total}\n time_namelookup = %{time_namelookup}\n time_connect = %{time_connect}\n time_appconnect = %{time_appconnect}\n time_pretransfer = %{time_pretransfer}\n time_redirect = %{time_redirect}\n time_starttransfer = %{time_starttransfer}\n size_download = %{size_download}\n size_upload = %{size_upload}\n size_header = %{size_header}\n size_request = %{size_request}\n speed_download = %{speed_download}\n speed_upload = %{speed_upload}" https://zzz
@vikrum
vikrum / Base64-2.3.7-MIT.java
Created September 18, 2014 17:49
iHarder Base64 — MIT licensed by author via email Sept. 2014
/**
* <p>
* This file is licensed under the MIT License as read at
* http://www.opensource.org/licenses/mit-license.php
* and reproduced here:</p>
*
* <blockquote>Copyright (c) 2009 Robert Harder.
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights