访问项目主页
使用NodeJS、mosca模块搭建本地HTTPS和MQTT服务器,并在微信小程序中测试连接服务器。Demo完整代码见Github ...
See project PorYoung/allChat, an online chat web application based on egg.js and sockt.io. Egg + Webpack + Socket.io Notes Directory Structure - app - controller - extend - middleware - model - service - public - dist /* webpack output directory */ - io /* socket.io */ - controller - middleware - view - router.js - config - config.default.js - plugin.js - build /* webpack */ - src - webpack.config.js - ... Egg Quick Usage npm i egg-init -g egg-init egg-example --type=simple cd egg-example npm i npm run dev The server listens on 7001. See egg for more detail. Config config/config.default.js default content 'use strict'; const path = require('path'); module.exports = appInfo => { const config = exports = {}; // use for cookie sign key, should change to your own and keep security config.keys = appInfo.name + 'your_keys'; // add your config here return config; } middleware // add your middleware config.middleware = ['permission','middleware2']; // your middleware config, which will be the param 'options' you can access later config.permission = { excludeUrl: { 'ALL':…
win10 TensorFlow GPU环境搭建记录
【转】latex自动生成文献
win10搜索失效解决方法

win10 TensorFlow GPU环境搭建记录 By PorYoung 2018-10-17 在CSDN查看 机器配置 win 10(64bit) GTX 960m 本次搭建所需文件 VS2017 CUDA cuDNN Anaconda 配置过程 安装(已安装则选择修改单个组件)并配置vs2017,添加如下组件: VC++ 2017版本 15.4 v14.11工具集 用于CMake的Visual C++工具 适用于桌面的VC++ 2015.3 V14.00(V140)工具集 首次安装CUDA时出现Visual Studio Integration无法安装,添加该组建后重新安装成功,不知道是不是受它的影响 安装Anaconda Anaconda包含了conda、Python等180多个科学包及其依赖项,功能十分强大 下载地址:https://www.anaconda.com/download/ 此处选择了Python 3.7版本 后来发现目前Tensorflow不支持pythob 3.7版本,在安装Tensorflow时会提示找不到包 此外,安装部分版本不兼容的CUDA、cuDNN也会导致安装失败 对应版本解决方案:https://github.com/fo40225/tensorflow-windows-wheel,查看大神编译的各种版本tensorflow的地址,此次配置的为蓝色框线内的版本,Anaconda可以在后续修改环境为python 3.6 安装 第一项可选可不选,不选的话需要自行配置环境变量 第一项未选需要配置的环境变量 安装CUDA(注意版本:exclamation:) 安装前注意 GTX 960m运算能力为5.0,本次选择最新v10.0 网上许多资料都表示存在tensorflow、CUDA和cuDNN版本不兼容无法支持等问题,未一一测试,均选择当时最新版本。比较谨慎的,可以参考相关博文。 查看显卡支持:https://developer.nvidia.com/cuda-gpus 选择对应版本下载:https://developer.nvidia.com/cuda-toolkit-archive 安装 选择自定义安装 一般不需要安装GeForce Experience 安装可能存在的问题 Visual Studio Intergration无法安装 > 可能的解决方法 > 1. 参考安装VS2017的过程,可能缺少组件 > 2. 参考教程:CUDA安装失败解决方法 下载cuDNN(注意版本:exclamation:),需要注册 下载链接:https://developer.nvidia.com/rdp/cudnn-download 此处选择和CUDA v10.0搭配的cudnn-10.0-windows10-x64-v7.3.1.20 解压到CUDA安装根目录,共三个文件夹:bin、include、lib 安装Tensorflow运行环境 打开Anaconda prompt 配置清华仓库镜,输入指令: conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/ conda config --set show_channel_urls yes 创建运行环境,名称为tensorflow-gpu,python版本为3.6 conda create -n tensorflow-gpu python=3.6 名称作为与其他环境隔离的标志,版本可自行更换 激活并进入该环境 activate tensorflow-gpu 其他指令可以参考Anaconda教程 升级pip python -m pip install --upgrade pip 安装相关依赖包 如果确定所安装的版本兼容,可以直接安装 pip install --ignore-installed --upgrade tensorflow-gpu 如果使用的是编译的tensorflow版本则需要进入下载目录进行安装,如进入D:\Files目录,有从github下载的编译版本tensorflow_gpu-1.11.0-cp36-cp36m-win_amd64.whl,执行安装命令即可 pip install tensorflow_gpu-1.11.0-cp36-cp36m-win_amd64.whl 测试Tensorflow 进入环境,运行python 键入 import tensorflow as tf 未报错则安装成功 可能存在的问题 报DLL找不到模块,可能是版本选择的问题 其他问题尚未可知 参考文章 Win10下Tensorflow(GPU版)安装趟坑实录 Win10 64 位Tensorflow-gpu安装(VS2017+CUDA9.2+cuDNN7.1.4+python3.6.5) Win10+VS2017+CUDA9.2 安装调试笔记
[原文:latex自动生成文献](https://www.cnblogs.com/zhanglanyun/archive/2012/05/26/2519280.html) [作者博客](http://home.cnblogs.com/u/zhanglanyun/) BibTeX 是一个使用数据库的的方式来管理参考文献程序, 用于协调LaTeX的参考文献处理. BibTeX 文件的后缀名为 .bib . 先来看一个例子: @article{Gettys90, author = {Jim Gettys and Phil Karlton and Scott McGregor}, title = {The {X} Window System, Version 11}, journal = {Software Practice and Experience}, volume = {20}, number = {S2}, year = {1990}, abstract = {A technical overview of the X11 functionality. This is an update of the X10 TOG paper by Scheifler \& Gettys.} } 说明: 第一行@article 告诉 BibTeX 这是一个文章类型的参考文献. 还有其它格式, 例如 article, book, booklet, conference, inbook, incollection, inproceedings, manual, misc, mastersthesis, phdthesis, proceedings, techreport, unpublished 等等. 接下来的"Gettys90", 就是你在正文中引用这个条目的名称. 其它就是参考文献里面的具体内容啦. 在LaTeX中使用BibTeX 为了在 LaTeX 中使用BibTeX 数据库, 你必须先做下面三件事情: 1) 设置参考文献的类型 (bibliography style). 标准的为 plain: \bibliographystyle{plain} 其它的类型包括unsrt – 基本上跟 plain 类型一样, 除了参考文献的条目的编号是按照引用的顺序, 而不是按照作者的字母顺序. alpha – 类似于 plain 类型, 当参考文献的条目的编号基于作者名字和出版年份的顺序. abbrv – 缩写格式 . 2) 标记引用 (Make citations). 当你在文档中想使用引用时, 插入 LaTeX命令 \cite{引用文章名称} "引用文章名称" 就是前边定义@article后面的名称. 3) 告诉 LaTeX 生成参考文献列表 . 在 LaTeX 的结束前输入 \bibliography{bibfile} 这里bibfile 就是你的 BibTeX 数据库文件 bibfile.bib . 运行 BibTeX分为下面四步 1.用LaTeX编译你的 .tex 文件 , 这是生成一个 .aux 的文件, 这告诉BibTeX 将使用那些引用. 2.用BibTeX 编译 .bib 文件. 3.再次用LaTeX 编译你的 .tex 文件, 这个时候在文档中已经包含了参考文献, 但此时引用的编号可能不正确. 4.最后用 LaTeX 编译你的 .tex 文件, 如果一切顺利的话, 这是所有东西都已正常了.…
答案来自知乎提问 方法1. 重新安装Cortana 以管理员模式运行powershell,输入以下内容并确认 Get-AppXPackage -Name Microsoft.Windows.Cortana | Foreach {Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"} 方法2. 扫描修复系统 以管理员模式运行powershell,键入并回车 sfc /scannow 方法3. 重新运行资源管理器explorer.exe
How to build MCloud
【转】Nginx实现端口转发
Mark My Ideas
Node版本切换
随着各大网盘关闭和被墙,网络云盘可选的服务商越来越少,某度云收费太高,限制太多,加上某些个人资料不便上传,此时私有云的作用就凸显出来了,搭配离线下载工具和同步工具,一个比较完整成熟的云应用就呈现出来了 LNMP 预置环境配置LNMP(或LAMP),可使用一键安装包,也可以自己逐个安装配置 KodExplorer 对比使用OwnCloud和NextCloud后,个人感觉KodExplorer功能更加强大,也比较稳定,在WEB能像windows一样操作,此外KodExplorer无需配置数据库(后续可能将支持数据库),安装便利。唯一不足的,KodExplorer移动端支持不友好(后续也将支持移动端)。 官方演示Demo,用户名/密码均为demo 官方下载页面 在Linux中安装: 移至需要安装KodExplorer的web目录,如/var/www/KodExplorer,请手动更改至最新版本号: cd /var/www/KodExplorer wget http://static.kodcloud.com/update/download/kodexplorer4.32.zip unzip kodexplorer4.32.zip chmod -Rf 777 ./* 配置好Nginx和PHP后,访问服务器,设置密码即可登陆使用,默认有三个账户admin、demo、guest。 Aria2 Aria2后台 Ubuntu 16.04直接使用apt安装: apt-get install aria2 可以直接使用命令行参数设置配置并启动,也可以创建并编辑配置文件aria2.conf,可参考如下: #用户名 #rpc-user=user #密码 #rpc-passwd=passwd #上面的认证方式不建议使用,建议使用下面的token方式 #设置加密的密钥 rpc-secret=XXXXXX #允许rpc enable-rpc=true #允许所有来源, web界面跨域权限需要 rpc-allow-origin-all=true #允许外部访问,false的话只监听本地端口 rpc-listen-all=true #RPC端口, 仅当默认端口被占用时修改 rpc-listen-port=6800 #最大同时下载数(任务数), 路由建议值: 3 max-concurrent-downloads=5 #断点续传 continue=true #同服务器连接数 max-connection-per-server=16 #最小文件分片大小, 下载线程数上限取决于能分出多少片, 对于小文件重要 min-split-size=10M #单文件最大线程数, 路由建议值: 5 split=16 #下载速度限制 max-overall-download-limit=0 #单文件速度限制 max-download-limit=0 #上传速度限制 max-overall-upload-limit=0 #单文件速度限制 max-upload-limit=0 #断开速度过慢的连接 #lowest-speed-limit=0 #验证用,需要1.16.1之后的release版本 #referer=* #文件保存路径, 默认为当前启动位置 dir=/var/www/html/downloads/ #禁用IP V6 disable-ipv6=true ## BT/PT下载相关 ## # 当下载的是一个种子(以.torrent结尾)时, 自动开始BT任务, 默认:true #follow-torrent=true # BT监听端口, 当端口被屏蔽时使用, 默认:6881-6999 #listen-port=51413 # 单个种子最大连接数, 默认:55 #bt-max-peers=55 # 打开DHT功能, PT需要禁用, 默认:true enable-dht=false # 打开IPv6 DHT功能, PT需要禁用 #enable-dht6=false # DHT网络监听端口, 默认:6881-6999 #dht-listen-port=6881-6999 # 本地节点查找, PT需要禁用, 默认:false #bt-enable-lpd=false # 种子交换, PT需要禁用, 默认:true enable-peer-exchange=false # 每个种子限速, 对少种的PT很有用, 默认:50K #bt-request-peer-speed-limit=50K # 客户端伪装, PT需要 peer-id-prefix=-TR2770- user-agent=Transmission/2.77 # 当种子的分享率达到这个数时, 自动停止做种, 0为一直做种, 默认:1.0 seed-ratio=0 # 强制保存会话, 即使任务已经完成, 默认:false # 较新的版本开启后会在任务完成后依然保留.aria2文件 #force-save=false # BT校验相关, 默认:true #bt-hash-check-seed=true # 继续之前的BT任务时, 无需再次校验, 默认:false bt-seed-unverified=true # 保存磁力链接元数据为种子文件(.torrent文件), 默认:false bt-save-metadata=true #添加额外的tracker bt-tracker=udp://tracker1.wasabii.com.tw:6969/announce,udp://tracker2.wasabii.com.tw:6969/announce,http://mgtracker.org:6969/announce,http://tracker.mg64.net:6881/announce,http://share.camoe.cn:8080/announce,udp://tracker.opentrackr.org:1337/announce 保存并使用该配置启动:aria2c --conf-path=aria2.conf 可使用Screen后台运行: #创建aria2c活动 screen -S aria2c #运行aria2c aria2c --conf-path=aria2.conf #使用ctrl+d再按a离开,使用screen -r aria2c重新进入该活动 Aria2前端 可使用aria2 WebUI也可使用UI更加好看(个人感觉)的aria-Ng aria-Ng项目地址:https://github.com/mayswind/AriaNg…
查看原文:Nginx 实现端口转发——星河赵博客 Summary Nginx在监听某一端口(如80端口)时,通过配置负载均衡池,根据不同的域名,将同一端口的HTTP/HTTPS请求分发到不同的端口。 实例如下: ##负载均衡池 upstream one_pool{ server 127.0.0.1:5000; } upstream two_pool{ server 127.0.0.1:6000; } ##server one server { #listenning on 80 listen 80; server_name one.poryoung.cn; #redirect to https return 301 https://$server_name$request_uri; } server { listen 443; server_name one.poryoung.cn; location / { proxy_pass http://one_pool; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection 'upgrade'; proxy_set_header Host $host; proxy_cache_bypass $http_upgrade; } #Allow HTTPS ssl on; # Let's Encrypt生成的SSL证书: ssl_certificate /.../*.poryoung.cn/fullchain.cer; ssl_certificate_key /.../*.poryoung.cn.key; ssl_session_timeout 5m; ssl_protocols TLSv1 TLSv1.1 TLSv1.2; ssl_prefer_server_ciphers on; ssl_ciphers 'EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH'; } ##server two server { #listenning on 80 listen 80; server_name two.poryoung.cn; #redirect to https return 301 https://$server_name$request_uri; } server { listen 443; server_name two.poryoung.cn; location / { proxy_pass http://two_pool; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection 'upgrade'; proxy_set_header Host $host; proxy_cache_bypass $http_upgrade; } #Allow HTTPS ssl on; # Let's Encrypt生成的SSL证书: ssl_certificate /.../*.poryoung.cn/fullchain.cer; ssl_certificate_key /.../*.poryoung.cn.key; ssl_session_timeout 5m; ssl_protocols TLSv1 TLSv1.1 TLSv1.2; ssl_prefer_server_ciphers on; ssl_ciphers 'EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH'; } 其中的域名和证书部分需要替换。 Let's Encrypt已经支持泛域名证书申请,网上有许多教程,比较详细的如Let’s Encrypt免费泛域名证书申请教程步骤,使用ACME.sh申请。 在申请过程中,./acme.sh --issue -d *.xxorg.com -d xxorg.com --dns和./acme.sh --renew -d *.xxorg.com -d xxorg.com命令可能会遇到dns manual mode警告而失败的情况,在其后加上--yes-I-know-dns-manual-mode-enough-go-ahead-please即可
INFO There are many ideas in your mind, some are matrue and others are naive. All of these ideas will go away, some maybe never come back to your mind, even if they are really close to come true. I've heard many people have done this from a very early time, with konwing they are successful, I haven't tried. From now, I'll mark all ideas in my mind, even if they are ridiculous sometimes. IDEAS A idea community This a community for exchanging ideas. Everyone can mark or publish their thought whatever kinds of they are. Then the system will create a project progress under this idea, which also can note what you have done and remind you to come ture your idea according to the progress and feasiability. If your idea is public, then other people can help you or clone your idea if they are more easier to come ture. New mode of taking after left-behind children refer to A Love Coffee for autisms in Shanghai
In the lastest nodejs version the Buffer() constructor has been deprecated DEP0005: Buffer() constructor# Type: Runtime (supports --pending-deprecation) The Buffer() function and new Buffer() constructor are deprecated due to API usability issues that can potentially lead to accidental security issues. As an alternative, use of the following methods of constructing Buffer objects is strongly recommended: Buffer.alloc(size[, fill[, encoding]]) - Create a Buffer with initialized memory. Buffer.allocUnsafe(size) - Create a Buffer with uninitialized memory. Buffer.allocUnsafeSlow(size) - Create a Buffer with uninitialized memory. Buffer.from(array) - Create a Buffer with a copy of array Buffer.from(arrayBuffer[, byteOffset[, length]]) - Create a Buffer that wraps the given arrayBuffer. Buffer.from(buffer) - Create a Buffer that copies buffer. Buffer.from(string[, encoding]) - Create a Buffer that copies string. As of v10.0.0, a deprecation warning is printed at runtime when --pending-deprecation is used or when the calling code is outside node_modules in order to better target developers, rather than users. how to switch diffirent versions use module n npm install n -g Usesudo n versionto install specific version And use sudo nto switch Howerver…