Skip to content

Instantly share code, notes, and snippets.

View mishudark's full-sized avatar
:octocat:
Rocking

mishudark mishudark

:octocat:
Rocking
View GitHub Profile
@mishudark
mishudark / deleteComments.sh
Created November 13, 2010 22:48
Elimina todos los comentarios (no usar con js comprimido tipo jquery.min.js
#!/bin/bash
#mishudark <mishudark@astrata.com.mx> <moonsadly@gmail.com>
#thanks ostermiller.org to amazing regex
#
# delete_comments.sh
#
# Copyright 2010 mishudark <mishudark@astrata.com.mx> <moonsadly@gmail.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
cookie_h = urllib2.HTTPCookieProcessor()
opener = urllib2.build_opener(cookie_h)
urllib2.install_opener(opener)
ua = 'Mozilla/5.0 (X11; U; Linux i686; es-ES; rv:1.9.0.11)'
ua += ' Gecko/2009061118 Fedora/3.0.11-1.fc10 Firefox/3.0.11'
h = {"User-Agent": ua}
params = urllib.urlencode({"pass": password,"user" :username})
r = urllib2.Request("http://escolares.utm.mx/alumnos.php", headers=h)
f = urllib2.urlopen(r,params)
@mishudark
mishudark / download.php
Created November 16, 2010 05:14
Descarga cualquier fichero si se logra subir a un server
<?php
//http://elouai.com/force-download.php
$filename = $_GET['file'];
// required for IE, otherwise Content-disposition is ignored
if(ini_get('zlib.output_compression'))
ini_set('zlib.output_compression', 'Off');
// addition by Jorg Weske
$file_extension = strtolower(substr(strrchr($filename,"."),1));
import tornado.httpserver, tornado.ioloop, tornado.options, tornado.web, os.path
from tornado.options import define, options
define("port", default=8888, help="run on the given port", type=int)
class Application(tornado.web.Application):
def __init__(self):
handlers = [
(r"/", HomeHandler),
(r"/upload", UploadHandler)
@mishudark
mishudark / Tornado_websocket.py
Created November 29, 2010 23:54
pequeña demo de websockets en python con Tornado web... bastante incompleta por cierto
import logging
import tornado.auth
import tornado.escape
import tornado.httpserver
import tornado.ioloop
import tornado.options
import tornado.web
import os.path
import uuid
from tornado import websocket
@mishudark
mishudark / get_cookie.js
Created November 30, 2010 00:55
obtiene la cookie, en este caso la xsrf y la envia mediante json
@mishudark
mishudark / date_correct.php
Created December 1, 2010 02:04
devuelve el año y mes correctos al restar meses
<?php
/* date_correct.php
Copyright 2010 mishudark <mishudark@astrata.com.mx> <moonsadly@gmail.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
@mishudark
mishudark / deny_traceroute
Created December 1, 2010 02:46
evite el traceroute, linea copiada de hp forums posteada por g33k
IPTABLES -A OUTPUT -i $EXT_IF -p ICMP --icmp-type 11 -j DROP
@mishudark
mishudark / VLSM.py
Created December 11, 2010 06:48
Calcula el vlsm y renderiza un grafo de la red
#!/bin/env python
"""
graph_red.py
Copyright 2010 mishudark <moonsadly@gmail.com><mishudark@astrata.com.mx>
based on graph from nodebox
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
@mishudark
mishudark / 11-x11-synaptics.fdi
Created December 12, 2010 02:00
activa multitouch con touchpad synaptic, guardarlo en /etc/hal/fdi/policy/
<?xml version="1.0" encoding="ISO-8859-1"?>
<deviceinfo version="0.2">
<device>
<match key="info.capabilities" contains="input.touchpad">
<merge key="input.x11_driver" type="string">synaptics</merge>
<merge key="input.x11_options.SHMConfig" type="string">On</merge>
<merge key="input.x11_options.EmulateTwoFingerMinZ" type="string">90</merge>
<merge key="input.x11_options.VertTwoFingerScroll" type="string">1</merge>
<merge key="input.x11_options.HorizTwoFingerScroll" type="string">1</merge>
<merge key="input.x11_options.TapButton1" type="string">1</merge>