Skip to content

Instantly share code, notes, and snippets.

View JuniorPolegato's full-sized avatar

Junior Polegato JuniorPolegato

View GitHub Profile
#!/usr/bin/env python
# -*- coding: utf-8 -*-
def crc32(string):
crctab = []
for table in range(256):
crc = table << 24
# 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;
#!/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:
#!/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
#!/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
#!/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
#!/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]
#!/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"))
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import httplib
import re
import sys
import base64
import subprocess
import urllib
import lxml.etree
#!/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)