Publish: January 25, 2021
Category: 计算机视觉
No Comments
我的python环境中缺少相关包,依次按缺少的资源安装。此处建议使用conda等应用版本管理工具管理,防止把自己的环境搞乱了。
一下安装过程中,优先使用清华源,失败情况下可以尝试使用阿里源和默认源,请根据自己的情况处理。
从github上克隆源码包,根据执行的错误提示,分别安装缺少的包。
git clone https://github.com/minivision-ai/photo2cartoon.git
安装过程可能遇到的错误处理
ModuleNotFoundError: No module named 'cv2'
# cv2
#使用清华源
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple opencv-python
#使用默认源
pip install opencv-python
tqdm
ModuleNotFoundError: No module named 'tqdm'
#tqdm
#使用清华源
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple tqdm
#使用默认源
pip install tqdm
face_alignment
ModuleNotFoundError: No module named 'face_alignment'
#face_alignment
#使用清华源
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple face_alignment
#使用默认源
pip install face_alignment
#ali
pip install -i http://mirrors.aliyun.com/pypi/simple/ face_alignment --trusted-host mirrors.aliyun.com
tensorflow
ModuleNotFoundError: No module named 'tensorflow'
pip install -i http://mirrors.aliyun.com/pypi/simple/ tensorflow --trusted-host mirrors.aliyun.com
阅读剩余部分...
Publish: January 19, 2021
Category: 编程
No Comments
Ios的无线调试是真的好用,几乎可以不用数据线的情况下完成大部分任务。那Android是否也可以使用无线调试呢?当然可以!
第一步
保证计算机网络和手机网络在同一网络下。将手机使用数据线连接上计算机USB,打开USB调试模式。等待驱动等各种准备工作完成,使用如下命令查看是否连接成功。
adb devices
#如果成功会返回如下内容
C:\Users\yinli>adb devices
adb server version (31) doesn't match this client (41); killing...
* daemon started successfully
List of devices attached
931c9033 device
阅读剩余部分...
Publish: January 18, 2021
Category: 运维
No Comments
现状
device_traffic 表所在的bucket已经设置了 Retention Policy 为 3d仍然整体的占用体积超过20G。tsm存储引擎文件过大严重超出预期,影响其他业务。通过简单分析主要是tsm文件过大,也就是说确实是存储的内容过多。
排查过程
通过简单分析,总体的思路是找到存储引擎位置,逐一分析具体是哪个bucket体积过大,然后分析原因。
在存储目录通过命令
cd /usr/local/influxdb/engine/data
du -sh ./*
逐一排查具体是哪个buckt所占的目录体积较大。目前来看是 “/” bucket体积特别大。“/”主要是influxdb系统相关的数据,并不会影响业务。
阅读剩余部分...
Publish: January 6, 2021
Category: 编程
No Comments
联通物联网卡平台提供了大部分管理能力。以新的“连接管理--蜂窝安全为例”,可以实现订单、设备、短信、通讯计划、账单用量、账户和资费计划管理。具体接口地址如下:
接口名 URL
API轮询APN https://gwapi.10646.cn/api/wsGetPollApn/V1/1Main/vV1.1
API账单查询 https://gwapi.10646.cn/api/wsGetInvoice/V1/1Main/vV1.1
API设备用量查询 https://gwapi.10646.cn/api/wsGetTerminalUsage/V1/1Main/vV1.1
API短信查询 https://gwapi.10646.cn/api/wsQuerySMS/V1/1Main/vV1.1
API短信详情查询 https://gwapi.10646.cn/api/wsQuerySMSDetail/V1/1Main/vV1.1
查询指定设备可用事件资费计划 https://gwapi.10646.cn/api/wsGetAvailableEvents/V1/1Main/vV1.1
API安吉星查询设备实时信息 https://gwapi.10646.cn/api/wsGetDeviceRealTimeInfo/V1/1Main/vV1.1
查询给定日期和时间后发生修改的设备 https://gwapi.10646.cn/api/wsGetModifiedTerminals/V1/1Main/vV1.1
返回一个或多个设备的通信计划 https://gwapi.10646.cn/api/wsGetNetworkAccessconfig/V1/1Main/vV1.1
查询设备最近某种属性的修改结果 https://gwapi.10646.cn/api/wsGetProvisioningStatus/V1/1Main/vV1.1
查询一个或多个设备的当前会话信息 https://gwapi.10646.cn/api/wsGetSessionInfo/V1/1Main/vV1.1
查询一个设备的变更记录详情 https://gwapi.10646.cn/api/wsGetTerminalAuditTrail/V1/1Main/vV1.1
查询指定设备关联的事件资费计划 https://gwapi.10646.cn/api/wsGetTerminalEvents/V1/1Main/vV1.1
返回给定设备的当前基本资费计划和所有排队资费计划 https://gwapi.10646.cn/api/wsGetTerminalRating/V1/1Main/vV1.1
返回与给定的一组设备IMSI对应的ICCID列表 https://gwapi.10646.cn/api/wsGetTerminalsByImsi/V1/1Main/vV1.1
返回与给定的一组设备MSISDN对应的ICCID列表 https://gwapi.10646.cn/api/wsGetTerminalsByMsisdn/V1/1Main/vV1.1
API返回给定设备在一个特定计费周期内发生的所有流量会话的相关信息 https://gwapi.10646.cn/api/wsGetTerminalUsageDataDetails/V1/1Main/vV1.1
API返回一个设备在某个特定计费周期内接到或拨打的所有通话呼叫的相关信息 https://gwapi.10646.cn/api/wsGetTerminalUsageGsmDetails/V1/1Main/vV1.1
API返回一个设备在某个特定计费周期内发出或收到的所有短信的相关信息 https://gwapi.10646.cn/api/wsGetTerminalUsageSmsDetails/V1/1Main/vV1.1
API查询设备最近某种属性的修改结果 https://gwapi.10646.cn/api/wsStatus/V1/1Main/vV1.1
修改迁移卡状态 https://gwapi.10646.cn/api/wsUpdateStatusMigrationSim/V1/1Main/vV1.1
API新建APN https://gwapi.10646.cn/api/wsCreateNewApn/V1/1Main/vV1.1
Japan离线计费APN维护接口 https://gwapi.10646.cn/api/wsUpdateJasperOfflineCharingAPN/V1/1Main/vV1.1
修改订单信息 https://gwapi.10646.cn/api/wsUpdateOrderInfo/V1/1Main/vV1.1
更新订单状态(更新参数) https://gwapi.10646.cn/api/wsUpdateOrderStatus/V1/1Main/vV1.1
API通过SIM卡ID批量发送短信 https://gwapi.10646.cn/api/wsSendBulkSms/V1/1Main/vV1.1
API通过MSISDN批量发送短信 https://gwapi.10646.cn/api/wsSendBulkSmsToMsisdn/V1/1Main/vV1.1
API通过SIM卡ID发送短信 https://gwapi.10646.cn/api/wsSendSms/V1/1Main/vV1.1
API通过MSISDN发送短信 https://gwapi.10646.cn/api/wsSendSmsToMsisdn/V1/1Main/vV1.1
为设备分配事件资费计划 https://gwapi.10646.cn/api/wsActivateTerminalEvent/V1/1Main/vV1.1
向设备队列的开头添加一个资费计划 https://gwapi.10646.cn/api/wsAddPlanInBeginQueue/V1/1Main/vV1.1
向设备队列的末尾添加一个资费计划 https://gwapi.10646.cn/api/wsAddPlanInLastQueue/V1/1Main/vV1.1
为特定设备取消预定事件 https://gwapi.10646.cn/api/wsDeleteTerminalEvent/V1/1Main/vV1.1
更改与给定设备相关联的通信计划 https://gwapi.10646.cn/api/wsEditNetworkAccessConfig/V1/1Main/vV1.1
为给定设备更改单个属性的值 https://gwapi.10646.cn/api/wsEditTerminal/V1/1Main/vV1.1
查询一个或多个设备详情 https://gwapi.10646.cn/api/wsGetTerminalDetails/V1/1Main/vV1.1
从设备队列中删除指定资费计划 https://gwapi.10646.cn/api/wsRemoveRatePlanFromQueue/V1/1Main/vV1.1
强制设备断开网络 https://gwapi.10646.cn/api/wsSendCancelLocation/V1/1Main/vV1.1
更改给定设备IP地址 https://gwapi.10646.cn/api/wsUpdateIpAddress/V1/1Main/vV1.1
API订单新建 https://gwapi.10646.cn/api/wsCreateOrderApi/V1/1Main/vV1.1
API新建或删除 https://gwapi.10646.cn/api/wsInsertOrDeleteAPI/V1/1Main/vV1.1
API查询测试 https://gwapi.10646.cn/api/wsSelectAPI/V1/1Main/vV1.1
编辑账户 https://gwapi.10646.cn/api/wsEditAcct/V1/1Main/vV1.1
新建账户 https://gwapi.10646.cn/api/wsNewAcct/V1/1Main/vV1.1
查询账户详情 https://gwapi.10646.cn/api/wsQueryAcctDet/V1/1Main/vV1.1
查询账户列表 https://gwapi.10646.cn/api/wsQueryAcctTable/V1/1Main/vV1.1
根据账户名查询账户ID https://gwapi.10646.cn/api/wsQueryIdbyName/V1/1Main/vV1.1
根据运营商账户名查询账户ID https://gwapi.10646.cn/api/wsQueryIdbyServiceProCode/V1/1Main/vV1.1
API可用事件资费计划查询 /api/query/eventplan/available/V1/1Main/vV1.1
API关联事件资费计划查询 /api/query/eventplan/terminal/V1/1Main/vV1.1
API分配事件资费计划 /api/operate/eventplan/activate/V1/1Main/vV1.1
API删除事件资费计划 /api/operate/eventplan/delete/V1/1Main/vV1.1
联通蜂窝网络物联网卡平台对接签名,PHP版本的签名算法
token签名,参与签名字段只有app_id timestamp trans_id
物联网卡签名算法描述
1.蜂窝安全API接口时参数分为鉴权参数和业务负载参数,
2.鉴权权参数各个接口相同,包括appid,timestamp,trans_id,token四个参数,
其中app_id为开通API功能时提供给企业用户,timestamp和trans_id的值由用户自行指定,token为签名字段,
其值是根据app_id,timestamp,trans_id三个参数的值,再加上提供给企业客户的app_secret值,四个值经过
加密算法计算得出,具体请参考《能力使用者接入指引 V2.7》中的sdk代码实现
{
"app_id":"XXXXXX",
"timestamp":"2018-12-05 10:23:35 649",
"trans_id":"XXXXXX",
"token":"XXXXXXXXXXXXXXXXXXXXXXXXX",
"data" :{
"messageId": "134536",
"openId": "xxxxxxxxxx",
"version": "1.0",
"iccids":["89860919720022503597"]
}
}
4.data中为业务负载参数,格式参考各个接口的接口文档
阅读剩余部分...
Publish: December 11, 2020
Category: 运维
No Comments
本文主要分享一个小技巧,如果你的环境中只有一个php版本,又想部署一个新的版本,但是又不想太繁杂,可以使用本文提供的一个简单方法。使用docker创建多PHP环境。
现有的物理环境版本如下,使用 php -v查看当前版本。
php -v
PHP 5.6.31 (cli) (built: Sep 6 2017 16:12:32)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
with Zend Guard Loader v3.3, Copyright (c) 1998-2014, by Zend Technologies
例子中我的PHP版本是5.6,整个基础软件环境使用的是LNMP架构,想提供一个新的PHP版本。这里采用的docker最基本的方式。
手动安装方式:
#手动方式运行php docker容器
docker run -idt --name=php7.2 \
--restart=always \
-p 9001:9000 \
-v /home/wwwroot/xxxx:/var/www/html \
-v /opt/server/php:/usr/local/etc/php php:7.2-fpm \
--link mysql8:docker_mysql8 \
/bin/bash \
#手动方式运行mysql docker容器
docker run -idt --name=mysql8\
--restart=always \
-p 3307:3306 \
-v /server/mysql:/var/lib/mysql \
-v /etc/localtime:/etc/localtime \
-e "MYSQL_ROOT_PASSWORD=xxxx" \
mysql:8.0
阅读剩余部分...
- 1
- 2
- 3
- 4
- ...
- 17
- NEXT »