Loga Usuários!
Publicado por Leonardo Berbert Gomes 30/12/2004
[ Hits: 5.593 ]
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"
Bot que baixa o KDE 3.4 e a QT para o Slackware 10.1
Script em Python 3.6 para fazer scrape de uma URL exportando métricas no formato Prometheus
Nenhum coment�rio foi encontrado.
Conciliando ZRAM Swap com Swap em arquivo ou partição
Servidor de Backup com Ubuntu Server 24.04 LTS, RAID e Duplicati (Dell PowerEdge T420)
Visualizar câmeras IP ONVIF no Linux sem necessidade de instalar aplicativos
Dicas para encontrar games Indies diferentes e criativos
Proteja seu Linux Mint com o Timeshift: Restaure o sistema mesmo que ele não inicie!
Instalar driver Nvidia no Debian 13
Redimensionando, espelhando, convertendo e rotacionando imagens com script
Ajuda com o Debian 13 - Video hibrido geforce 940 mx Wayland OFF (5)
Problema com impressoras de rede (1)
Rust é o "C da nossa geração"? (10)