Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
| sudo su | |
| echo 'g_serial' >> etc/modules | |
| echo 'ttyGS0' >> etc/securetty | |
| echo 'echo 2 > /sys/bus/platform/devices/sunxi_usb_udc/otg_role' > etc/init.d/otg_config.sh | |
| chmod +x etc/init.d/otg_config.sh |
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
| """Asynchronous requests in Flask with gevent""" | |
| from time import time | |
| from flask import Flask, Response | |
| from gevent.pywsgi import WSGIServer | |
| from gevent import monkey | |
| import requests |
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 socket import socket, SO_REUSEADDR, SOL_SOCKET | |
| from asyncio import Task, coroutine, get_event_loop | |
| class Peer(object): | |
| def __init__(self, server, sock, name): | |
| self.loop = server.loop | |
| self.name = name | |
| self._sock = sock | |
| self._server = server | |
| Task(self._peer_handler()) |