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

星期二, 一月 21, 2020

A strange but works connection using HG259B as a wifi repeater

The connection is a little bit wield. The other router doesn't need any config. 

HG259B is router B
The original router is router A

Router B is from previous internet company. Router A is from the new  internet company. 

The original layout is simple, router A is connected to the fibre box with the WAN port. All other devices can connect to internet through router A's WIFI.

Telephone is connected to router A and working. 

Both routers have 2 telephone ports. But only router A has correct VOIP settings. Router A's company doesn't provide password to login to router A. So there is no way to copy the VOIP settings. 

The problem is that router A's WIFI signal cannot reach as Far as router B. Router B has the same config as router A for internet connection, so use router B for internet connection is OK. but as router B doesn't have VOIP settings,  telephone is not working with router B.

As we cannot enter router A's management portal, we can only do something from router B. The bad news is that Router B doesn't support WDS, so cannot use as a standard WIFI repeater.

The solution I made here is still using router B as a wifi repeater. 


The connection is as such:

Router B's WAN port connects to Fibre box
Router A's WAN port connects to Router B's LAN 1
Router A's LAN 2 connects to Router B's LAN 2


The hardware connection is simple, but wield. As Router A and Router B is already connected using  WAN port and LAN 1, it shouldn't need LAN2 to LAN2 connection. 


The software part is more complex:

1. Router B needs to be config as bridge mode, as below



2. Router B's IP is config to match Router A's domain, in my case, Router A's IP is 192.168.20.1, so I set router B's IP to 192.168.20.254. Also DHCP should be turned off. (So that Router'A DHCP will work).




3. Telephone is still connect to Router A


With this settings, Connect to both Router A's WIFI and Router B's WIFI will work. 

Different from WDS, their WIFI name and password are different. But actually they are the same network. Devices connect to both WIFI and talk to each other.



Questions: If we don't use bridge mode, can we still make it work? I failed once with these settings. But I am not sure If I made some other mistakes. It suppose to work with the following connection:

Router A's WAN port connect to Fibre box
Router B's LAN 1 connect to Router A's LAN 1
Router B change IP to match router A
Router B disable DHCP




--
Feng

星期五, 一月 17, 2020

Re: How to use a different nodejs version on atlassian bamboo build agent

If docker is available on the build server, use docker contained nodejs to build is a good idea too.

feng <fengnz@gmail.com> 于2020年1月17日周五 上午10:40写道:
When you build a nodejs app, you may need to use a specific version of node for building.  Either you want to match the running env or your node packages require a certain nodejs version. 

On Azure DevOps, you can easily choose the node version by adding a nodejs installer step. With bamboo, there is no nodejs install, but this can be achieved easily if you have admin access to the build agent. 

In the build steps, add a script step, and add the following inline script. This script will switch the node version for you. For first time running, you need to uncomment all the lines to install nvm first. 

[bash]

node -v
#curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.2/install.sh | bash
export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
#nvm install 13.6.0
nvm use 13.6.0
nvm list
node -v
[/bash]

Then you can add a npm install step, it will use the new node version. Or you can simply add node install command to the script.

--
Feng


--
Feng

How to use a different nodejs version on atlassian bamboo build agent

When you build a nodejs app, you may need to use a specific version of node for building.  Either you want to match the running env or your node packages require a certain nodejs version. 

On Azure DevOps, you can easily choose the node version by adding a nodejs installer step. With bamboo, there is no nodejs install, but this can be achieved easily if you have admin access to the build agent. 

In the build steps, add a script step, and add the following inline script. This script will switch the node version for you. For first time running, you need to uncomment all the lines to install nvm first. 

[bash]

node -v
#curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.2/install.sh | bash
export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
#nvm install 13.6.0
nvm use 13.6.0
nvm list
node -v
[/bash]

Then you can add a npm install step, it will use the new node version. Or you can simply add node install command to the script.

--
Feng

星期四, 一月 09, 2020

[Youtube]峰哥教你玩正则表达式 - 第四课 - 或的关系和与(且)的关系及其原理(肯定前瞻)


Tags: regex, regular expression, regex101, 正则, 正则表达式, 前瞻, look ahead

本节课为正则表达式入门教程, 看完本视频你将掌握:

如何写"或"关系的正则
如何写"与"关系的正则
"与"关系是什么原理


视频中2分40多秒的时候, 有个口误 , 或关系的字符是竖线字符, 视频中讲成下划线字符.



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

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

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

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



其它博客地址

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