Skip to content

Instantly share code, notes, and snippets.

View openresty.conf
worker_processes 1;
error_log logs/error.log;
events {
worker_connections 1024;
}
http {
server {
View uliweb_test_client.py
import os
from uliweb import manage, models
from uliweb.manage import make_simple_application
os.chdir('demo')
manage.call('uliweb syncdb -v')
manage.call('uliweb dbinit -v')
def test_apijson_get():
View updatentp.py
import os
import time
import ntplib
c = ntplib.NTPClient()
response = c.request('pool.ntp.org')
ts = response.tx_time
_date = time.strftime('%Y-%m-%d',time.localtime(ts))
_time = time.strftime('%X',time.localtime(ts))
os.system('date {} && time {}'.format(_date,_time))
@zhangchunlin
zhangchunlin / batch_qpdf.py
Last active Jan 23, 2020
batch_qpdf.py 批量移除 pdf 密码脚本,batch remove pdf password
View batch_qpdf.py
#!/usr/bin/env python
#coding=utf-8
from __future__ import print_function
import os
import sys
def main():
dpath_in = os.path.expanduser(r"~/1del/")
dpath_out = os.path.expanduser(r"~/1delt/")
View vuejs_in_uliweb.html
{{use "ui.vue"}}
<div id="app">
</div>
<script>
var app = new Vue({
el: '#app',
data: {
@zhangchunlin
zhangchunlin / command.py
Created Jan 3, 2018
python command line file template
View command.py
#!/usr/bin/env python
from __future__ import print_function
def main():
pass
if __name__=='__main__':
main()
@zhangchunlin
zhangchunlin / emojis.json
Created Dec 18, 2017 — forked from oliveratgithub/emojis.json
Emoji-list with emojis, names, shortcodes, unicode and html entities [massive list]
View emojis.json
{
"emojis": [
{"emoji": "👩‍👩‍👧‍👧", "name": "family_mothers_two_girls", "shortname": "", "unicode": "", "html": "&#128105;&zwj;&#128105;&zwj;&#128103;&zwj;&#128103;", "category": "p", "order": ""},
{"emoji": "👩‍👩‍👧‍👦", "name": "family_mothers_children", "shortname": "", "unicode": "", "html": "&#128105;&zwj;&#128105;&zwj;&#128103;&zwj;&#128102;", "category": "p", "order": ""},
{"emoji": "👩‍👩‍👦‍👦", "name": "family_mothers_two_boys", "shortname": "", "unicode": "", "html": "&#128105;&zwj;&#128105;&zwj;&#128102;&zwj;&#128102;", "category": "p", "order": ""},
{"emoji": "👨‍👩‍👧‍👧", "name": "family_two_girls", "shortname": "", "unicode": "", "html": "&#128104;&zwj;&#128105;&zwj;&#128103;&zwj;&#128103;", "category": "p", "order": ""},
{"emoji": "👨‍👩‍👧‍👦", "name": "family_children", "shortname": "", "unicode": "", "html": "&#128104;&zwj;&#128105;&zwj;&#128103;&zwj;&#128102;", "category": "p", "order": ""},
{"emoji": "👨‍👩‍👦‍👦", "name": "family_two_biys", "shortname": "", "unicode": "", "html": "&#128104;&zw
View run_subprocess.py
from subprocess import Popen, PIPE, STDOUT
import os
def runcmd(cwd,cmd):
oldcwd = os.getcwd()
os.chdir(cwd)
runcmd_timeout = 3600
p = Popen(cmd,stdout=PIPE,stderr=STDOUT,shell=True,preexec_fn=os.setpgrp)
p.wait(runcmd_timeout)
if p.returncode==None:
@zhangchunlin
zhangchunlin / nginx.conf
Created May 9, 2017
nginx.conf , openresty, redirect, ip
View nginx.conf
worker_processes 1;
error_log logs/error.log;
events {
worker_connections 1024;
}
http {
server {
listen 6699;
location / {
@zhangchunlin
zhangchunlin / time_strftime.py
Last active Feb 16, 2017
time and strftime
View time_strftime.py
import time
tstr = time.strftime("%Y-%m-%d %H:%M:%S",time.localtime(time.time()))
print tstr
You can’t perform that action at this time.