start new:
tmux
start new with session name:
tmux new -s myname
from datetime import datetime, timedelta | |
from pytz import timezone | |
import pytz | |
utc = pytz.utc | |
# 如果有冬令时、夏令时切换,下面两个时间的时区偏移不相同(仅针对美国来说,其他地区酌情调整) | |
utc_dt = datetime(2017, 3, 23, 0, 0, 0, tzinfo=utc) | |
utc_dt2 = datetime(2017, 1, 1, 0, 0, 0, tzinfo=utc) | |
fmt = '%Y-%m-%d %H:%M:%S %Z%z' |
/* | |
https://aws.amazon.com/blogs/aws/amazon-elasticsearch-service-support-for-es-5-1/ | |
*/ | |
var AWS = require('aws-sdk'); | |
var path = require('path'); | |
//Object for all the ElasticSearch Domain Info | |
var esDomain = { | |
region: process.env.RegionForES, | |
endpoint: process.env.EndpointForES, |
# using D1 mini for example: | |
## Firmware | |
''' | |
esptool.py --port /dev/ttyUSB0 erase_flash | |
make PORT=/dev/ttyUSB0 FLASH_MODE=dio FLASH_SIZE=32m deploy | |
minicom -D /dev/ttyUSB0 -b 115200 | |
''' |
Install pidgin from source
$ sudo apt-get install build-essential intltool
$ sudo wget http://sourceforge.net/projects/pidgin/files/Pidgin/2.10.12/pidgin-2.10.12.tar.bz2
$ sudo tar -xjvf pidgin-2.10.12.tar.bz2
$ cd pidgin-2.10.12
$ sudo ./configure
# configure: error: GLib 2.16.0, run below command #
$ sudo apt-get build-dep pidgin
/* define constants */ | |
#define FOSC 11059000L // 11.059 MHz | |
// #define T1MS (65536-FOSC/1000) //1ms timer calculation method in 1T mode | |
#define T1MS_H 0xD4 | |
#define T1MS_L 0xCC | |
/* define variables */ | |
WORD count = 1000; //1000 times counter |
Base on Timer
import time
from threading import Timer
def on_time_handler(order_id=None, notify_url=None):
"""
https://docs.python.org/2/library/threading.html#threading.Timer
"""
批量修改git commit 记录。
git filter-branch --commit-filter '
if [ "$GIT_AUTHOR_EMAIL" = "[email protected]" ];
then
GIT_AUTHOR_NAME="wb.chn";
GIT_AUTHOR_EMAIL="[email protected]";
git commit-tree "$@";