- GitHub Staff
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
diff --git a/svcshare/network.py b/svcshare/network.py | |
index 3abb688..7b1af2a 100644 | |
--- a/svcshare/network.py | |
+++ b/svcshare/network.py | |
@@ -62,6 +62,8 @@ class Network(object): | |
return self._isolation | |
def isolationIs(self, iso): | |
+ if not hasattr(threading.Thread, "is_alive"): | |
+ threading.Thread.is_alive = threading.Thread.isAlive |
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 logging | |
def logger(name, debug=False): | |
"""Log handler""" | |
logging.basicConfig( | |
level=logging.DEBUG if debug else logging.INFO, | |
format="%(asctime)s [%(name)s] %(message)s", | |
datefmt="%H:%M:%S") | |
return logging.getLogger(name) |
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
xml = minidom.parseString(response.read()) | |
for i in xml.childNodes[0].childNodes[1].childNodes[0].childNodes: | |
title = i._attrs["title"].firstChild.data | |
title = re.sub(" ", "_", title) |
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
def on_pubmsg(self, connection, event): | |
"""Handle public messages""" | |
print event.source() | |
self.source = event.source().split("@", 1)[0] | |
self.target = event.target() | |
nick = irclib.nm_to_n(event.source()) | |
msg = event.arguments()[0] | |
self.log.info("%s <%s> %s" % (self.target, nick, msg)) | |
self.poll_messages(msg) |
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
#!/bin/sh | |
echo "Running PEP8..." | |
pep8 -r . | |
echo "Running pylint..." | |
pylint pyhole.py -f parseable -rno -dI | |
pylint plugins -f parseable -rno -dI | |
pylint pyhole -f parseable -rno -dI |
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
os = openstack | |
flavor = os.flavors.find { |f| f.name == "m1.tiny" } | |
image = os.images.find { |i| i.name == "cirros-0.3.0-x86_64-uec" } | |
# Boot instance using Fog | |
# server = os.servers.create(:name => agent_id, :image_ref => image.id, :flavor_ref => flavor.id) | |
server = cpi.create_vm("cpi-test", image.name, { "instance_type" => flavor.name }, {"default" => { "type" => "dynamic" }}) |
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
openstack: | |
auth_url: http://localhost:5000/v2.0/tokens | |
username: admin | |
api_key: nova | |
tenant: admin | |
registry: | |
endpoint: http://localhost:25777 | |
user: admin | |
password: admin |
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
[jkearney@Router] > /ip firewall nat print | |
Flags: X - disabled, I - invalid, D - dynamic | |
0 chain=srcnat action=masquerade to-addresses=0.0.0.0 out-interface=ether1-gateway | |
[jkearney@Router] > | |
[jkearney@Router] > /ip firewall filter print | |
Flags: X - disabled, I - invalid, D - dynamic | |
0 chain=input action=accept protocol=icmp in-interface=ether1-gateway | |
1 chain=input action=accept protocol=udp in-interface=ether1-gateway dst-port=500,1701,4500 | |
2 chain=input action=accept connection-state=established in-interface=ether1-gateway | |
3 chain=forward action=accept connection-state=established in-interface=ether1-gateway |
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
@route("/video/amazoninstantvideo/getvideoobject") | |
def GetVideoObject(url, video_type, title=None, summary=None, thumb_url=None): | |
thumb = Resource.ContentsOfURLWithFallback(url=thumb_url, fallback=PLUGIN_ICON_DEFAULT) | |
if video_type == "episode": | |
return EpisodeObject(key=Callback(VideoDetails, url), rating_key=url, items=video_items(url), title=title, summary=summary, thumb=thumb) | |
else: | |
return MovieObject(key=Callback(VideoDetails, url), rating_key=url, items=video_items(url), title=title, summary=summary, thumb=thumb) | |
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
@route("/video/amazoninstantvideo/playvideo") | |
@indirect | |
def PlayVideo(url): | |
try: | |
flash_vars = utils.parse_flash_vars(url) | |
rtmp_url, clip_stream = utils.prepare_rtmp_info(flash_vars) | |
except KeyError: | |
return MessageContainer("Error", "Unable to load video.") | |
oc = ObjectContainer() |
OlderNewer