OpenWrt > ADSL单线多拨,负载均衡(仅供参考)
前题
- 硬件:路由器,刷入OpenWrt
- 一些背景知识和动手能力
目标效果图
步骤
- 使用SSH 登陆路由器。I.e. ssh root@192.168.2.1
- 运行/usr/bin/duobo。日志类似:
- sh: : unknown operand
- Killed
- Warning: Unable to locate ipset utility, disabling ipset support
- * Flushing IPv4 filter table
- * Flushing IPv4 nat table
- * Flushing IPv4 mangle table
- * Flushing IPv4 raw table
- * Flushing conntrack table ...
- * Populating IPv4 filter table
- * Zone 'lan'
- * Zone 'wan'
- * Rule 'Allow-DHCP-Renew'
- * Rule 'Allow-Ping'
- * Rule ''
- * Rule ''
- * Rule ''
- * Rule ''
- * Forward 'lan' -> 'wan'
- * Populating IPv4 nat table
- * Zone 'lan'
- * Zone 'wan'
- * Populating IPv4 mangle table
- * Zone 'lan'
- * Zone 'wan'
- * Populating IPv4 raw table
- * Zone 'lan'
- * Zone 'wan'
- * Set tcp_ecn to off
- * Set tcp_syncookies to on
- * Set tcp_window_scaling to on
- * Running script '/etc/firewall.user'
- * Running script '/usr/share/miniupnpd/firewall.include'
- * Running script '/usr/share/qos_gargoyle/firewall.include'
- ! Failed with exit code
- ___________________________________________________
- 开始第1次拔号...........
- 正在并发拔号中.............
- 等待3秒.............
- []拔[]拔成功, 小于设定的[]拔,将重新拔号...
- _________________________
- sh: : unknown operand
- 如果没有成功并发多播,根据提示信息调整duobo的内部参数设置,重新运行。分享一些技巧:
- number=10 #number是重拔次数,本脚本启动后一共尝试的次数
- n=7 #n是几拔,同时发出几拨,理论上设置越大成功概率越大!
- ok=2 #ok是拔上几次后退出拔号, 要实现的预期目标
- wait=5 #wait time 每次单线多拨失败后,重试的等待时间
- 原则:失败多次以后,建议冷重启路由器,多个运行中的脚本会互相冲突,把问题复杂化。
- 多拨失败以后,耐心等上1分钟;很多次的多播成功都是脚本完成以后退出,然后60秒内获取了超过预期的多条链接。
- 把n调到7,这样会虚拟出很多wan接口,根据硬件性能,理论上设置越大成功概率越大!
- 将ok调低一点,比如2。我觉得别太贪心,如果能稳定多播2个ADSL的IP,那其实概率上更折中了稳定性和高负载下的带宽均衡。
- wait的时间我感觉5秒-8秒差不多,这个要看运行日志,做相应调整。
- 看懂程序的原理,根据实际情况调整脚本程序。比如:这个版本的程序是这么多播的,ifup $prefix$i
- number=10 #number是重拔次数,本脚本启动后一共尝试的次数
遗留问题
- 开始第3次拔号...........
- 正在并发拔号中.............
- 等待10秒.............
- pppoe-wan Link encap:Point-to-Point Protocol
- pppoe-wan3 Link encap:Point-to-Point Protocol
- []拔[]拔成功, 大于或等于设定的[]拨,退出拔号...
- Error: an inet address is expected rather than "dev".
- iptables v1.4.10: Couldn't load target `zone_wan_notrack':File not found
- Try `iptables -h' or 'iptables --help' for more information.
- iptables v1.4.10: Couldn't load target `zone_wan_nat':File not found
- Try `iptables -h' or 'iptables --help' for more information.
- iptables: No chain/target/match by that name.
- iptables v1.4.10: Couldn't load target `zone_wan':File not found
- Try `iptables -h' or 'iptables --help' for more information.
- iptables: No chain/target/match by that name.
- iptables: No chain/target/match by that name.
- iptables: No chain/target/match by that name.
- iptables: No chain/target/match by that name.
- iptables: No chain/target/match by that name.
- iptables: No chain/target/match by that name.
- iptables: No chain/target/match by that name.
- Error: an inet address is expected rather than "dev".
- iptables v1.4.10: Couldn't load target `zone_wan_notrack':File not found
- Try `iptables -h' or 'iptables --help' for more information.
- iptables v1.4.10: Couldn't load target `zone_wan_nat':File not found
- Try `iptables -h' or 'iptables --help' for more information.
- iptables: No chain/target/match by that name.
- iptables v1.4.10: Couldn't load target `zone_wan':File not found
- Try `iptables -h' or 'iptables --help' for more information.
- iptables: No chain/target/match by that name.
- iptables: No chain/target/match by that name.
- iptables: No chain/target/match by that name.
- iptables: No chain/target/match by that name.
- iptables: No chain/target/match by that name.
- iptables: No chain/target/match by that name.
- iptables: No chain/target/match by that name.
- Error: an IP address is expected rather than "dev"
- 192.168.2.0/ dev br-lan proto kernel scope link src 192.168.2.1
- 221.218.232.1 dev pppoe-wan3 proto kernel scope link src 123.112.248.148
- 221.218.232.1 dev pppoe-wan proto kernel scope link src 221.218.236.51
- Kernel IP routing table
- Destination Gateway Genmask Flags Metric Ref Use Iface
- 192.168.2.0 0.0.0.0 255.255.255.0 U br-lan
- 221.218.232.1 0.0.0.0 255.255.255.255 UH pppoe-wan3
- 221.218.232.1 0.0.0.0 255.255.255.255 UH pppoe-wan
View Error Code
显然这个0.3版本的脚本不完全适用于我的路由器,有时间我需要查查原因。
估计都是关于iptables
有没有大侠探讨一下?
修正了下面版本中的一个错误
line 19:if [ $j -ge $ok ] ;
多拨代码(V0.3)
- #!/bin/sh
- #modified by muziling v0.
- #并发多拨脚本
- #number是重拔次数
- #n是几拔
- #ok是拔上几次后退出拔号
- #wait time
- number=
- n=
- ok=
- wait=
- # avoid same with feixiang's N-WAN naming and must start with "wan"
- prefix=wan
- vthprefix=vth
- j=$(ifconfig | grep pppoe-wan | wc -l)
- if [ "$j" >= "$ok" ] ;
- then
- echo 已经是[$j]拔了,退出拔号...
- exit
- fi
- if [ -f /etc/config/nwannumset ] ;
- then
- uci set nwannumset.@macvlan_numset[].macvlan_num=
- uci commit nwannumset
- fi
- for i in $( seq $(($n-)))
- do
- ifname=$prefix$i
- ifvth=$vthprefix$i
- #ifwan=$(uci get network.wan.ifname)
- pppoe_name=$(uci get network.wan.username)
- pppoe_pw=$(uci get network.wan.password)
- if [ $(ip link | grep " ${ifvth}@eth0.2:" | wc -l) == "" ] ;
- then
- macfac=$(ifconfig | grep eth0. | tr -s " " | cut -d " " -f5 | cut -b -)
- mac="$macfac:"$(md5sum /proc/sys/kernel/random/uuid | sed 's/\(..\)/&:/g' | cut -b - | tr [a-f] [A-F])
- ip link add link eth0. $ifvth type macvlan
- ifconfig $ifvth hw ether $mac
- fi
- # add /etc/config/network
- uci delete network.$ifname
- uci set network.$ifname=interface
- uci set network.$ifname.ifname=$ifvth
- #uci set network.$ifname._orig_ifname=eth0.
- #uci set network.$ifname._orig_bridge=false
- uci set network.$ifname.proto=pppoe
- uci set network.$ifname.username=$pppoe_name
- uci set network.$ifname.password=$pppoe_pw
- uci set network.$ifname.auto=
- uci set network.$ifname.defaultroute=
- uci set network.$ifname.peerdns=
- uci set network.$ifname.pppd_options="plugin rp-pppoe.so syncppp $n"
- # add /etc/config/dhcp
- uci delete dhcp.$ifvth
- uci set dhcp.$ifvth=dhcp
- uci set dhcp.$ifvth.interface=$ifname
- uci set dhcp.$ifvth.ignore=
- if [ -f /etc/config/nwan ] ;
- then
- uci delete nwan.$ifname
- uci set nwan.$ifname=interface
- uci set nwan.$ifname.name=telecom
- uci set nwan.$ifname.route=balance
- uci set nwan.$ifname.weight=
- uci set nwan.$ifname.uptime=0day,0hour,0min
- uci commit nwan
- fi
- done
- uci set network.wan.defaultroute=
- uci set network.wan.peerdns=
- uci set network.wan.pppd_options="plugin rp-pppoe.so syncppp $n"
- uci commit network
- uci commit dhcp
- fw_wan_list=$(uci show network |grep =interface |grep -v lan|grep -v loopback |cut -d"." -f2 | awk -F "=" '{printf $1" "}')
- uci set firewall.@zone[].network="$fw_wan_list"
- uci commit firewall
- /etc/init.d/firewall restart
- for q in $( seq $number )
- do
- echo
- echo ___________________________________________________
- echo 开始第$q次拔号...........
- killall -q -SIG pppd
- if [ "$q" == "" ] ;
- then
- for i in $( seq $(($n-)))
- do
- ifup $prefix$i
- done
- fi
- echo 正在并发拔号中.............
- echo 等待$wait秒.............
- sleep $wait
- j=$(ps | grep pppd | wc -l)
- ! [ "$j" -ge "$n" ] && ifup ${prefix}
- ifconfig|grep pppoe
- j=$(ifconfig | grep pppoe-wan | wc -l)
- ! [ "$j" -ge "$ok" ] && echo [$n]拔[$j]拔成功, 小于设定的[$ok]拔,将重新拔号...
- [ "$j" -ge "$ok" ] && echo [$n]拔[$j]拔成功, 大于或等于设定的[$ok]拨,退出拔号...
- if [ "$j" -ge "$ok" ] ;
- then
- for i in $( seq $(($n-)))
- do
- if [ "$i" == "" ] ;
- then
- interface=wan
- else
- interface=$prefix$i
- fi
- if [ $(ifconfig | grep "pppoe-$interface " | wc -l) == "" ] ;
- then
- ifdown $interface
- fi
- done
- break
- fi
- done
- # kill ddns sleep and re-check wan ip change
- killall sleep
- j=$(ifconfig | grep pppoe-wan | wc -l)
- ! [ "$j" -ge ] && reboot
- #ppoename=$(ifconfig |grep 'ppoe-' |awk '{print substr($1,7)}'|tr '\n' ' ')
- ppoename=$(ifconfig |grep 'ppoe-' |awk '{print $1}'|tr '\n' ' ')
- i=
- vias=""
- for wan_ifname in $ppoename
- do
- vias="$vias nexthop via $wan_ip dev $wan_ifname weight 1 "
- let "rt=100+$i"
- i=$(($i+))
- ip route flush table $rt
- ip route add default via $wan_ip dev $wan_ifname table $rt
- ip route add table $rt to $(ip route | grep br-lan)
- if [ $(iptables -t nat -vxnL POSTROUTING | grep -c " $wan_ifname ") == "" ] ;
- then
- iptables -t raw -A PREROUTING -i $wan_ifname -j zone_wan_notrack
- iptables -t nat -A PREROUTING -i $wan_ifname -j zone_wan_prerouting
- iptables -t nat -A POSTROUTING -o $wan_ifname -j zone_wan_nat
- iptables -t filter -A forward -i $wan_ifname -j zone_wan_forward
- iptables -t filter -A input -i $wan_ifname -j zone_wan
- iptables -t filter -A zone_wan_ACCEPT -o $wan_ifname -j ACCEPT
- iptables -t filter -A zone_wan_ACCEPT -i $wan_ifname -j ACCEPT
- iptables -t filter -A zone_wan_DROP -o $wan_ifname -j DROP
- iptables -t filter -A zone_wan_DROP -i $wan_ifname -j DROP
- iptables -t filter -A zone_wan_REJECT -o $wan_ifname -j reject
- iptables -t filter -A zone_wan_REJECT -i $wan_ifname -j reject
- fi
- iptables -A PREROUTING -t mangle -i $wan_ifname -j MARK --set-mark $rt
- iptables -t mangle -A zone_wan_MSSFIX -o $wan_ifname -p tcp -m tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu
- ip rule add fwmark $rt table $rt prio $rt
- done
- ip route del default
- ip route add default scope global $vias
- ip route flush cache
- ip route list
- route -n
- root@OpenWrt:~#
(duobo)
修订版(V0.3.1)
- #!/bin/sh
- #modified by muziling v0.
- #并发多拨脚本
- #modified by carl v0.3.1 (修正一处bug,改善友好提示信息)
- #number是重拔次数,本脚本启动后一共尝试的次数
- #n是几拔,同时发出几拨,理论上设置越大成功概率越大!
- #ok是拔上几次后退出拔号, 要实现的预期目标
- #wait time 每次单线多拨失败后,重试的等待时间
- number=
- n=
- ok=
- wait=
- # avoid same with feixiang's N-WAN naming and must start with "wan"
- prefix=wan
- vthprefix=vth
- j=$(ifconfig | grep pppoe-wan | wc -l)
- if [ $j -ge $ok ] ;
- then
- echo 已经是[$j]拔了,退出拔号程序。
- exit
- fi
- if [ -f /etc/config/nwannumset ] ;
- then
- uci set nwannumset.@macvlan_numset[].macvlan_num=
- uci commit nwannumset
- fi
- for i in $( seq $(($n-)))
- do
- ifname=$prefix$i
- ifvth=$vthprefix$i
- #ifwan=$(uci get network.wan.ifname)
- pppoe_name=$(uci get network.wan.username)
- pppoe_pw=$(uci get network.wan.password)
- if [ $(ip link | grep " ${ifvth}@eth0.2:" | wc -l) == "" ] ;
- then
- macfac=$(ifconfig | grep eth0. | tr -s " " | cut -d " " -f5 | cut -b -)
- mac="$macfac:"$(md5sum /proc/sys/kernel/random/uuid | sed 's/\(..\)/&:/g' | cut -b - | tr [a-f] [A-F])
- ip link add link eth0. $ifvth type macvlan
- ifconfig $ifvth hw ether $mac
- echo 更换MAC完毕$ifvth.
- fi
- # add /etc/config/network
- uci delete network.$ifname
- uci set network.$ifname=interface
- uci set network.$ifname.ifname=$ifvth
- #uci set network.$ifname._orig_ifname=eth0.
- #uci set network.$ifname._orig_bridge=false
- uci set network.$ifname.proto=pppoe
- uci set network.$ifname.username=$pppoe_name
- uci set network.$ifname.password=$pppoe_pw
- uci set network.$ifname.auto=
- uci set network.$ifname.defaultroute=
- uci set network.$ifname.peerdns=
- uci set network.$ifname.pppd_options="plugin rp-pppoe.so syncppp $n"
- # add /etc/config/dhcp
- uci delete dhcp.$ifvth
- uci set dhcp.$ifvth=dhcp
- uci set dhcp.$ifvth.interface=$ifname
- uci set dhcp.$ifvth.ignore=
- if [ -f /etc/config/nwan ] ;
- then
- uci delete nwan.$ifname
- uci set nwan.$ifname=interface
- uci set nwan.$ifname.name=unicom
- uci set nwan.$ifname.route=balance
- uci set nwan.$ifname.weight=
- uci set nwan.$ifname.uptime=0day,0hour,0min
- uci commit nwan
- fi
- done
- uci set network.wan.defaultroute=
- uci set network.wan.peerdns=
- uci set network.wan.pppd_options="plugin rp-pppoe.so syncppp $n"
- uci commit network
- uci commit dhcp
- fw_wan_list=$(uci show network |grep =interface |grep -v lan|grep -v loopback |cut -d"." -f2 | awk -F "=" '{printf $1" "}')
- uci set firewall.@zone[].network="$fw_wan_list"
- uci commit firewall
- /etc/init.d/firewall restart
- for q in $( seq $number )
- do
- echo
- echo ___________________________________________________
- echo 开始第$q次拔号...........
- killall -q -SIG pppd
- if [ "$q" == "" ] ;
- then
- for i in $( seq $(($n-)))
- do
- ifup $prefix$i
- done
- fi
- echo 正在并发拔号中.............
- echo 等待$wait秒.............
- sleep $wait
- j=$(ps | grep pppd | wc -l)
- ! [ "$j" -ge "$n" ] && ifup ${prefix}
- ifconfig | grep pppoe
- j=$(ifconfig | grep pppoe-wan | wc -l)
- ! [ "$j" -ge "$ok" ] && echo [$n]拔[$j]拔成功, 小于设定的[$ok]拔,将重新拔号...
- [ "$j" -ge "$ok" ] && echo [$n]拔[$j]拔成功, 大于或等于设定的[$ok]拨,退出拔号...
- if [ "$j" -ge "$ok" ] ;
- then
- for i in $( seq $(($n-)))
- do
- if [ "$i" == "" ] ;
- then
- interface=wan
- else
- interface=$prefix$i
- fi
- if [ $(ifconfig | grep "pppoe-$interface " | wc -l) == "" ] ;
- then
- ifdown $interface
- fi
- done
- break
- fi
- done # done/tried all tring times $number
- # kill ddns sleep and re-check wan ip change
- killall sleep
- # reboot the machine if failed tried times
- #sleep $wait
- j=$(ifconfig | grep pppoe-wan | wc -l)
- ! [ "$j" -gt ] && reboot
- echo ___________________________________________________
- echo 开始N-WAN负载均衡功能...
- #ppoename=$(ifconfig |grep 'ppoe-' |awk '{print substr($1,7)}'|tr '\n' ' ')
- ppoename=$(ifconfig|grep 'ppoe-' |awk '{print $1}'|tr '\n' ' ')
- i=
- vias=""
- for wan_ifname in $ppoename
- do
- vias="$vias nexthop via $wan_ip dev $wan_ifname weight 1 "
- let "rt=100+$i"
- i=$(($i+))
- ip route flush table $rt
- #REMOVE ERROR
- ip route add default via $wan_ip dev $wan_ifname table $rt
- ip route add table $rt to $(ip route | grep br-lan)
- if [ $(iptables -t nat -vxnL POSTROUTING | grep -c " $wan_ifname ") == "" ] ;
- then
- #REMOVE ERROR
- iptables -t raw -A PREROUTING -i $wan_ifname -j zone_wan_notrack
- iptables -t nat -A PREROUTING -i $wan_ifname -j zone_wan_prerouting
- #REMOVE ERROR
- iptables -t nat -A POSTROUTING -o $wan_ifname -j zone_wan_nat
- iptables -t filter -A forward -i $wan_ifname -j zone_wan_forward
- #REMOVE ERROR
- iptables -t filter -A input -i $wan_ifname -j zone_wan
- iptables -t filter -A zone_wan_ACCEPT -o $wan_ifname -j ACCEPT
- iptables -t filter -A zone_wan_ACCEPT -i $wan_ifname -j ACCEPT
- iptables -t filter -A zone_wan_DROP -o $wan_ifname -j DROP
- iptables -t filter -A zone_wan_DROP -i $wan_ifname -j DROP
- iptables -t filter -A zone_wan_REJECT -o $wan_ifname -j reject
- iptables -t filter -A zone_wan_REJECT -i $wan_ifname -j reject
- fi
- iptables -A PREROUTING -t mangle -i $wan_ifname -j MARK --set-mark $rt
- iptables -t mangle -A zone_wan_MSSFIX -o $wan_ifname -p tcp -m tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu
- ip rule add fwmark $rt table $rt prio $rt
- done
- ip route del default
- echo ___________________________________________________
- echo 下面执行ip route add default scope global $vias
- ip route add default scope global $vias
- ip route flush cache
- echo ___________________________________________________
- echo 下面输出ip route list
- ip route list
- echo ___________________________________________________
- echo 下面输出route -n
- route -n
参考文献
OpenWrt For AR71xx系列 ar2 Tr 脱机 N-WAN r48549
自己动手 4530R 脱机 Samba U-BOOT 多拨(11-04更新部分问题说明,请看2楼)
[0916更新]WR703N WR720N 及其他各类 OpenWRT类路由实现一号多拨带宽叠加教程
OpenWrt > ADSL单线多拨,负载均衡(仅供参考)的更多相关文章
- Unity上一页下一页切换功能实现源码(仅供参考)
在做项目时我们有时需要实现切换上一页下一页图片,切换上一首下一首歌曲等等类似的功能.这里写了个简单的实现源码(仅供参考),要是有更好的方法欢迎提出来,共同进步~ 以切换上一页下一页图片为例: usin ...
- Ubuntu 12.04 分区方案(仅供参考)
Ubuntu 12.04 分区方案(仅供参考) 总空间大小:50G 目录 建议大小 实际大小 格式 描述 / 10G~20G 10G ext4 根目录 swap <2048M 1G swap ...
- VSS的运用小内容(针对于vs2008版本)(小的问题都是,仅供参考--只针对于菜鸟级的)
自己开始接触vss 的时候有些小的习惯没有很好的养成,下面的有关VSS内容都是简单的迁入迁出的问题,(仅供参考) 1.文件的迁入迁出:(.txt..xlsx..doc) a:文件的覆盖问题: 对于文件 ...
- mysql 千万级数据查询效率实践,分析 mysql查询优化实践--本文只做了一部分,仅供参考
数据量, 1300万的表加上112万的表 注意: 本文只做了部分优化,并不全面,仅供参考, 欢迎指点. 请移步tim查看,因为写的时候在tim写的,粘贴过来截图有问题,就直接上链接了. https ...
- jdk1.8+SpringAOP注解报java.lang.IllegalArgumentException: error at ::0 can't find referenced pointcut select错误的不知原因的解决办法[仅供参考]
先说办法:如果Aspectweaver-1.*.*jar这三个包版本比较低, 比如1.5.0这一层次的,可以找版本高一点的包替换低版本的包,问题可以得到解决 jar包的下载地址:https://mvn ...
- normalizr实践使用(个人总结,仅供参考)
# normalizr实践使用 原数据 (自编数据,本数据仅供参考) var aaaObj ={ "id" : "0000000000000000000000000000 ...
- 第二步 (仅供参考) sencha touch 使用cmd打包apk
最新版本的cmd可以直接将sencha touch项目打包成本地应用,不过还有很多不足,本文仅供参考 通过sencha app build native命令可以直接将项目打包成本地应用,不过在命令运行 ...
- 2019第十届蓝桥杯C++B组题解(赛后重写的,不确保答案正确性,仅供参考)
先说一下这次的感受吧,我们考场比较乱,开始比赛了,还有的电脑有故障,(向这些人发出同情),第一次认真参加比赛,真正比赛的时候感觉没有那么正式,很乱,各种小问题,(例如博主就没找到题目在哪里,找到后又不 ...
- 分享分享JavaScript100例-仅供参考
最近一直在做项目,分享下以前收集的Javascript100例,仅供参考. http://files.cnblogs.com/52net/JavaScript100例.zip
随机推荐
- sublime通用快捷键 汉化 安装 插件
Ctrl+Alt+P 切换项目 1.Ctrl+Shift+P 打开Package Control Ctrl + Shift + P ,输入View, 选择Toogle Tabs ...
- C#面试(2016年4月)
1.WebForm和MVC的区别 MVC: 1)通过model.view.controller将处理后台逻辑代码与前台展示逻辑代码进行了很好的分离: 2)通过修改路由规则,可以控制生成自定义的url, ...
- 关于jsp的总结
第一章:jsp技术不仅是开发web应用的先进技术,而且是进一步学习相关技术的基础.jsp引擎是支持jsp程序的web容器,负责运行jsp,并将有关结果发送到客户端.目前流行的jsp引擎之一是tomca ...
- sql rank()函数
RANK() OVER([<partiton_by_clause>]) partition_by_clause 将from子句生成的结果集划分为应用到RANK函数的分区. Order_b ...
- SqlServer try catch 捕获不到的一些错误及解决方法(转载)
测试注意 :①假如系统能捕获异常 ,并且我们自己开启了事务.系统会自动 回滚事务的,但是 我们还是要在catch里面加上 rollback tran的习惯,这样也不会提示重复rollback的错误,这 ...
- LDAP的Schema
Schema是LDAP的一个重要组成部分,类似于数据库的模式定义,LDAP的Schema定义了LDAP目录所应遵循的结构和规则,比如一个 objectclass会有哪些属性,这些属性又是什么结构等等, ...
- struts2 jquery ajaxFileUpload 异步上传文件
网上搜集的,整理一下. 一.ajaxFileUpload 实现异步上传文件利用到了ajaxFileUpload.js这个文件,这是别人开发的一个jquery的插件,可以实现文件的上传并能够和strut ...
- Python 多线程教程:并发与并行
转载于: https://my.oschina.net/leejun2005/blog/398826 在批评Python的讨论中,常常说起Python多线程是多么的难用.还有人对 global int ...
- Hdu 2845 Beans
Beans Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submi ...
- 关于ES6的 模块功能 Module 中export import的用法和注意之处
export default 的用法 export default命令用于指定模块的默认输出.显然,一个模块只能有一个默认输出,因此export deault命令只能使用一次.所以,import命令后 ...