2017年6月26日 星期一
Flask-Security example
References :
Flask-Security 如何Session CSRF和REST Token兼得 - 简书
Token Based Authentication with Flask-Security · Desi Penguin's Blog
2017年4月21日 星期五
Linux disabling blank screen
$ xset s off
$ xset -dpms
$ xset s noblank
References :
How to Disable the Blank Screen on Raspberry Pi (Raspbian) | HackLab
2017年4月19日 星期三
Arduino LowPower library Serial print 亂碼
Serial.flush();
LowPower.powerDown(SLEEP_1S, ADC_OFF, BOD_OFF);
2017年3月21日 星期二
ThingSpeak created_at to Python datetime
created_at is ISO 8601 format.
References :
How do I translate a ISO 8601 datetime string into a Python datetime object? - Stack Overflow
pythingspeak/thingspeak.py at master · ninjawil/pythingspeak
import dateutil.parser
yourdate = dateutil.parser.parse(datestring)
import datetime
datetime.datetime.strptime( "2007-03-04T21:08:12Z", "%Y-%m-%dT%H:%M:%SZ" )
References :
How do I translate a ISO 8601 datetime string into a Python datetime object? - Stack Overflow
pythingspeak/thingspeak.py at master · ninjawil/pythingspeak
2017年3月16日 星期四
InfluxDB enable Web UI
# vi influxdb/etc/config.sample.toml
Use environment variable:
$ vi docker-compose.yml
References :
influxdb/config.sample.toml at master · influxdata/influxdb
docker-influxdb-grafana/docker-compose.yml at master · nicolargo/docker-influxdb-grafana
[admin]
enabled = true
Use environment variable:
INFLUXDB_ADMIN_ENABLED=true
$ vi docker-compose.yml
influxdb:
image: influxdb:latest
container_name: influxdb
ports:
- "8083:8083"
- "8086:8086"
environment:
- INFLUXDB_ADMIN_ENABLED=true
volumes:
- ./influxdb:/var/lib/influxdb
References :
influxdb/config.sample.toml at master · influxdata/influxdb
docker-influxdb-grafana/docker-compose.yml at master · nicolargo/docker-influxdb-grafana
2017年1月2日 星期一
Supervisord on OpenWrt
# pip install supervisor
sample configuration file
# cp /usr/lib/python2.7/site-packages/supervisor/skel/sample.conf /etc/supervisord.conf
# vi /etc/init.d/supervisor
#!/bin/sh /etc/rc.common# chmod u+x /etc/init.d/supervisor
#
# AUTHOR: Takumi Sueda
#
# Start/stop/restart supervisor in OpenWrt. START=91 USE_PROCD=0
PROG=/usr/bin/supervisord DAEMON=${PROG} # Location of the pid file
PIDFILE=/tmp/supervisord.pid # Config of supervisor
CONFIG=/etc/supervisord.conf start_service()
{
# $DAEMON -c $CONFIG -j $PIDFILE
procd_open_instance
procd_set_param command $PROG -c $CONFIG -j $PIDFILE
procd_set_param respawn
procd_close_instance
touch $CONFIG
} stop_service()
{
kill $(cat $PIDFILE)
}
# /etc/init.d/supervisor start
開機自動啓動
# cd /etc/rc.d
# ln -s ../init.d/supervisor S99supervisor
開機自動啓動
# cd /etc/rc.d
# ln -s ../init.d/supervisor S99supervisor
fatal error: libxml/xmlversion.h: No such file or directory
# apt-get install libxml2-dev libxslt1-dev
訂閱:
文章 (Atom)