Activates a service immediately:
systemctl start foo.service
Deactivates a service immediately:
# force HTTP to HTTPS - /etc/nginx/conf.d/nonssl.conf | |
server { | |
listen 80; | |
server_name jira.example.com; | |
access_log off; | |
return 301 https://$server_name$request_uri; | |
} | |
# /etc/nginx/conf.d/jira.conf | |
server { |
[ | |
{ | |
"url": "http://money.cnn.com", | |
"rss": "http://rss.cnn.com/rss/money_topstories.rss" | |
}, | |
{ | |
"url": "http://thehill.com", | |
"rss": "http://thehill.com/rss/syndicator/19110" | |
}, | |
{ |
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) |
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): |
<VirtualHost _default_:443> | |
ServerName yourhost | |
ServerAdmin someperson@yourorg.com | |
SSLEngine on | |
SSLCertificateFile /etc/ssl/private/yourorg.com.crt | |
SSLCertificateKeyFile /etc/ssl/private/yourorg.com.key | |
SSLCertificateChainFile /etc/ssl/private/chain.pem | |
SSLProxyEngine On |
# 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 |
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()) |