Skip to content

Instantly share code, notes, and snippets.

@joelewis
joelewis / readlog.js
Last active December 11, 2015 04:48
A javascript bookmarklet for recording your progress with the online book you are going through, and share it in your wordpress for future reference. //In chrome, click bookmark icon, choose edit and place this code in the 'url' space. //Now, you can click the bookmark whenever you want to log your current online book's progress in your wordpres…
javascript: var d=document,w=window,e=w.getSelection,k=d.getSelection,x=d.selection,s=(e?e():(k)?k():(x?x.createRange().text:0));
url=d.location.href, urlsplit=url.split('/'); urlstring="";
function cal(){for(i=1;i<(urlsplit.length-1);i++){ urlstring += urlsplit[i]+' | ';}}
cal();
poc = document.body.scrollTop/(document.body.clientHeight-window.innerHeight)*100;
poc = Math.ceil(poc);
poc = poc.toString();
s=s.toString();
s += "\n"+" I completed "+poc+"% of chapter-"+urlsplit[urlsplit.length-1].split('.')[0]+", in the book, "+"\""+urlstring+"\""+"<i> published via <a href='http://joelewis.github.com/readlog.html'>ReadLog</a></i>";
/*

Real Smart vs Fakes

I've seen smart people all through my lifelane. I've seen people who call them smart. I've seen people who try to show them smart. I've seen people who are smart. Not given enough space, you are likely to get lost figuring out, among all the above.
I've logged some keys which might help you find the real ones.

  • When somebody's smart, it shows.
  • When the smartness overshows, stop. He is not.
  • Where you find many _I-never-knew-about-that-stuff_s, there is someone smart there.
  • When asked a tech-doubt and the guy explains it close to awesome, with all those jargons and whatTheHellareTheseAndWhyINeverHeardTheseTerms terms, stop. He is not.

Log Feb-March '13

It's been quite some time, posting technical stuff and perhaps writing a post itself. I've been learning and doing a lot of things, that still keeps my fingers code-warm.

  • I'm into an Internship, and built an alpha version of (Habitator)[https://github.com/FixCorp/Habitator]
  • and I even wrote an ultra simple (Android App)[https://github.com/joelewis/filterlite] for filtering photos, out of a request and it works!
  • Initially wrote it targetting 14+ apis and had to backport it to work on gingerbread and above
  • Tried to code a database-less bloging solution using gists and its api, and pathetically failed with a message saying "The request rate for api.github.com from ..**.* exceeded the limit"
  • Nevertheless, I'm not gonna leave it like that. Possibly might complete it by next weekend.
  • Used php for api to webpage rendering stuff, and its been a long time pal. I owe php a lot more than any other for saving me out of fibonacci series and meaningless programs!
@joelewis
joelewis / Wishes.md
Last active December 15, 2015 04:50

To Be (Un)fulfilled Wishes

So, I'm here @iThoughtz writing this post while watching my wishlist breaking apart(well, not exactly!).
My wishlist of products to build will be

  • Automenu - to be completed.
  • #Geekosium [An app to push updates to clients]
  • #GPAcompare [possibly I never might be able to do this, an excellent idea it is]
  • A Javascript masterpiece I could show at places.
  • #Blogists [Blog with Gists]
  • Habitator

I've seen Nolan's Inception for around four times or something. It's an excellent piece of art blended with pure imagination and creativity with touches of reality to pull us into the movie.

I've been Nolan's premium fan ever since I saw The Dark Knight, its flow of story, and the Joker. He's a genius at story telling, rendering happenings with pure talent. That's bloody difficult than writing code. We have algorithms. He doesn't. We have data structures to frame and hang data. He doesn't. All he has is a visual portal with slots of scenes to tell data. Sorry, story. Though in most cases we have best solutions predefined, it takes a lot of indigeneous artistry to turn our code into something beautiful, a software. Analagous to what he does. He takes an incident, turns it into a story and tells us in the best way possible.

Well, I honor him so much, but there's a very very slight blunder in his Inception, which absolutely doesn't affect any part of the movie's aura even remotely.

Nobody, could have e

The Story of My Graduation Project


Two things.

  • I'm not Nolan, so this story is going to be bad.
  • Next, this might be my last rant, since I'm getting out of dev/null in a few days.

May-June, 2012

My Simple Analytics


I'm assessing my linux-box for performance, with various desktop-env's and applications. This might provide me useful info for working with my device with optimal performance. As far as now,

Ubuntu + Gnome-classic-session takes upto 310 MiB of memory. Ubuntu + xfce-session takes upto 270 MiB of memory.

@joelewis
joelewis / tancet.py
Created May 23, 2013 18:39
A python script to launch a series of requests to tancet result servers, to fetch me my register number which I lost. It's gonna try all possible combinations of numbers matching my DOB, and writes to matches.txt if a match is found. Warning: This might be a form of brute force attack, combined with DOS attack, except that annauniv.edu is not de…
import urllib
import urllib2
import bs4
startreg = 11161667
endreg = 11170000
for i in range(startreg, endreg):
istr = str(i)
soup = bs4.BeautifulSoup(urllib2.urlopen(urllib2.Request('http://www.annauniv.edu/cgi-bin/786786786/cet1.pl',urllib.urlencode ({'regno' : i, 'dob' : '14-09-1991' }))).read())

###Bruteforce Attack On Anna University Result Server

What does an amateur hacker do if his register number for checking his TANCET score is lost? He writes a script, that tries all possible combinations for all the eight digits of the register no. and launches a brute force attack on http://www.annauniv.edu/687--150/?.

The one that matches his D.O.B gets logged, and he gets pretty a number of matches out of which, 11323608 works for him and he finds out that his score is a below-average 32.5/50


@joelewis
joelewis / gistify.py
Created May 25, 2013 20:16
python script to do all the commandline works for me after writing a blog post.
from subprocess import call
import sys
def main():
if len(sys.argv) == 2:
call('gist ' + sys.argv[1], shell=True)
call('python /home/joe/Documents/workstage/joelewis/blog/utils/addone.py', shell=True)
call('git --git-dir=/home/joe/Documents/workstage/joelewis/.git --work-tree=/home/joe/Documents/workstage/joelewis add .',shell=True)
call('git --git-dir=/home/joe/Documents/workstage/joelewis/.git --work-tree=/home/joe/Documents/workstage/joelewis commit -m "+1 post"',shell=True)