自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(53)
  • 资源 (1)
  • 收藏
  • 关注

原创 golang.org/x/sys timeout 解决方式

go: golang.org/x/[email protected]: unrecognized import path "golang.org/x/sys" (https fetch: Get https://golang.org/x/sys?go-get=1: dial tcp 216.239.37.1:443: i/o timeout)go: g...

2019-10-08 19:26:47 3576 1

原创 freeswitch sipml5 实现网页即时通讯 踩坑

源代码:https://github.com/lishulongVI/freeswitch一、docker 部署 预备内容 sipml5 GitHub : https://github.com/DoubangoTelecom/sipml5 freeswitch GitHub:https://github.com/BetterVoice/freeswitch...

2019-09-27 12:05:47 3008 1

原创 xgboost 缺少依赖导致的安装不成功,试试这个

ERROR: Complete output from command python setup.py egg_info: ERROR: rm -f -rf build build_plugin lib bin *~ */*~ */*/*~ */*/*/*~ */*.o */*/*.o */*/*/*.o xgboost clang-omp++ -std=c++0x -W...

2019-07-01 11:57:00 2077

原创 OSError: mysql_config not found || Exception: Wrong MySQL configuration:

pip install mysqlclientOSError: mysql_config not foundFile "<string>", line 1, in <module> File "/private/var/folders/qw/y81w55mx5d3gx8rlzy09yvfh0000gn/T/pip-install-h2htc37w/mysqlc...

2019-07-01 11:47:38 573

原创 flask + gunicorn + pipenv + supervisor + nginx

flask + gunicorn + pipenv + supervisor + nginx# gunicorn + pipenv + supervisor + flask[program:diudiudiu]command=pipenv run gunicorn --workers=4 --bind=0.0.0.0:3601 server:appdirectory=/root...

2019-06-24 22:27:42 300

原创 scrapyd 问题 builtins.AttributeError: 'int' object has no attribute 'splitlines'

错误提示web.Server Traceback (most recent call last):builtins.AttributeError:'int' object has no attribute 'splitlines'回退版本Scrapy==1.6.0 Twisted==18.9.0

2019-04-21 12:43:39 6113 6

原创 python 2 vs python3

python 2 python3 ValueError: cannot convert float NaN to integer python2 vs python3 AttributeError: 'unicode' object has...

2019-04-09 19:05:47 248

原创 Py

python 动态声明变量 并赋值 dict、set 或 list 的 in 运算符效率

2019-04-08 18:50:24 144

原创 python 中 list 是否是线程安全的?

是不是不共享数据就不会发生线程不安全?线程安全就是多线程访问时,采取了加锁的机制,当一个线程访问该类的某个数据时,进行保护,其他线程不能进行访问知道该线程读取完,其他的线程才可使用,不会出现数据不一致或数据污染的问题线程不安全就是不提供数据访问保护,有可能出现多个线程现后更改数据造成所得到的数据是脏数据。总的来说,只要线程之间没有共享资源,那么就是线程安全的,有共享资源,为了保证线...

2019-03-18 23:16:28 7307

原创 dev warning python

一、服务调用1. 判断是否需要重试(retring);2. 设置超时时间;3. 对状态码进行判断;4. 对于异常!200的处理,具体业务具体分析,不论是向上抛出还是内部消费,异常日志收集都是必要的5. 后期日志的分析。处理异常,判断是上游的问题还是入参问题...二、新开发服务1. 超时时间 压测(并发跑批)得出 报告2. 是否有负载,有的话 nginx:connect ...

2019-03-18 23:02:38 156

原创 pip 镜像源

lishulongdeMacBook-Pro:~ lishulong$ cat ~/.pip/pip.conf [global]index-url = https://pypi.tuna.tsinghua.edu.cn/simple#[global]extra-index-url = http://pypi.douban.com/simple #豆瓣源,可以换成其他的源trusted...

2019-03-18 23:01:46 187

原创 spring cloud data flow 调研

# Spring Cloud 相关库设计了Spring Initializr的特别版本https://start-scs.cfapps.io/Demohttps://www.baeldung.com/spring-cloud-data-flow-etl代码实现https://github.com/eugenp/tutorials/tree/master/spring-cloud...

2019-03-17 09:54:33 1669

原创 docker quick start

1、镜像命令修改镜像源地址/etc/docker/daemon.json显示12位镜像IDdocker images -qa显示镜像IDdocker images --digests显示镜像说明docker images --no-trunc现实start &gt;= 30docker search -s 30 tomcat...

2019-02-28 11:21:09 381

原创 spring cloud data flow

* 全部操作都在统一目录下  1、下载docker-composewget https://raw.githubusercontent.com/spring-cloud/spring-cloud-dataflow/v1.7.3.RELEASE/spring-cloud-dataflow-server-local/docker-compose.yml   2、执行命令...

2019-02-25 19:14:05 572

原创 pymongo beson binary 存储

痛点:由于在python中使用numpy 进行数据操作的时候需要转换成mongo的数据类型,才能进行存储,在使用的时候再取出 转换成numpy的数据类型 作为模型的入参。这样中间多做了一层转换,而且numpy类型有24种,很难每个都判断做转换。解决方案:为了不影响模型的入参,我们使用pickle存储成二进制 ,使用的时候进行转换。以二进制的方式存储。# -*- coding: utf...

2019-01-30 14:14:07 486

原创 gevent debug in pycharm

 error:Exception ignored in: '_pydevd_frame_eval.pydevd_frame_evaluator.get_bytecode_while_frame_eval' 解决方式:

2019-01-09 10:41:18 1256

原创 explicit_defaults_for_timestamp

airflow initdb :出现异常:Exception: Global variable explicit_defaults_for_timestamp needs to be on (1) for mysql 解决方式:https://airflow.readthedocs.io/en/stable/faq.html#how-to-fix-exception-global-...

2018-10-31 10:49:45 4928

原创 pip install apache-airflow[all]

 pip install apache-airflow[all]  src/kerberosbasic.h:17:10: fatal error: gssapi/gssapi.h: No such file or directory     #include &lt;gssapi/gssapi.h&gt;              ^~~~~~~~~~~~~~~~~    ...

2018-10-29 15:29:05 1973

原创 docker install jenkins

docker run -p 8180:8080 -v /data/soft/jenkins:/var/jenkins_home --name jenkins_c -d jenkins  touch: cannot touch '/var/jenkins_home/copy_reference_file.log': Permission deniedCan not write to ...

2018-10-28 23:00:15 161

原创 grafana + slack (配置)

 

2018-08-04 10:32:07 1373

原创 linux常用命令(不断更新)

1、下载对应文件夹下的所有文件scp -r [email protected]:/data/notebooks/test/file/s ./file/s

2018-07-11 18:21:36 2407

原创 如何使用两个SIM 注册多个wechat(此为保号操作)

操作步骤: 1. 拥有SIM 两个 A,B 2. 使用A 注册一个C账号,修改微信号ID,记住密码 3. 使用B 注册一个D账号,修改微信号ID,记住密码 4. 在注册完成后打开B所在wechat的设置=&amp;amp;amp;gt;账号与安全 5. 看到手机号选项点击 选择更换手机号码 填入A 等待验证 6. 验证通过后,我们就拥有了C(无手机号),D(有手机号 A)这个账号 7. 此刻我们就可以使用B...

2018-07-05 14:33:39 638

原创 Python 操作 AWS S3

详情https://boto3.readthedocs.io/en/latest/reference/services/s3.htmpip install boto3 == 1.6.12#### pip install boto3==1.6.12-- coding: utf-8 --“”” @contact: [email protected] ...

2018-07-05 11:32:26 4765

原创 metabase pulse mongo 踩坑

预备知识(gitHub) 详细的文档 https://www.metabase.com/start/docker.html 非常简洁的操作和丝滑的UI界面(对产品/运营同学更友好) 配置邮件 LDAP 权限管理:有组有用户,可以控制表和读写 安装/备份/升级/迁移 都很简单(支持docker、一个jar文件……) 1、pulse 使用 使用定时发送的时候 需要设置下...

2018-06-15 13:00:04 1480 3

原创 pymongo 如何处理异常 AutoReconnect ,防止数据丢失

Retrying Tutorial在使用pymongo的时候 ,自带的线程池 存在 连接失效raise AutoReconnect(&quot;connection closed&quot;)解决方式,加入retry 防止丢失数据from pymongo.errors import AutoReconnectdef retry_if_auto_reconnect_error(exc...

2018-06-11 12:44:03 6067

翻译 python 安装包镜像源切换

在根目录下 创建.pip 文件夹在文件夹下创建pip.conf文件lishulongdeMBP:.pip lishulong$ view pip.conf  1 [global]  2 index-url=http://mirrors.aliyun.com/pypi/simple/  3 [install]  4 trusted-host=mirro

2018-05-03 22:33:36 1236

原创 写mongo语句不再是你的障碍

mongobooster//double quotes quote object names (e.g. "collection"). Single quotes are for strings 'string'.mb.runSQLQuery(`SELECT * FROM "undefined"`)//.explain();

2018-04-26 19:11:06 437 1

原创 在jupyter 上 增加内核(bash_kernel)

在jupyter 上 增加内核(bash_kernel)pip install bash_kernelpython -m bash_kernel.install

2018-04-25 12:49:16 2102

原创 搭建jupyter服务器

ubuntu@py-model01br-p002:~$ conda -Vconda 4.3.30ubuntu@py-model01br-p002:~$ lsanaconda3 Anaconda3-5.0.1-Linux-x86_64.sh nohup.outubuntu@py-model01br-p002:~$ cd /opensource/ubuntu@py-model01br-p...

2018-04-15 12:02:56 793

原创 在jupyter notebook中安装第三方包(卸载、查看)

在jupyter中安装卸载查看第三方包import pipdef pip_install(package): pip.main(['install', package])def pip_list(): pip.main(['list'])def pip_uninstall(package): pip.main(['uninstall', package])...

2018-04-15 11:56:44 18096 1

翻译 Docker 中国官方镜像加速

Docker 官方镜像加速

2018-03-28 15:32:13 227

原创 tornado

如何理解tornado作为webserver,采用的是asynchronous IO的网络模型,很高效的模型简单的python框架,url基于正则,有自己的模板实现没有orm 类似于web.py非阻塞异步io,类似于nodejsweb framework,可以直接构建自己的web程序支持WSGI(python web server gateway interface)可以和其他一些...

2018-03-12 15:53:42 401 1

原创 zookeeper

zookeeperhttps://mirrors.tuna.tsinghua.edu.cn/apache/zookeeper/选择自己需要的版本下载配置注意点(修改和添加)1、dir2、port3、myidcheckroot@never-PAF4:/data/zookeeper_cluster# ./zookeeper03/bin/zkServer.sh ...

2018-03-12 14:57:35 254

原创 canal(mysql数据库 binlog的增量订阅,消费组件)

环境准备1、jdk 环境变量配置vim /etc/profileexport JAVA_HOME=/root/data/jdk/jdkexport PATH=$JAVA_HOME/bin:$PATHsource /etc/profile2、jdk配置校验root@never-PAF4:~# date2018年 03月 11日 星期日 00:00:30...

2018-03-12 14:55:23 2768

原创 ubuntu 如何更换适合自己版本的镜像源

0、get Codenameroot@ubuntu:/home/lishulong# lsb_release -aNo LSB modules are available.Distributor ID: UbuntuDescription: Ubuntu 17.10Release: 17.10Codename: artfulroot@ubuntu:/home/l

2018-02-07 15:59:52 5426

原创 linux 常用命令 ubuntu

查看tcp通信状态netstat -n | awk '/^tcp/ {++y[$NF]} END {for(w in y) print w, y[w]}'查看某个端口的链接情况netstat -n | grep 9090 | wc -lapt install htophtop# 总核数 = 物理CPU个数 X 每颗物理CPU的核数 # 总逻辑CPU

2018-01-30 10:45:26 170

原创 docker run prometheus and grafana

详细使用情况nodehttps://github.com/siimon/prom-client/blob/master/README.mdjavahttps://github.com/prometheus/client_java/blob/master/README.mdprometheus 效果查看grafana 效果查看0、spring boot metrics...

2018-01-19 13:09:58 485 2

原创 mongo语句误区

mongo语句的误区1、关于语句条件语句{a,b,c} a and b and c 的解释当a,b的条件字段相同的时候 后者会覆盖掉前者区间条件db.demo.find({ "date": { $gte: ISODate("2017-12-01") }, 'date': { $lte: ISODate("2018-

2018-01-16 14:35:00 406

原创 python 垃圾回收 GC

一. 小整数对象池(常驻内存)整数在程序中使用广泛,Python为了优化速度,使用了小整数对象池,避免为整数频繁申请和销毁内存空间。Python对小整数的定义是[-5,257) 左闭右开 这些整数对象是提前建立好的,不会被回收,在一个Python程序中,所有位于这个范围内的整数使用的都是同一个对象。同理,单个字母也是这样的,但是当定义2个相同的字符串时,引用计数为0,触发垃圾回收。

2018-01-10 12:21:28 1403

翻译 互联网业务反欺诈

互联网业务欺诈

2017-12-22 14:35:32 2713

设计模式之单例

单例的三种实现方式,详细的注释,预备知识

2015-07-11

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除