昨天,今天,明天,每天的每天,你是否都多懂得一点点...

星期五, 五月 31, 2019

Docker toolbox -v 映射本地文件失败的问题

我同时安装了 docker windows 和 docker toolbox

所以当我启用Hyper-v 的时候,我就可以使用 Docker windows, 而禁用 Hyper-v 的时候则使用 Docker toolbox. 

有意思的是, 当我使用Docker toolbox 的时候, 原来的 docker windows 的 docker.exe 命令也可以工作。 

不需要在 docker toolbox 的 terminal 里使用 docker, 在普通的 cmd 里也可以做到, 唯一不能做的就是不能使用 -v 参数

如果在cmd 里使用 -v 参数映射本地文件夹的话, 会得到这样的错误

 docker run --rm -v %cd%:/root fennng/autosub ls
docker: Error response from daemon: invalid mode: /root.
See 'docker run --help'.

如果不用绝对路径, 而用相对路径来表示本地文件夹的话, 不会出错, 但是映射其实没有成功。

所以当要使用 -v 参数的时候, 必需在 docker toolbox 的 terminal 里面进行, 而且当前目录必需是 %userprofile% 或其子目录

其实docker toolbox 的 terminal 也只是调用了 git 的 bash, 执行了一个脚本做了一些预设。

"C:\Program Files\Git\bin\bash.exe" --login -i "C:\Program Files\Docker Toolbox\start.sh"

但是有了这个预设就可以了映射了, 以下是一次成功的映射, 当前目录设置在"下载" 文件夹

dengy@CL221 MINGW64 /usr
$ cd ~/Downloads

dengy@CL221 MINGW64 ~/Downloads
$ docker run --rm -v $PWD:/root fennng/autosub ls
1.m3u8
1.txt
1.zip
1182515934.jpg
1200px-Telegram_logo.svg.png
1344242665.jpg
1448618813.jpg
1456008779.jpg
1543530317636.jpg
165295.epub
165295.mobi
16pic_2890640_b.jpg
1810490484.jpg




星期三, 五月 29, 2019

websocket namespace issue behind apahce reverse proxy

One of our projects is a websocket microservice. It runs well on  the local environment. But after deploying on a azure VM, the client cannot connect to it. 

After some investigation, I noticed that the problem was caused by web socket name space.

Because the service itself is behind a Apache proxy, a path is added to the domain similar to 


Apache will match the virtualpath and redirect the request to the correct service. 

The service is not working because with socket.io, the virtualpath is treated as web socket namespace.

this.socket = io('https://domain.com/virtualpath/'});  

But the server is expecting default namespace '/'.

The make this work, we have to rewrite this code as below:

 this.socket = io('https://domain.com/', { path: '/virtualpath/socket.io'});


This will tell web socket that the name space is the default one, but there is a virtual path to append to the domain for the websocket service.




Find devices ip/ips in your lan in a few seconds using linux/unix terminal

Run two commands in your terminal, and that is it.

[bash]
brew install nmap
#using the following command to install nmap under ubuntu/debian
#sudo apt-get i nmap
#change your ip range accordingly, common ones are 192.168.0.0/24, 10.0.0.0/24 and etc.
#scan 10.0.0.0/8 may take a long time, better avoid it, I didn't try
[/bash]


--
Feng

星期六, 五月 25, 2019

Best Remote Desktop Client on Mac OS for Windows RDP



The Best Remote Desktop Client on Mac OS for Windows RDP I found is this one. (From MS)



Installed Mac OS Mojave on my mid 2011 Mac mini

Yesterday, I installed Mac OS Mojave on my old Mac mini (mid 2011) version with Mojave Patcher. I am writing this blog using the new OS.



The first attempt failed. It must caused by the Disk format I chose. I chose APFS case sensitive in the first attempt. The system was successfully installed, neither there was any problem with the post patcher installation. But the system failed to boot from the hard drive. I hold the option key and enter the boot selection mode, I could only see the USB drive and a "Windows" drive. Booting from "Windows" shows a question mark icon. Any keyboard integration will lead to a command line screen with "missing system" on the top left corner. 

I booted from the USB again and patched it the hard drive a few more times. No luck!

I then ends up with reinstalling the os again and reformatted the disk to Mac OS Extended Journaled. Then everything went well. 

To conclude, although patcher author stated that Mac released after 2009 is good to use APFS, it may result unbeatable system. It's better to use Mac OS Extended format. The only drawback is that you cannot use the building updater to update your system, but there is a patch updater installed by the patcher to do the job.

ARM 重磅出击,比谷歌打的还重,华为芨芨可危,ARM是一家什么公司?为什么对华为如此重要?

tags: 华为,麒麟 ,CPU, ARM 

ARM是一家什么样的公司? 不做开发的人可能不太了解, ARM是一家完全靠知识产权盈利的公司, 他们自己什么都不制造。 为什么他们有能量还华为寸步难行?

-~-~~-~~~-~~-~-

本频道旨在分享生活中各种小技巧, 如用小米盒子看国内视频, 如何使用KODI看电影等等. 同时我也会分享一些编程的教程, 如编写Telegram机器人, 建站等。 点击进入我的频道: goo.gl/5tyxcf

🔷 订阅我的频道: goo.gl/KuF3bY
🔷 telegram电报群: t.me/fengsharegroup
🔷 我的博客: www.dengnz.com/blog
🔷 Facebook: www.facebook.com/fengnz

觉得我的视频对你帮助很大的话, 请我喝杯咖啡吧
微信赞赏码: goo.gl/uKoE8w
-~-~~-~~~-~~-~-

--
Feng

星期三, 五月 22, 2019

[youtube]美对华为禁令, 华为何去何从? 华为的鸿蒙系统能刷机刷成第三方的安卓系统吗?

tags: 华为 ,美国 ,禁令, 谷歌, 安卓, 手机, 特朗普, 川普, 芯片

美国对华为的出口禁令, 导至华为无法从美国进口手机部件, 甚至软件的使用也受到掣肘. 华为能否冲出重围研发出下一代手机? 如果下一代华为手机搭载的是华为自主研发的操作系统, 用户能否把它刷成第三方的安卓操作系统?


-~-~~-~~~-~~-~-

本频道旨在分享生活中各种小技巧, 如用小米盒子看国内视频, 如何使用KODI看电影等等. 同时我也会分享一些编程的教程, 如编写Telegram机器人, 建站等。 点击进入我的频道: goo.gl/5tyxcf

🔷 订阅我的频道: goo.gl/KuF3bY
🔷 telegram电报群: t.me/fengsharegroup
🔷 我的博客: www.dengnz.com/blog
🔷 Facebook: www.facebook.com/fengnz

觉得我的视频对你帮助很大的话, 请我喝杯咖啡吧
微信赞赏码: goo.gl/uKoE8w
-~-~~-~~~-~~-~-
--
Feng

星期六, 五月 18, 2019

[Youtube] 无痕模式不无痕, 看看你到底泄漏了什么

tags: 无痕模式,网络安全, 峰哥


我来讲讲谷歌的无痕模式
不然让人知道上过哪些网站, 我们通常就会使用无痕模式, 特别是某些单身狗上撸站的时候, 一定会开启的模式.

无痕模式到底有没有用? 有用? 但是绝对没你想的那么有用.

我先要讲讲它有用的部分, 呆会儿再跟大家讲讲它没用的部分

它能防什么? 

1. 它能防止浏览器保留你的浏览记录. 也就是说, 你老妈,老婆在翻你的电脑手机的时候,不会看到你去过哪些网站.
2. 它能防止某些网站搜索栏的自动完成功能, 比如你在谷歌搜索过如何治疗不举, 下次你老妈打一个如字的时候, 你搜索过的内容就跳出来了.
3. 它能防止你缓存的内容保存在设备上, 比如你老婆去翻你的缓存文件夹的时候发现很多小姐姐图片.

它不能防什么?

哇 , 这个太多了, 说出来要吓你们一跳

1. 它不能防止别人看到你下载的文件, 你用无痕模式下载的文件依然在你的下载文件夹中, 别以为你用无痕模式下载的小电影会在你关闭浏览器的时候一起被删掉.
2. 它不能防止别人看到你去访问哪些网站. 是的, 没错, 它不能, 你以为你用无痕模式浏览小黄站没人知道? 大错特错, 你老婆一翻路由器日志, 就知道你去了哪些网站.
3. 它不能加密信道, 如果你使用的是没有加密的协议, 比如HTTP, 那你发送和接收的内容将可以在数据包所经过的任何网络被捕获, 所以,一定要用HTTPS, 就算是无痕模式.
4. 它不能隐藏你的IP, 是的, 它不能, 你如果用无痕模式在论坛上瞎BB, 在网上诈骗, 那你等着被人肉, 去坐牢吧.
5. 它不能隐藏你的地理位置, 是的, 它不能, 因为你的IP都被知道了, 你的地理位置也被知道了,你他妈的还开着各种地图软件, 你的详细GPS位置都有人知道 .


好吧,就先讲这么多吧, 已经有很多人吓到尿失禁了, 再讲下去就臭不可闻了. ..

现在来讲讲无痕模式的原理


无痕模式只不过是浏览器本身的一个清理动作, 和网络没有关系. 为了加载更快, 还有一些增强用户体验的功能, 比如历史记录, 自动完成等 , 浏览器默认会保存一些东西下来, 无痕模式只是告诉浏览器不要保留这些东西, 但是它本身并不能增加保密性, 它只是把它的背叛天赋给去掉了. 

所以, 那些以为用了无痕模式就可以为所欲为的人, 小心了.

下期视频我来讲讲, 公共WIFI到底能不能用


-~-~~-~~~-~~-~-

本频道旨在分享生活中各种小技巧, 如用小米盒子看国内视频, 如何使用KODI看电影等等. 同时我也会分享一些编程的教程, 如编写Telegram机器人, 建站等。 点击进入我的频道: goo.gl/5tyxcf

🔷 订阅我的频道: goo.gl/KuF3bY
🔷 telegram电报群: t.me/fengsharegroup
🔷 我的博客: www.dengnz.com/blog
🔷 Facebook: www.facebook.com/fengnz

觉得我的视频对你帮助很大的话, 请我喝杯咖啡吧
微信赞赏码: goo.gl/uKoE8w
-~-~~-~~~-~~-~-


--
Feng

星期日, 五月 12, 2019

[Youtube]史上最强内网穿透|Ngrok|一秒网站上公网【峰哥教你做网站系列】

tags: 峰哥,建站,ngrok,内网穿透


好久之前出过一个一键建站的视频 https://youtu.be/A7Szb93HX1c
主要讲了一键建产wordpress 网站的方法。 

要让内网的网站可以被外网的人看到, 我们一般需要在路由器上做NAT 端口映谢。
不过这个视频将介绍一个更简单的方法, 绝对的低门槛, 肉网穿透神器。

-~-~~-~~~-~~-~-

本频道旨在分享生活中各种小技巧, 如用小米盒子看国内视频, 如何使用KODI看电影等等. 同时我也会分享一些编程的教程, 如编写Telegram机器人, 建站等。 点击进入我的频道: goo.gl/5tyxcf

🔷 订阅我的频道: goo.gl/KuF3bY
🔷 telegram电报群: t.me/fengsharegroup
🔷 我的博客: www.dengnz.com/blog
🔷 Facebook: www.facebook.com/fengnz

觉得我的视频对你帮助很大的话, 请我喝杯咖啡吧
微信赞赏码: goo.gl/uKoE8w
-~-~~-~~~-~~-~-


--
Feng

星期二, 五月 07, 2019

[网络技术]How to reset ntopng password

sudo systemctl stop ntopng
sudo redis-cli del ntopng.user.admin.password
sudo systemctl start ntopng

This will reset user and password to admin/admin

--
Feng

Re: How to add swap file to Azure Linux VM

Ah, forgot to mention, after changing the config file. 
run 
systemctl restart walinuxagent
to make it take effect, you don't need to restart your VM.


feng <fengnz@gmail.com> 于2019年5月7日周二 下午2:23写道:
Login to your VM

Run the following command to edit the config file

[bash]
 sudo vi /etc/waagent.conf
[/bash]  


ResourceDisk.Format=y  
ResourceDisk.EnableSwap=y    
ResourceDisk.SwapSizeMB=4000



I set the swap file to 4000M as my vm only 4000M available

use df -h to check avaialbe disk space on the temp drive /dev/sdb1

[bash]
df -h
Filesystem      Size  Used Avail Use% Mounted on
udev            952M     0  952M   0% /dev
tmpfs           193M  1.2M  192M   1% /run
/dev/sda1        29G  3.1G   26G  11% /
tmpfs           964M  992K  963M   1% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           964M     0  964M   0% /sys/fs/cgroup
/dev/sda15      105M  3.6M  101M   4% /boot/efi
/dev/sdb1       3.9G  3.9G     0 100% /mnt
tmpfs           193M     0  193M   0% /run/user/1000
/dev/loop0       90M   90M     0 100% /snap/core/6818
/dev/loop1       98M   98M     0 100% /snap/docker/372

[/bash]


Then run free -m to check your new swap file 

[bash]
 free -m
              total        used        free      shared  buff/cache   available
Mem:           1927         930         211           1         786         759
Swap:          3934          16        3917

[/bash]  

use cat /var/log/waagent.log
 to check the log

if you see the following log, means you need to reduce your swap file size as there is no enough space on the temp drive.


[bash]  
2019/05/07 02:10:37.103906 INFO Daemon fallocate unsuccessful, falling back to dd
2019/05/07 02:11:57.305341 INFO Daemon Azure Linux Agent Version:2.2.32.2
2019/05/07 02:11:57.344161 INFO Daemon OS: ubuntu 18.04
2019/05/07 02:11:57.363692 INFO Daemon Python: 3.6.7
2019/05/07 02:11:57.397202 INFO Daemon Add daemon process pid 31642 to walinuxagent systemd cgroup
2019/05/07 02:11:57.425906 INFO Daemon CGroups: ok
2019/05/07 02:11:57.496881 INFO Daemon Run daemon
2019/05/07 02:11:57.507329 INFO Daemon Activate resource disk
2019/05/07 02:11:57.614996 INFO Daemon Resource disk [/dev/sdb1] is already mounted [/mnt]
2019/05/07 02:11:57.642478 WARNING Daemon Failed to write data loss warning:[Errno 1] Operation not permitted: '/mnt/DATALOSS_WARNING_README.txt'
2019/05/07 02:11:57.670093 INFO Daemon Enable swap
2019/05/07 02:11:57.707961 INFO Daemon Remove old swap file
2019/05/07 02:11:58.531786 INFO Daemon Create swap file
2019/05/07 02:11:58.595572 ERROR Daemon Command: [umask 0077 && fallocate -l 4294967296 '/mnt/swapfile'], return code: [1], result: [fallocate: fallocate failed: No space left on device
[/bash]  



--
Feng

How to add swap file to Azure Linux VM

Login to your VM

Run the following command to edit the config file

[bash]
 sudo vi /etc/waagent.conf
[/bash]  


ResourceDisk.Format=y  
ResourceDisk.EnableSwap=y    
ResourceDisk.SwapSizeMB=4000



I set the swap file to 4000M as my vm only 4000M available

use df -h to check avaialbe disk space on the temp drive /dev/sdb1

[bash]
df -h
Filesystem      Size  Used Avail Use% Mounted on
udev            952M     0  952M   0% /dev
tmpfs           193M  1.2M  192M   1% /run
/dev/sda1        29G  3.1G   26G  11% /
tmpfs           964M  992K  963M   1% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           964M     0  964M   0% /sys/fs/cgroup
/dev/sda15      105M  3.6M  101M   4% /boot/efi
/dev/sdb1       3.9G  3.9G     0 100% /mnt
tmpfs           193M     0  193M   0% /run/user/1000
/dev/loop0       90M   90M     0 100% /snap/core/6818
/dev/loop1       98M   98M     0 100% /snap/docker/372

[/bash]


Then run free -m to check your new swap file 

[bash]
 free -m
              total        used        free      shared  buff/cache   available
Mem:           1927         930         211           1         786         759
Swap:          3934          16        3917

[/bash]  

use cat /var/log/waagent.log
 to check the log

if you see the following log, means you need to reduce your swap file size as there is no enough space on the temp drive.


[bash]  
2019/05/07 02:10:37.103906 INFO Daemon fallocate unsuccessful, falling back to dd
2019/05/07 02:11:57.305341 INFO Daemon Azure Linux Agent Version:2.2.32.2
2019/05/07 02:11:57.344161 INFO Daemon OS: ubuntu 18.04
2019/05/07 02:11:57.363692 INFO Daemon Python: 3.6.7
2019/05/07 02:11:57.397202 INFO Daemon Add daemon process pid 31642 to walinuxagent systemd cgroup
2019/05/07 02:11:57.425906 INFO Daemon CGroups: ok
2019/05/07 02:11:57.496881 INFO Daemon Run daemon
2019/05/07 02:11:57.507329 INFO Daemon Activate resource disk
2019/05/07 02:11:57.614996 INFO Daemon Resource disk [/dev/sdb1] is already mounted [/mnt]
2019/05/07 02:11:57.642478 WARNING Daemon Failed to write data loss warning:[Errno 1] Operation not permitted: '/mnt/DATALOSS_WARNING_README.txt'
2019/05/07 02:11:57.670093 INFO Daemon Enable swap
2019/05/07 02:11:57.707961 INFO Daemon Remove old swap file
2019/05/07 02:11:58.531786 INFO Daemon Create swap file
2019/05/07 02:11:58.595572 ERROR Daemon Command: [umask 0077 && fallocate -l 4294967296 '/mnt/swapfile'], return code: [1], result: [fallocate: fallocate failed: No space left on device
[/bash]  

星期日, 五月 05, 2019

[Youtube]天才小捣讲故事 - 小捣同学即兴演出,自编自导自演 - 第一次出境就这么老练 - 第一期

tags: 小捣讲故事, 小捣, 峰哥
小捣同学整天在我拍视频的时候来捣乱, 那好吧, 这次让你来讲!


-~-~~-~~~-~~-~-

本频道旨在分享生活中各种小技巧, 如用小米盒子看国内视频, 如何使用KODI看电影等等. 同时我也会分享一些编程的教程, 如编写Telegram机器人, 建站等。 点击进入我的频道: goo.gl/5tyxcf

🔷 订阅我的频道: goo.gl/KuF3bY
🔷 telegram电报群: t.me/fengsharegroup
🔷 我的博客: www.dengnz.com/blog
🔷 Facebook: www.facebook.com/fengnz

觉得我的视频对你帮助很大的话, 请我喝杯咖啡吧
微信赞赏码: goo.gl/uKoE8w
-~-~~-~~~-~~-~-
--
Feng

星期四, 五月 02, 2019

[Youtube]如何在电脑上录音的时候还能实时监听自己的声音 - Adobe Audition简单教程

tags: audition, adobe audition, 录音,实时监听, 监听 ,自己的声音


有时候录音的时候你可能想实时的听到自己的声音。  这样做的好处很多, 首先可以知道录音设备是不是正常工作, 音量是小还是大, 有没有破音, 有没有底噪。 如果听不到, 等录完才发现, 会非常的影响心情。 今天这个视频介绍如何使用adobe audition 录音并实时监听自己的声音。 这个方法用来对比麦克风也很好哦。

-~-~~-~~~-~~-~-

本频道旨在分享生活中各种小技巧, 如用小米盒子看国内视频, 如何使用KODI看电影等等. 同时我也会分享一些编程的教程, 如编写Telegram机器人, 建站等。 点击进入我的频道: goo.gl/5tyxcf

🔷 订阅我的频道: goo.gl/KuF3bY
🔷 telegram电报群: t.me/fengsharegroup
🔷 我的博客: www.dengnz.com/blog
🔷 Facebook: www.facebook.com/fengnz

觉得我的视频对你帮助很大的话, 请我喝杯咖啡吧
微信赞赏码: goo.gl/uKoE8w
-~-~~-~~~-~~-~-

其它博客地址

此博客的同步博客地址: http://fengnz.wordpress.com
这里进入我的MSN SPACE.