Activates a service immediately:
systemctl start foo.service
Deactivates a service immediately:
[ | |
{ | |
"action": "talk", | |
"text": "Hey there! Welcome to Ford Mustang Romania conference line", | |
"voiceName": "Kimberly" | |
}, | |
{ | |
"action": "conversation", | |
"name": "ford-mustang-romania" | |
} |
# Get youtube id | |
#http://youtu.be/5Y6HSHwhVlY | |
#http://www.youtube.com/embed/5Y6HSHwhVlY?rel=0 | |
#http://www.youtube.com/watch?v=ZFqlHhCNBOI | |
regex = re.compile(r'(https?://)?(www\.)?(youtube|youtu|youtube-nocookie)\.(com|be)/(watch\?v=|embed/|v/|.+\?v=)?(?P<id>[A-Za-z0-9\-=_]{11})') | |
match = regex.match(self.youtube_url) |
import os | |
import falcon | |
import jinja2 | |
def load_template(name): | |
path = os.path.join('templates', name) | |
with open(os.path.abspath(path), 'r') as fp: | |
return jinja2.Template(fp.read()) |
# This gist shows how to integrate Flask into a | |
# custom Gunicorn-WSGI application described | |
# here: http://docs.gunicorn.org/en/stable/custom.html | |
from __future__ import unicode_literals | |
import multiprocessing | |
import gunicorn.app.base |
<VirtualHost _default_:443> | |
ServerName yourhost | |
ServerAdmin [email protected] | |
SSLEngine on | |
SSLCertificateFile /etc/ssl/private/yourorg.com.crt | |
SSLCertificateKeyFile /etc/ssl/private/yourorg.com.key | |
SSLCertificateChainFile /etc/ssl/private/chain.pem | |
SSLProxyEngine On |
from flask import Flask, current_app | |
from blinker import Namespace | |
app = Flask(__name__) | |
app.secret_key = 'WOO' | |
my_signals = Namespace() | |
def moo_signal(app, message, **extra): |
import paho.mqtt.client as paho | |
import os | |
import socket | |
import ssl | |
from time import sleep | |
from random import uniform | |
import json | |
import logging | |
logging.basicConfig(level=logging.INFO) |