View huginn_wechat_public_subscribers_v2.json
{ | |
"schema_version": 1, | |
"name": "微信公众号订阅【第二版只有最新的一篇文章】", | |
"description": "2019.08.03 更新,最新可用", | |
"source_url": false, | |
"guid": "a0be876a712baf52fa4270d6b174443a", | |
"tag_fg_color": "#ffffff", | |
"tag_bg_color": "#00b050", | |
"icon": "eye", | |
"exported_at": "2019-08-03T10:05:30Z", |
View huginn_wechat_public_subscribers.json
{ | |
"schema_version": 1, | |
"name": "微信公众号订阅", | |
"description": "2019.08.01 更新,最新可用", | |
"source_url": "http://104.224.190.22:3000/scenarios/8/export", | |
"guid": "c0be876a712baf52fa4270d6b1744432", | |
"tag_fg_color": "#ffffff", | |
"tag_bg_color": "#00b050", | |
"icon": "eye", | |
"exported_at": "2019-08-01T08:46:10Z", |
View aliyun_sms_api.py
import base64 | |
import datetime | |
import hashlib | |
import hmac | |
import json | |
import urllib.parse | |
import uuid | |
access_key_id = '' | |
access_secret = '' |
View nginx.conf
server { | |
listen 80; | |
listen 443 ssl; | |
server_name your-domain.com; | |
charset utf-8; | |
client_max_body_size 32M; | |
root /project/static; | |
index index.html; |
View channels.py
def handle(self, *args, **options): | |
redis = get_redis_connection() | |
ps = redis.pubsub() | |
ps.subscribe([RELAY_CONTROL_RESULT_CHANNEL]) | |
for item in ps.listen(): | |
if item['type'] == 'message': | |
data = item['data'] | |
equipment_id, return_state = data.decode('ascii').split(':') | |
# equipment_id is group name |
View lsyncd.service
[Unit] | |
Description=Live Syncing (Mirror) Daemon | |
After=network.target | |
[Service] | |
Restart=always | |
Type=simple | |
Nice=19 | |
#EnvironmentFile=-/etc/default/lsyncd | |
#ExecStart=/usr/bin/sh -c 'eval `/usr/bin/lsyncd -nodaemon $LSYNCD_OPTIONS /etc/lsyncd/lsyncd.conf.lua`' |
View log.py
import os | |
import logging | |
import logging.handlers | |
def init_log(log_path, level=logging.INFO, when="D", backup=7, | |
format="%(levelname)s: %(asctime)s: %(filename)s:%(lineno)d * %(thread)d %(message)s", | |
datefmt="%m-%d %H:%M:%S"): | |
""" | |
init_log - initialize log module |
View file_lock.py
#coding: utf-8 | |
import os | |
import time | |
import fcntl | |
import contextlib | |
import logging | |
@contextlib.contextmanager | |
def open_file(filename, pattern = 'r', timeout = 5): | |
""" 以加锁的方式读取文件,尝试timeout * 10 次,每次sleep 1秒钟. |