This file contains hidden or 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 | |
# -*- coding: utf-8 -*- | |
def crc32(string): | |
crctab = [] | |
for table in range(256): | |
crc = table << 24 |
This file contains hidden or 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
# include <stdio.h> | |
int main(int argc, char* argv[]){ | |
char a = 1 << 7; | |
unsigned char b = 2 * (a - 1) + 1; | |
short int c = 1 << 15; | |
unsigned short int d = 2 * (c - 1) + 1; | |
long int e = 1L << 31; |
This file contains hidden or 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 | |
# -*- coding: utf-8 -*- | |
import pole | |
import zipfile | |
# Identificar tipo e converter | |
def converter(no_xml): | |
string = str(no_xml) | |
if '/' in string: |
This file contains hidden or 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 | |
# -*- coding: utf-8 -*- | |
import threading | |
import time | |
# Máximo de conexões/threads simultâneas | |
MAX_CONEXOES = 30 | |
# Função para imprimir uma linha por vez via lock |
This file contains hidden or 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 | |
# -*- coding: utf-8 -*- | |
import threading | |
import time | |
import sys,os | |
import subprocess | |
# Máximo de conexões/threads simultâneas | |
MAX_CONEXOES = 30 |
This file contains hidden or 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 | |
# -*- coding: utf-8 -*- | |
with open("/tmp/nomes.txt", "r+") as arquivo: | |
c = arquivo.read(1) | |
while c: | |
while c and c not in ("\r", "\n"): | |
c = arquivo.read(1) | |
if c: | |
arquivo.seek(-1, 1) # volta uma posição |
This file contains hidden or 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 python2.7 | |
# -*- coding: utf-8 -*- | |
import dns.resolver | |
import socket | |
def obter_mx(email): | |
try: | |
answers = dns.resolver.query(email.split('@')[1], 'MX') | |
mxs = [(rdata.preference, str(rdata.exchange))for rdata in answers] |
This file contains hidden or 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 | |
# -*- coding: utf-8 -*- | |
import time | |
import signal | |
continuar = True | |
sinais = dict((signal.__dict__[sinal], sinal) for sinal in dir(signal) | |
if sinal.startswith("SIG")) |
This file contains hidden or 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 | |
# -*- coding: utf-8 -*- | |
import httplib | |
import re | |
import sys | |
import base64 | |
import subprocess | |
import urllib | |
import lxml.etree |
This file contains hidden or 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 | |
# -*- coding: utf-8 -*- | |
import datetime | |
import pytz | |
import pole | |
cf = pole.util.cf | |
# Importando o html para PoleXML | |
root = pole.xml.importar(open('nfe.html').read().strip(), html=True) |