- 博客(160)
- 资源 (3)
- 收藏
- 关注
原创 监控软件---Newrelic
newrelic: 可以监控web请求,数据库等,支持Python,Java,React等。Python + uwsgi + supervisordhttps://docs.newrelic.com/docs/agents/python-agent/installation/standard-python-agent-install其中第4步的启动,我们配置在supervisord里。[program:etable-webserver]user = ibdwebprocesscommand =
2020-08-03 18:07:54
478
原创 UWSGI config
socket = 127.0.0.1:8071master = trueprocesses = 4; API 超时时间harakiri = 60harakiri-verbose = truelimit-post = 65536post-buffering = 8192;disable request log disable-logging = true;logto = /opt/log/uwsgi-icom.loglogger = file:logfile=/opt/log/uwsg.
2020-07-10 14:42:44
498
1
原创 nmp install websocket-bench permission denied
sudo npm install -g websocket-bench --registry=http://registry.npm.taobao.orgError:gyp ERR! configure errorgyp ERR! stack Error: EACCES: permission denied, mkdir '/usr/lib/node_modules/websocket...
2019-11-22 18:16:12
356
原创 Linux 查看数据库驱动 & pyodbc
vi /etc/odbcinst.ini[MySQL]Description=ODBC for MySQLDriver=/usr/lib/libmyodbc5.soSetup=/usr/lib/libodbcmyS.soDriver64=/usr/lib64/libmyodbc5.soSetup64=/usr/lib64/libodbcmyS.soFileUsage=1[OD...
2019-06-13 11:34:24
2240
原创 uwsgi 启动pyramid项目 不打印log
# pyramid dev.ini 配置文件[loggers]keys = root, etable_api, sqlalchemy[handlers]keys = console, infolog, debuglog, warnlog[formatters]keys = generic[logger_root]level = WARNhandlers = warnlo...
2019-04-30 10:39:17
734
原创 sudo: sorry, you must have a tty to run sudo
gitlab-ci 运行sudo命令时出错:$ sudo cp deploy/config/stage.ini /etc/ibd-research-tool.inisudo: sorry, you must have a tty to run sudo解决:sudo vi /etc/sudoers# Disable "ssh hostname sudo <cmd>...
2019-02-20 10:54:14
430
原创 nginx 使用 service nginx start 启动失败
问题:sudo service nginx start启动失败解决:# 查看 SELinux 的状态$ /usr/sbin/sestatusSELinux status: disabled# 将SELINUX=enforcing 修改为 SELINUX=disabled$ sudo vi /etc/selinux/config# Th...
2019-01-10 10:12:33
7696
原创 Pyramid 捕获异常日志 Exception log
def main(global_config, **settings): """ This function returns a Pyramid WSGI application.""" config = Configurator(settings=settings) config.add_forbidden_view(http_response.forbidden...
2018-11-23 15:30:25
328
原创 Python log 重复问题
问题: log = logging.getLogger(__name__) 使用log打印日志的时候,会打印两遍日志。原因: loggers对象是有父子关系的,当没有父logger对象时它的父对象是root,当拥有父对象时父子关系会被修正。举个例子,logging.getLogger("abc.xyz") 会创建两个logger对象,一个是abc父对象,一个是xyz子对象,...
2018-11-23 13:28:47
1262
原创 nginx + uwsgi 部署 django 400错误
访问url会报400错误原因:项目的setting里面的ALLOWED_HOSTS = ['*',]
2018-07-03 09:59:55
2042
原创 nginx + uwsgi 部署Django项目
版本说明:nginx version: nginx/1.10.3 (Ubuntu)uWSGI (2.0.17)Django (1.8.2)1、安装uwsgipip install uwsgi2、配置uwsgi 创建新建文件everyday-uwsgi.ini ,将项目的uwsgi配置文件放在 /etc/uwsgi-ini/[uwsgi]# 使用nginx连接时,使用socketsock...
2018-07-02 20:48:27
315
原创 百度云不限速客户端让你获取SVIP速度
原地址:https://bbs.feng.com/forum.php?mod=viewthread&tid=11604132&page=11. 下载浏览器插件 链接: https://pan.baidu.com/s/1WjIZPRPs-bHlT3-PHJgOJQ 密码: qcim2. 安装Downloader客户端3. 打开自己的百度网盘 ,并选中下载的文件点击高速下载。4....
2018-05-31 19:27:36
48618
2
原创 mysql OperationalError(2013, 'Lost connection to MySQL server during query')
原因:在查询的过程中与mysql服务器失去连接解决:1. 查看max_allowed_packet的值,尽量将其然后改得尽量大一些mysql> show global variables like 'max_allowed_packet';+--------------------+-----------+| Variable_name | Value |+-----...
2018-05-31 10:26:41
5053
原创 安装pip 出现 resources.DistributionNotFound 'pip==7.1.0' 'distribute==0.6.0'
pkg_resources.DistributionNotFound: The 'pip==7.1.0' distribution was not found and is required by the application1. 安装 1. 将 pip-9.0.1-py2.7.egg 拷贝到 /usr/local/python2.7/lib/python2.7/site-packages...
2018-03-12 13:57:11
4650
转载 timestamp也可以直接被转换到UTC标准时区的时间
注意到timestamp是一个浮点数,它没有时区的概念,而datetime是有时区的。上述转换是在timestamp和本地时间做转换。本地时间是指当前操作系统设定的时区。例如北京时区是东8区,则本地时间:2015-04-19 12:20:00实际上就是UTC+8:00时区的时间:2015-04-19 12:20:00 UTC+8:00而此刻的格林威治标准时间与北京时间差了8小时,也就是UTC+...
2018-03-05 17:55:59
18156
转载 OrderedDict 有序字典以及读取json串时如何保持原有顺序
1. OrderedDict 有序字典OrderedDict是dict的子类,它记住了内容添加的顺序。比较时,OrderedDict要内容和顺序完全相同才会视为相等import collections d = collections.OrderedDict() d[3] = 'A' d[2] = 'B' d[1] = 'C' for k, v in d.i
2018-01-13 14:25:02
1459
转载 python模块以及导入出现ImportError: No module named 'xxx'问题
python中,每个py文件被称之为模块,每个具有__init__.py文件的目录被称为包。只要模块或者包所在的目录在sys.path中,就可以使用import 模块或import 包来使用如果你要使用的模块(py文件)和当前模块在同一目录,只要import相应的文件名就好,比如在a.py中使用b.py: import b 但是如果要import一个不同目录的文件(例如b.
2018-01-01 15:24:35
20872
转载 scrapy 一次性提取多层嵌套标签的所有文本
怎样才能一次性提取多层嵌套标签的所有文本,而不是通过循环判断来进行拼接呢。详细如下:假如页面如下:helloworld!我要的提取结果是:helloworld!这里就需要注意text()的使用了:首先设置sel = Selector(text=doc, type='html')#如果text()前面使用一个反斜杠:sel.xpath("/
2017-12-18 17:17:35
1196
转载 fiddler网络调试神器(前端)——擦肩而过
fiddler网络调试神器(前端)——擦肩而过发表于2017/5/22 17:38:53 785人阅读转自:http://shalles.github.io/blog/tools/fiddler/2015/02/08/tools-fiddler-profile08 February 2015##Web Debugging 支持基于windowsPC端windo
2017-12-17 01:07:20
499
转载 Python单例模式的4种实现方法
#-*- encoding=utf-8 -*- print '----------------------方法1--------------------------' #方法1,实现__new__方法 #并在将一个类的实例绑定到类变量_instance上, #如果cls._instance为None说明该类还没有实例化过,实例化该类,并返回 #如果cls._instance不为
2017-12-11 14:51:05
261
转载 windows环境下永久修改pip镜像源的方法
一、在windows环境下修改pip镜像源的方法(以python3.5为例)(1):在windows文件管理器中,输入 %APPDATA%(2):会定位到一个新的目录下,在该目录下新建pip文件夹,然后到pip文件夹里面去新建个pip.ini文件(3):在新建的pip.ini文件中输入以下内容,搞定文件路径:"C:\Users\Administrator\AppData\Roami
2017-11-23 11:53:43
32254
原创 协程、同步异步、并发、并行、rabbitmq、分布式任务队列
http://www.rabbitmq.com/install-windows.htmlhttp://www.erlang.org/downloadshttp://www.cnblogs.com/yangh965/p/5862347.htmlhttp://docs.jinkan.org/docs/celery/getting-started/first-steps-with-celer
2017-11-23 11:51:16
2965
原创 ImproperlyConfigured at /exam/selfdo/save_result
错误:ImproperlyConfigured at /exam/selfdo/save_resultThe included urlconf '5' does not appear to have any patterns in it. If you see valid patterns in the file then the issue is probably caused by a
2017-11-20 20:08:27
746
转载 在django models中取得一个字段的distinct值
就是select distinct xxx from table_name ...这样的功能很简单,代码如下xxxx.objects.values("field_name").distinct()#或者xxxx.objects.distinct().values("field_name") 这两句实际生成的sql都一样。django 的models框架,看起来算是
2017-11-16 21:54:56
3757
原创 xpath取出指定多标签内所有文字text
# coding=utf-8import requestsfrom lxml import etreeurl = 'http://sou.zhaopin.com/jobs/searchresult.ashx?jl=北京&kw=京东&sm=0&p=1'headers = { 'User-Agent':'Mozilla/5.0 (Windows NT 6.1; Win64; x64
2017-10-27 11:49:22
7454
转载 python处理excel
python高手之路python处理excel文件(方法汇总)原文地址:http://www.jb51.net/article/77626.htm用python来自动生成excel数据文件。python处理excel文件主要是第三方模块库xlrd、xlwt、xluntils和pyExcelerator,除此之外,python处理excel还可以用win32com和openpyx
2017-10-26 15:35:06
1080
转载 url 特殊符号
url出现了有+,空格,/,?,%,#,&,=等特殊符号的时候,可能在服务器端无法获得正确的参数值,如何是好?解决办法将这些字符转化成服务器可以识别的字符,对应关系如下:URL字符转义用其它字符替代吧,或用全角的。+ URL 中+号表示空格 %2B 空格 URL中的空格可以用+号或者编码
2017-10-26 09:49:06
1770
转载 利用jquery.fly实现仿淘宝购物车飞入特效
利用jquery.fly实现仿淘宝购物车飞入特效标签: 淘宝网javascriptjquery-fly购物车飞入特效分类: 常用插件(3) 作者同类文章X•require.js实现单页web应用(SPA)•jquery-pager的基本使用及与ajax结合使用实战演示•JS模板引擎-腾讯artTemplate 最全
2017-10-15 21:32:35
1494
转载 jquery禁用a标签,jquery禁用按钮click点击
jquery禁用a标签方法1$(document).ready(function () { $("a").each(function () { var textValue = $(this).html(); if (textValue == "XX概况" || textValue == "服务导航") {
2017-10-14 09:38:25
1779
转载 怎样用JS实现关闭当前窗口
1、 不带任何提示关闭窗口的js代码关闭2、自定义提示关闭// 这个脚本是 ie6和ie7 通用的脚本function custom_close(){if (confirm("您确定要关闭本页吗?")){window.opener=null;window.open('','_self');window.close();}else{}}
2017-10-12 14:46:49
29881
原创 JSONP 跨域读取数据
由于浏览器同源策略,凡是发送请求url的协议、域名、端口三者之间任意一与当前页面地址不同即为跨域。src:可以跨域所以img 和 script 标签可以实现跨域跨域读取数据1.在本域下请求一个别的域名下的js,这个js会返回一些数据,可以在本域上获取,使用。2.通过添加标签来实现跨域。实现://百度搜索js请求响应:jQuery11020151400
2017-10-11 22:18:05
878
原创 跨域请求:查询天气
跨域请求2 //weatherinfovar:郑州天气 chinaWeaInfo:全国天气 console.log(weatherinfovar); //获取各省会城市的cityid 和 name,并转换为json对象 var cityidinfo ="{"; $.each(c
2017-10-11 21:02:33
568
转载 JSONP原理
var eleScript= document.createElement("script");eleScript.type = "text/javascript";eleScript.src = "http://example2.com/getinfo.php";document.getElementsByTagName("HEAD")[0].appendChild(eleScript);
2017-10-11 17:43:05
202
转载 URL后面加随机数
1:在ajax或者dwr提交的url后面加时间戳。 例如 http_request.onreadystatechange = funcName; http_request.open("GET", url, true); 比如url是test .jsp 那么我们在它后面加上?time=new Date();即url=test.jsp?time=new Date();
2017-10-11 16:03:26
14911
原创 Python---序列化
https://www.liaoxuefeng.com/wiki/0014316089557264a6b348958f449949df42a6d3a2e542c000/00143192607210600a668b5112e4a979dd20e4661cc9c970001.概念 序列化:把变量从内存中变成可存储或传输的过程.在Python中叫做pickling 反序列化
2017-10-09 09:50:19
446
原创 Linux 查找文件或命令
1. sudo find / -name 查找内容(可使用通配符) 1、查看virtualenvwrapper的安装路径sudo find / -name virtualenvwrapper.sh#/usr/share/virtualenvwrapper/virtualenvwrapper.sh2. which 命令:查看命令的位置 2. 查看pyt
2017-10-07 17:39:43
272
原创 连接mysql
1. 虚拟环境中安装mysql包pip3 install pymysql2. 在mysql中创建数据库create databases test2 charset=utf83. 打开settings.py文件,修改DATABASES项DATABASES = { 'default': { 'ENGINE': 'django.db.backend
2017-10-07 16:48:18
214
xpath helper 谷歌浏览器插件
2018-05-31
利用jquery.fly实现仿淘宝购物车飞入特效
2017-10-15
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人