Loga Usuários!
Publicado por Leonardo Berbert Gomes 30/12/2004
[ Hits: 5.757 ]
Homepage: https://www.linkedin.com/in/leoberbert
Script CGI em Python, que
tem a função de logar os
acessos a uma página da Web.
#!../CGIpython/cgipython
import os, sys, string
logfilename = "/absolute/path/to/log/file/directory/"
# change the directory path
exc_list = ["xxx.xxx.xxx.xxx", "xxx.xxx.xxx.xxx"]
#exc_list = []
# the list of machines to exclude from logging
######### And now the tricky bit #############
# Get input
infolist = sys.argv[1:] + [ os.popen('date').read(),
os.environ.get("REMOTE_ADDR", "--noaddr--"),
os.environ.get("HTTP_USER_AGENT", "--noagent--"),
os.environ.get("HTTP_REFERER", "--noreferer--"),
'\n']
# print infolist
out = string.join(infolist, ' : ')
address = os.environ.get("REMOTE_ADDR", "noaddr")
logfilename += (address + ".dat")
if address not in exc_list:
open(logfilename,'a').write(out)
print "Content-type: text/html\n\n"
Script em Python 3.6 conectando em um API real da web
Python script para inundação de email
Nenhum comentário foi encontrado.
WhatsApp com Chamadas no Linux via Waydroid
XFCE - quase um Gnome ou Plasma mas muito mais leve
LXQT - funcional para máquinas pererecas e usuários menos exigentes
DOOM Carniceiro: rode o Meatgrinder com uzdoom (Gentoo e Ubuntu)
Samba 4 AD-DC 2026: Como instalar e configurar um Active Directory (via APT-GET)
[Resolvido] Sumiço de redes e micro quedas no iwd/iwgtk (Realtek rtw88)
Como Configurar DNS Reverso (PTR) em Ambientes Linux e Microsoft
Linux MInt nao reconhece placa de som (0)
Links importantes de usuários do vol (0)









