This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding=utf-8 | |
from datetime import date, timedelta | |
import logging | |
from django_cron import CronJobBase, Schedule | |
from django_cron.models import CronJobLog | |
logger = logging.getLogger('captcha') | |
class DropLogs(CronJobBase): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.core.serializers.json import DjangoJSONEncoder | |
from django.db.models import Model | |
from django.db.models.query import QuerySet | |
from django.forms import model_to_dict | |
class ExtendedDjangoJSONEncoder(DjangoJSONEncoder): | |
def default(self, o): | |
if hasattr(o, 'to_dict'): | |
return o.to_dict() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
from django.views.generic import TemplateView | |
from django.http import HttpResponse, HttpResponseBadRequest | |
from lib import ExtendedDjangoJSONEncoder | |
class RequestMixin(object): | |
def dispatch(self, request, *args, **kwargs): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Make html safe for imapseagull-storage-mongo. | |
# Use post_parse_handlers setting to add | |
var sanitizer = require('sanitizer'); # https://github.com/theSmaw/Caja-HTML-Sanitizer | |
var _tagPolicy = sanitizer.makeTagPolicy(), | |
_hrefScript = ['javascript:', 'vbscript:'], | |
_tags = ['img', 'a'], _attrs = ['src', 'href']; # Sanitizer erased all, so it's for exception | |
function sanitizationTagPolicy(storage, mail, tagName, attribs) { | |
if (_tags.indexOf(tagName) >= 0 && attribs.length) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Next request will return only fields of package_key objects | |
{ | |
"method": "object.query", | |
"params": ["SELECT * FROM package_keys WHERE apikey='abcdefgh'"], | |
"id": 1 | |
} | |
// But next one will return some related objects | |
// See http://support.mashery.com/docs/read/mashery_api/20/Query_Language for details | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
var vals = []; | |
var last_packets_num = 10; | |
callback = function(f){ | |
my_ip = f.ip; | |
setInterval(calc,1000) | |
} | |
calc = function(){ | |
var x=new Date |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var raw = require("raw-socket"); | |
var ip = require('ip'); | |
var util = require('util'); | |
function send(src_ip, src_port, dst_ip, dst_port) { | |
var socket = raw.createSocket({ | |
protocol: raw.Protocol.TCP, // See http://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml | |
addressFamily: raw.AddressFamily.IPv4 | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# Filename s5.py | |
# Python Dynamic Socks5 Proxy | |
# Usage: python s5.py 1080 | |
# Background Run: nohup python s5.py 1080 & | |
# Email: [email protected] | |
import socket, sys, select, SocketServer, struct, time | |
SocketServer.TCPServer.allow_reuse_address = True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var ANS_START = " '~", | |
ANS_STOP = "' SQL=", | |
ANS_LIM = 31; | |
function ajax93t411(start_from, lim, construct_req) { | |
start_from = start_from || 0; | |
lim = lim || 1; // Can be -1. -1 if for "while no Err" | |
function req(i, offset, callback) { |