Flask apps are bound to port 5000 by default. To bind it to port 80, you would need to change the port as follows:
if __name__ == '__main__':
app.run(host='0.0.0.0', port=80, debug=True)
And to run it:
Flask apps are bound to port 5000 by default. To bind it to port 80, you would need to change the port as follows:
if __name__ == '__main__':
app.run(host='0.0.0.0', port=80, debug=True)
And to run it:
Thank you everybody, Your comments makes it better
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
license: gpl-3.0 | |
border: no |
Use Python to:
type below:
brew update
brew install redis
To have launchd start redis now and restart at login:
brew services start redis
These are my notes basically. At first i created this gist just as a reminder for myself. But feel free to use this for your project as a starting point. If you have questions you can find me on twitter @thomasf https://twitter.com/thomasf This is how i used it on a Debian Wheezy testing (https://www.debian.org/releases/testing/)
Discuss, ask questions, etc. here https://news.ycombinator.com/item?id=7445545
# -*- coding:utf-8 -*- | |
import sys, os | |
import logging | |
import logging.config | |
import tornado | |
import tornado.wsgi | |
import tornado.httpserver | |
import tornado.ioloop | |
from tornado.options import define, options, parse_command_line |
#!/usr/bin/python | |
#based on the ideas from http://synack.me/blog/implementing-http-live-streaming | |
# Updates: | |
# - 2024-04-24: Apply suggestions from @Pin80 | |
# Run this script and then launch the following pipeline: | |
# gst-launch videotestsrc pattern=ball ! video/x-raw-rgb, framerate=15/1, width=640, height=480 ! jpegenc ! multipartmux boundary=spionisto ! tcpclientsink port=9999 | |
#updated command line | |
#gst-launch-1.0 videotestsrc pattern=ball ! videoconvert ! video/x-raw, framerate=15/1, width=640, height=480 ! jpegenc ! multipartmux boundary=spionisto ! #tcpclientsink port=9999 | |
from multiprocessing import Queue |
/** | |
* The routing controller object. | |
* | |
* Usage: | |
* + Define the routing table by controller.map(valueRegex, callback); | |
* the callback will be called and passed the value as the first argument. | |
* + Routing action by: controller.route(definedValue). If no definedValue matches, do nothing. | |
*/ | |
define( |
try: | |
# for Python 2.x | |
from Queue import Queue | |
except ImportError: | |
# for Python 3.x | |
from queue import Queue | |
from threading import Thread, Event | |
import random | |
import sys |