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
from twisted.internet import reactor | |
from twisted.manhole import telnet | |
def createShellServer( ): | |
print 'Creating shell server instance' | |
factory = telnet.ShellFactory() | |
port = reactor.listenTCP( 8787, factory) | |
factory.namespace['x'] = 'hello world' | |
factory.username = 'guest' | |
factory.password = 'guest' | |
print 'Listening on port 2000' |
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
#!/bin/bash | |
# sudo apt-get install libwww-perl libcrypt-ssleay-perl | |
. ~/.smsrc | |
body="$(cat)" | |
perl ~/src/skrypty-sms-read-only/sms.miastoplusa.pl $1 "$body" "$username" "$password" |
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
from BeautifulSoup import BeautifulSoup | |
import sys | |
soup = BeautifulSoup(sys.stdin.read()) | |
inp = soup.find(lambda t: t.get('name') == 'LDAPserver') | |
if inp is not None: print inp['value'] |
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
import sys | |
from xml.etree.ElementTree import ElementTree | |
tree = ElementTree() | |
tree.parse(sys.stdin) | |
buttons = tree.findall(".//buttons/button") | |
entries = [(button.get('caller-name'), button.get('value')) for button in buttons] |
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
ldapsearch -h myhost.com -b 'ou=People,dc=google,dc=pl' -x '(givenName=Marek)' |
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
# -*- coding: utf-8 -*- | |
import re | |
intab = u"ąćęłńóśżźĄĆĘŁŃÓŚŻŹ" | |
ottab = u"acelnoszzACELNOSZZ" | |
def translate(s): | |
for i, o in zip(intab, ottab): | |
s = re.sub(i, o, s) |
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
/^[ \t]*$/d | |
s/^[ \t]*// | |
s/[ \t]*$// | |
s/[ \t][ \t]/\t/g |
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
import wx | |
class CustomerClientFactory(ClientFactory): | |
def __init__(self, app): | |
self.app = app | |
def buildProtocol(self, addr): | |
print 'Connected.' | |
return CustomerChatClient(self.app) |
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
"""Simple HTTP Server. | |
This module builds on BaseHTTPServer by implementing the standard GET | |
and HEAD requests in a fairly straightforward manner. | |
""" | |
__version__ = "0.6" |
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 | |
import plac | |
from ESL import * | |
from xml.etree.ElementTree import ElementTree, fromstring | |
DEFAULT_HOST = '127.0.0.1' | |
DEFAULT_PORT = 8021 |