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
rewimport httplib | |
import urlparse | |
# funcion que se encarga de obtener respuesta del estatus del servidor web | |
def get_server_status_code(url): | |
# descarga sólo el encabezado de una URL y devolver el código de estado del servidor. | |
host, path = urlparse.urlparse(url)[1:3] | |
try: | |
conexion = httplib.HTTPConnection(host) | |
conexion.request('HEAD', path) |
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 string | |
from random import choice | |
def generador(n): | |
return ''.join([choice(string.letters + string.digits) for i in range(n)]) | |
for genera in range(1000): | |
genera = generador(8) | |
#el numero significa la base o la longitud que quieres que sea el valor de la clave | |
print genera(8) |
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/lib/python | |
# by @eliezerfot123 | |
import random | |
import os | |
# Abrimos el archivo donde tenemos los twitts con la función open() de python. | |
linea=open("archivoDeTwitts.txt","r").readlines() | |
# Le decimos a python que haga un random en las lineas encontradas y escoja uno. | |
muestro = linea[random.randint(0, len(linea)-1)] |
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 -*- | |
import sys | |
import time | |
from PyQt4.QtCore import * | |
from PyQt4.QtGui import * | |
from PyQt4.QtWebKit import * | |
class Screenshot(QWebView): | |
def __init__(self): | |
self.app = QApplication(sys.argv) |
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/lib/python | |
import re | |
correo = 'correo@correo.com' | |
if re.match('^[(a-z0-9\_\-\.)]+@[(a-z0-9\_\-\.)]+\.[(a-z)]{2,4}$',correo.lower()): | |
print 'Correo Correcto' | |
else: | |
print 'El correo no es correcto...' |
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/lib/env python | |
#Utilizamos la libreria de python urllib2 | |
import urllib2 | |
def contenidoPagina(url): | |
try: | |
traer = urllib2.urlopen(page) | |
# leemos el contenido que trae la pagina. | |
datos = traer.read() |
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/env python | |
# Ejemplo de como enviar SMS usando gammu y python | |
import gammu | |
import sys | |
# se crea un objeto stateMachine, para hablar con el telefono | |
sm = gammu.StateMachine() | |
# Leer la configuracion desde (~/.gammurc) |
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/env python | |
# Librerias necesarias | |
import paramiko | |
import os | |
# Datos para la conexion SSH | |
ssh_servidor = '10.0.70.44' | |
ssh_usuario = 'tuusuario' | |
ssh_clave = 'tucontraseña' |
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 sys, math | |
from time import time, localtime, strftime | |
########################### CONFIGURACION ######################### | |
# LONGITUD DEBE SER MINIMO 8 | CLAVES WPA/2 SON DE MINIMO 8 CARACTERES | |
LONGITUD = 10 | |
ALFABETO = "qwertyuioplkjhgfdsazxcvbnm" |
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
<html> | |
<head> | |
<title> | |
COMBOBOX | |
</title> | |
<script type="text/javascript"> | |
function cargarSelect2(valor) { | |
var arrayValores=new Array( | |
new Array(1,1,"opcion1-1"), |
OlderNewer