This file contains 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 collections import UserDict | |
from collections.abc import Iterable, Mapping | |
import json | |
class AutoTypeDict(UserDict): | |
"""Dictionary-like class that automatically tries to typecast each | |
scalar value to a standard type. | |
Values are only typecasted when the `AutoTypeDict` instance is | |
updated directly, so avoid using type-specific operations on mutable |
This file contains 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
""" | |
HTML <-> text conversions. | |
http://stackoverflow.com/questions/328356/extracting-text-from-html-file-using-python | |
""" | |
from html.parser import HTMLParser | |
from html.entities import name2codepoint | |
import re | |
class _HTMLToText(HTMLParser): | |
def __init__(self): |
This file contains 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 | |
''' | |
_______ ______ | |
|_ _\ \ / / ___| | |
| | \ \ / /\___ \ | |
| | \ V / ___) | | |
|_| \_/ |____/ | |
Teske Virtual System |
This file contains 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 | |
import getpass | |
import stem.connection | |
import stem.socket | |
try: | |
control_socket = stem.socket.ControlPort(port = 9051) | |
except stem.SocketError as exc: | |
print 'Unable to connect to port 9051 (%s)' % exc | |
sys.exit(1) |
This file contains 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
#installs the browser-based editor Codiad | |
DEST=~/codiad | |
ADDR=127.0.0.1:9876 | |
pkg install php | |
if [ ! -e $DEST ] | |
then | |
git clone https://github.com/Codiad/Codiad $DEST |