Skip to content

Instantly share code, notes, and snippets.

View vikraman's full-sized avatar

Vikraman Choudhury vikraman

View GitHub Profile
@vikraman
vikraman / jucse-stats.py
Created June 13, 2012 12:06
Jucse results grabber
#!/usr/bin/env python
import json
import pprint
d = json.JSONDecoder().decode(raw_input())
l = sorted(d, key=lambda x: d.get(x)['cgpa'], reverse=True)
for idx,rollno in enumerate(l:(
@vikraman
vikraman / GateResult.py
Created April 2, 2012 12:26
Gate results grabber
#!/usr/bin/env python
import urllib
from multiprocessing import Pool
def fetch_result(regno):
try:
data = urllib.urlencode({'curyear':'2012', 'rndno':'2988624', 'curregno':regno, 'prevyear':'2011', 'prevregno':'', 'qdeg':'E2', 'qdisc':'ECS', 'mcat':'GN', 'mpd':'N'})
result = urllib.urlopen("http://mtechadm.iitm.ac.in/gform2.php", data)
s = result.read()
@vikraman
vikraman / pty_login.c
Created February 20, 2012 19:05
Shell on a pty
#include <stdio.h>
#include <stdlib.h>
#include <pty.h>
#include <unistd.h>
#include <fcntl.h>
#include <termios.h>
#include <sys/select.h>
#define BUF_SIZE 80
#!/usr/bin/env perl
use warnings;
use strict;
use Data::Dumper;
use WWW::Mechanize;
use Compress::Zlib;
my $mech = WWW::Mechanize->new();
my $username = "9038090380";