Skip to content

Instantly share code, notes, and snippets.

View idlecool's full-sized avatar

Shiv Deepak idlecool

  • Aeroh, Inc.
  • Mountain View, CA
View GitHub Profile
@idlecool
idlecool / flvizer.sh
Created October 5, 2010 12:49 — forked from anonymous/shiv.sh
saving flash videos from firefox chrome cache
#!/bin/bash
#The target directory where you want the files to be saved.
#With trailing slash.
target="$HOME/"
cd "/tmp"
for i in `ls | grep ^Flash`
#!/bin/sh -
"exec" "python" "-O" "$0" "$@"
__doc__ = """Tiny HTTP Proxy.
This module implements GET, HEAD, POST, PUT and DELETE methods
on BaseHTTPServer, and behaves as an HTTP proxy. The CONNECT
method is also implemented experimentally, but has not been
tested yet.
@idlecool
idlecool / flashplayer_video_grabber.sh
Created April 10, 2011 09:53
grab flash videos from the cache.
#!/usr/bin/env bash
for flashpid in $(pgrep -f flashplayer.so); do
cd "/proc/$flashpid/fd"
for video in $(file * | grep '/tmp/Flash' | sed 's/\(^[0-9]*\).*/\1/g'); do
echo "/proc/$flashpid/fd/$video"
done
done
@idlecool
idlecool / filemerge.c
Created May 6, 2011 15:28
Merge two corrupt files (one at front and another at rear) into one neat file.
#include <stdio.h>
void main()
{
FILE *ifp1, *ifp2, *ofp;
int limit, pointer=0;
int current_char, junkchar;
limit = 300*1024; // 300KB
ifp1 = fopen("eclipse-java-helios-SR2-linux-gtk2","r");
ifp2 = fopen("eclipse-java-helios-SR2-linux-gtk","r");
ofp = fopen("eclipse-java-helios-SR2-linux-gtk.tar.gz","w");
@idlecool
idlecool / getcharmappings.py
Created May 11, 2011 12:51
get truetype font char mappings
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Generate mappings of any font, to check if
a given hex code is available or not.
author: Shiv Deepak <idlecool@gmail.com>
"""
from xml.sax import saxutils, make_parser
from xml.sax.handler import feature_namespaces
import os
from reportlab.pdfbase import pdfmetrics
from reportlab.pdfbase.ttfonts import TTFont
import reportlab
reportlab.rl_config.warnOnMissingFontGlyphs = 0
#set the directory where the font is stored.
fonts_directory = os.path.join(os.path.dirname(os.path.abspath(__file__)),
"fonts")
@idlecool
idlecool / s3ocr.py
Created June 13, 2011 12:33
Old s3ocr.py which has been moved to s3pdf.py - SahanaEden
# -*- coding: utf-8 -*-
""" Sahana Optical Character Recognision Utility (s3ocr)
@author: Suryajith Chillara <suryajith1987[at]gmail.com>
@author: Shiv Deepak <idlecool[at]gmail.com>
@copyright: 2009-2011 (c) Sahana Software Foundation
@license: MIT
{
"status": "success",
"statuscode": "200",
"message": "Validation error",
"tree": {
"$_cr_shelter": [
{
"$k_shelter_type_id": {
"$_cr_shelter_type": [
{
@idlecool
idlecool / bzr-gsoc-zipper.sh
Created August 29, 2011 21:25
Zips diff files for GSoC code submission
#!/bin/bash
# Author: Shiv Deepak <idlecool@gmail.com>
# Bazaar GSoC Zipper
# I basically wrote this script to generate diff files for my project
# from parent banch (which is `vita` for me ), for most of you it will
# be `trunk`, just get a fresh copy of trunk and run this script inside it.
# Ex:
#
# Step 1: Get a fresh copy of trunk
# $ bzr branch lp:sahana-eden eden
#include<stdio.h>
#include<stdlib.h>
#include<sys/socket.h>
#include<features.h>
#include<linux/if_packet.h>
#include<linux/if_ether.h>
#include<errno.h>
#include<sys/ioctl.h>
#include<net/if.h>
#include<linux/ip.h>