LinMinquan's Blog

Experience technology to change life

using rsync in windows 10

I just want to upload web static files to server, after some search, it looks like rsync can work on windows but needed to install something(Cygwin or cwRsync) at first. I check rsync command on Ubuntu (windows subsystem for linux), it worked. So, I think the easiest way to use rsync on windows 10. Read more →

Hugo add meta for Facebook and Twitter share link preview

After analyze a example link that can preview in Facebook & Twitter and search Google, I found it just need to add some meta on blog post’s html header. One guy give an example code below. His blog post about this solution: https://vietlq.github.io/2017/04/30/access-hugo-page-variables/ His github gist about this code: https://gist.github.com/vietlq/d1c7ecfb20ce7beac4a7f4df746c797c Reference: <a rel=“noreferrer noopener” aria-label=“Reference: https://developer.twitter.com/en/docs/tweets/optimize-with-cards/overview/summary.html https://developer.twitter.com/en/docs/tweets/optimize-with-cards/overview/markup.html  (opens in a new tab)” href=“https://developer.twitter.com/en/docs/tweets/optimize-with-cards/overview/summary.html" target="_blank”>https://developer.twitter.com/en/docs/tweets/optimize-with-cards/overview/summary.html <a rel=“noreferrer noopener” aria-label=“Reference: https://developer.twitter.com/en/docs/tweets/optimize-with-cards/overview/summary.html https://developer. Read more →

AWS EC2 搭的网站无法访问

环境:AWS EC2, Ubuntu 16.04 64 bit 用的是 AWS 免费试用的 EC2,在上面搭 Discourse 测试,感觉搭好了怎么老是访问不了。才搜到原来得在AWS 后台打开对应的端口,它默认只开22端口用来ssh,然后我开了80端口。 Services > EC2 > NETWORK & SECURITY > Security Groups > 选中你的VPC > Inbound 然后过了两三天,我在上面给 Discourse + Nginx + 其它网站 + Cerbot 配 https,感觉 Cerbot 配好了呀,安装好后就一个命令呀,怎么 https 打不开,以为是 Cerbot的问题,倒腾了半天,吃过一顿午饭后才想起来是 AWS 的锅,赶紧把 443加上,OK了。 Read more →

Discourse 邮件 G Suite 配置

环境:AWS EC2, Discourse v2.2.0.beta3, Ubuntu 16.04 64bit 之前的同事用的是公司G Suite的某个邮箱配置的。 但我用同样的邮件配置,在另一台AWS EC2上配置,却一直发不出邮件。看Discourse log, 我试着用腾讯企业邮箱,也发不出来,我记得是类似的错误,但参考了下面的教程后,报错不一样了,但我没有接着试,我转试 mailgun 使用腾讯企业邮箱配置 Discourse 邮件发送服务器 discourse+Ubuntu安装详解 mailgun 注册时,可以不马上绑定付款方式,配置自己的域名,然后授权的收件人(recipient),就可以发测试邮件了。mailgun 是可以正常发邮件的,而且可以在mailgun 后台看到 log,来查看邮件是否发送成功以及发送失败的原因。 后来才注意到 smtp-relay.gmail.com 这个url 有点奇怪,别人用的都是 smtp.gmail.com ,我试了用 smtp.gmail.com 后就正常了,可以发邮件了。 可 smtp-relay.gmail.com 是什么特别的服务器吗?原来这个 G Suit 专门给只发送邮件的使用场景用的服务器, Send email from a printer, scanner, or app https://support.google.com/a/answer/176600?hl=en 配置的话,要登录 G Suite Admin Console,界面是如下图所示 上图 Apps > G Suite > Gmail > Advanced settings > General Settings > SMTP relay service 就会发现我同事设置了限定发送邮件的服务器的IP地址,且只能是从跟这个G Suit一样的子域名(我习惯拿自己域名测试)才可以发送,我加上了我EC2的IP,又弄了个公司域名的子域名。要注意的是,修改后,要点击保存。 Read more →

在虚拟机中安装 discourse

先装 git 主要按官方的教程安装 https://github.com/discourse/discourse/blob/master/docs/INSTALL-cloud.md 如果不是以 root 用户在操作时,会提示要敲个命令把这个用户加入到 某group 里 If you would like to use Docker as a non-root user, you should now consider adding your user to the “docker” group with something like: 下面命令开始设置 discourse 要设置下面这几个问题 第一个就填刚才 hosts 里加的域名 discourseraw.pl 最后一个问题我是直接回车 skip Read more →

测试路由器Wifi的传输速度

环境:windows 10,iPhone or Android phone 纯粹测试wifi的最快速度,数据传输没有经过NAT win10电脑网线接路由器Lan口,win10上打开 ubuntu sub linux system, sudo apt install iperf3 iperf3 -s 就启动了 在手机上安装 Network Tools ,打开,在左边侧栏选择 Iperf,在顶部选项卡中选择 Iperf3, Interval 填1,即1秒显示一次数据,Bytes填500M,表示要测试500M的数据,然后填上电脑的ip, 点击键盘上的 go,就开始测试了 测试后,手机可以切换2.4G 和 5G进行测试。 Read more →

Windows 10 录系统的声音

环境:windows 10 想要录取操作系统的声音(非麦克风录的声音),例如某个软件的声音。 在声音里将 Stereo Mix 设置为 Set as Default device 然后这时候再打开 Voice Recorder,录到声音就是操作系统的声音了。 Read more →

用rclone在两个onedrive账户间复制数据

将 onedrive 账户 A 的里的文件夹复制到 onedrive 账户 B 我 onedrive 账户 A 的客户端不同步了,只显示其在 updating ,好几个小时也还是那样。我猜想是我里面的文件太多了,有个文件夹有 500 多 GB,且有些像 .git 文件夹,就会有非常多的小文件。(后面微软觉得我有个压缩包有病毒,那只是我写的软件而矣) 照理说,将 B 账户里建个文件夹,share 给 A,然后 A 在网页版里往这个文件夹里复制就行了,但会报错,每次都只复制一个文件,不知道是我里面的哪些文件触发了 onedrive 的什么 bug,也懒得找微软客服。 我是看到下面这篇教程,才知道有 rclone 这个命令行工具的,总的来说还蛮好用的,在 windows 上配置起来也不复杂。 使用 rclone 将 Google Drive 文件同步至 OneDrive 有个别文件在复制时会报错,我会用 rclone check 命令去检查 source 和 dest 是否一致,但会在命令最后加上 –size-only 的 tag 在用 rclone copy 时,我会想显示其进度,可以在命令最后加上 -v Read more →