This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
def filter_invalid_str(text): | |
""" | |
过滤非BMP字符 | |
""" | |
try: | |
# UCS-4 | |
highpoints = re.compile(u'[\U00010000-\U0010ffff]') | |
except re.error: | |
# UCS-2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[uwsgi] | |
prj_title = ProjectName | |
chdir = /data/%(prj_title)/src/ | |
home = /data/python/Envs/%(prj_title) | |
procname = %(prj_title) | |
chmod = 777 | |
socket = /tmp/%(prj_title).sock | |
wsgi-file = ./%(prj_title)/wsgi.py | |
processes = 4 | |
master = 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo logrotate -f /etc/logrotate.d/name | |
/data/*/log/*.log { | |
su root lsaint | |
daily | |
missingok | |
copytruncate | |
rotate 30 | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$template TimeMsgTemplate,"%TIMESTAMP:date-rfc3339%%msg%\n\r" | |
$template TagMsgTemplate,"%syslogtag%%msg%\n\r" | |
$template MsgTemplate,"%msg%\n\r" | |
if $programname == 'name1' then /data/name1/log/n1.log;TimeMsgTemplate | |
& ~ | |
if $programname == 'name2' then /data/name2/log/n2.log;MsgTemplate | |
& ~ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type Account struct { | |
balance float64 | |
deltaChan chan float64 | |
balanceChan chan float64 | |
errChan chan error | |
} | |
func NewAccount(balance float64) (a *Account) { | |
a = &Account{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// :CocInstall coc-python | |
// :CocInstall coc-tsserver | |
// :CocInstall coc-lua | |
// :CocInstall coc-java | |
{ | |
"coc.preferences.formatOnSaveFiletypes": ["python"], | |
"diagnostic.displayByAle": true, | |
"python.jediEnabled": false, |