Vientos de Libertad el blog de Juanjo Conti – en borrador permanente – abstracto, lúdico y digital
Browsing all posts in: Twisted

Charla relámpago: Comet en Twisted

Septiembre 6

Ayer en las charlas relámpago de PyCon Argentina 2009 mostré cómo utilizar Comet desde Twisted. Tenía un slide disparador que no pude mostrar por que OpenOffice no se abrió y como las charlas relámpago duran 5 minutos, no podía darme el lujo de investigar que pasaba.

“No importa”, dije, “de todas formas el slide tenía solo cuatro palabras”. Y para hacer justicia sobre las Leyes de Murphy publico aquí ese slide:

cometEl ejemplo que mostré en vivo puede bajarse del sitio web de Nevow/Athena.

Shell Python administrativo sobre SSH para tu servidor Twisted en 10 líneas

Abril 9

entre tu reactor.listeTCT(puerto, factory) y reactor.run():

from twisted.conch import manhole, manhole_ssh
from twisted.cred import portal, checkers 

def getManholeFactory(namespace, **passwords):
    realm = manhole_ssh.TerminalRealm()
    def getManhole(_): return manhole.Manhole(namespace)
    realm.chainedProtocolFactory.protocolFactory = getManhole
    p = portal.Portal(realm)
    p.registerChecker(
    checkers.InMemoryUsernamePasswordDatabaseDontUse(**passwords))
    f = manhole_ssh.ConchFactory(p)
    return f

reactor.listenTCP(2222, getManholeFactory(globals(), admin='aaa'))

Los aplausos para este tutorial.

Servidor SSH con Twisted

Abril 8

Actualicé este ejemplo, tamibién incluido en el libro de Twisted para que no tire Deprecation Warnings:

Read the rest of this entry »