这个说起来其实非常简单,但是你随便用中文在google或者百度上搜索一下,都是旧的版本的使用方式.
新的版本的使用,可以参考这个.
https://www.freecodecamp.org/news/how-to-sync-vs-code-settings-between-multiple-devices-and-environments/
这个说起来其实非常简单,但是你随便用中文在google或者百度上搜索一下,都是旧的版本的使用方式.
新的版本的使用,可以参考这个.
https://www.freecodecamp.org/news/how-to-sync-vs-code-settings-between-multiple-devices-and-environments/
写一些简单的爬虫的时候会用到,来源于这里(经常更新):
https://techblog.willshouse.com/2012/01/03/most-common-user-agents/
Last Updated: Mon, 16 Aug 2021 11:05:50 +0000
percent | useragent | system |
---|---|---|
10.1% | Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.131 Safari/537.36 | Chrome 92.0 Win10 |
8.7% | Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.107 Safari/537.36 | Chrome 92.0 Win10 |
6.0% | Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:90.0) Gecko/20100101 Firefox/90.0 | Firefox 90.0 Win10 |
4.8% | Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36 | Chrome 91.0 Win10 |
4.7% | Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.164 Safari/537.36 | Chrome 91.0 Win10 |
3.8% | Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.107 Safari/537.36 | Chrome 92.0 macOS |
2.9% | Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.131 Safari/537.36 | Chrome 92.0 macOS |
2.6% | Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1.1 Safari/605.1.15 | Safari Generic macOS |
2.4% | Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.114 Safari/537.36 | Chrome 91.0 macOS |
2.2% | Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1.2 Safari/605.1.15 | Safari Generic macOS |
2.2% | Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:90.0) Gecko/20100101 Firefox/90.0 | Firefox 90.0 Linux |
2.0% | Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.164 Safari/537.36 | Chrome 91.0 macOS |
2.0% | Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:90.0) Gecko/20100101 Firefox/90.0 | Firefox 90.0 macOS |
1.9% | Mozilla/5.0 (Windows NT 10.0; rv:78.0) Gecko/20100101 Firefox/78.0 | Firefox 78.0 Win10 |
1.7% | Mozilla/5.0 (X11; Linux x86_64; rv:90.0) Gecko/20100101 Firefox/90.0 | Firefox 90.0 Linux |
1.5% | Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:89.0) Gecko/20100101 Firefox/89.0 | Firefox 89.0 Win10 |
1.4% | Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.107 Safari/537.36 Edg/92.0.902.55 | Edge 92.0 Win10 |
1.2% | Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Firefox/91.0 | Firefox 91.0 Win10 |
1.2% | Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.131 Safari/537.36 Edg/92.0.902.67 | Edge 92.0 Win10 |
1.1% | Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.107 Safari/537.36 Edg/92.0.902.62 | Edge 92.0 Win10 |
1.0% | Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.107 Safari/537.36 | Chrome 92.0 Linux |
0.9% | Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0 | Firefox 78.0 Linux |
0.7% | Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.131 Safari/537.36 | Chrome 92.0 Linux |
0.7% | Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.114 Safari/537.36 | Chrome 91.0 Linux |
0.6% | Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36 Edg/91.0.864.70 | Edge 91.0 Win10 |
0.6% | Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.164 Safari/537.36 OPR/77.0.4054.277 | Opera Generic Win10 |
0.6% | Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.164 Safari/537.36 | Chrome 91.0 Linux |
0.6% | Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.131 Safari/537.36 | Chrome 92.0 Win7 |
0.5% | Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:89.0) Gecko/20100101 Firefox/89.0 | Firefox 89.0 macOS |
0.5% | Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.164 Safari/537.36 Edg/91.0.864.71 | Edge 91.0 Win10 |
0.5% | Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.115 Safari/537.36 | Chrome 92.0 Win10 |
0.5% | Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1.1 Safari/605.1.15 | Safari Generic macOS |
0.4% | Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Firefox/91.0 | Firefox 91.0 macOS |
0.4% | Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0.3 Safari/605.1.15 | Safari 14.0 macOS |
0.4% | Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.107 Safari/537.36 | Chrome 92.0 Win7 |
0.4% | Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0 | Firefox 78.0 Win10 |
0.4% | Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:90.0) Gecko/20100101 Firefox/90.0 | Firefox 90.0 Win7 |
0.4% | Mozilla/5.0 (Windows NT 10.0; rv:91.0) Gecko/20100101 Firefox/91.0 | Firefox 91.0 Win10 |
0.4% | Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1 Safari/605.1.15 | Safari Generic macOS |
0.4% | Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Firefox/91.0 | Firefox 91.0 Linux |
0.3% | Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:90.0) Gecko/20100101 Firefox/90.0 | Firefox 90.0 Linux |
0.3% | Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:89.0) Gecko/20100101 Firefox/89.0 | Firefox 89.0 Linux |
0.3% | Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36 Edg/91.0.864.67 | Edge 91.0 Win10 |
0.3% | Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36 | Chrome 76.0 Win10 |
0.3% | Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.114 Safari/537.36 | Chrome 91.0 Win10 |
0.3% | Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:91.0) Gecko/20100101 Firefox/91.0 | Firefox 91.0 Linux |
0.3% | Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.0 Safari/605.1.15 | Safari Generic macOS |
0.3% | Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Safari/537.36 | Chrome 91.0 Win10 |
0.2% | Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36 OPR/77.0.4054.203 | Opera Generic Win10 |
0.2% | Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.107 Safari/537.36 | Chrome 92.0 Win8.1 |
0.2% | Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1.2 Safari/605.1.15 | Safari 13.1 macOS |
0.2% | Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.114 Safari/537.36 | Chrome 91.0 macOS |
0.2% | Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36 | Chrome 91.0 Win7 |
0.2% | Mozilla/5.0 (X11; Linux x86_64; rv:89.0) Gecko/20100101 Firefox/89.0 | Firefox 89.0 Linux |
0.2% | Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.107 Safari/537.36 | Chrome 92.0 macOS |
0.2% | Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.164 Safari/537.36 OPR/77.0.4054.275 | Opera Generic Win10 |
0.2% | Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:90.0) Gecko/20100101 Firefox/90.0 | Firefox 90.0 macOS |
0.2% | Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36 | Chrome 91.0 Win8.1 |
0.2% | Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36 | Chrome 91.0 macOS |
0.2% | Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.131 Safari/537.36 Edg/92.0.902.73 | Edge 92.0 Win10 |
0.2% | Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.131 Safari/537.36 OPR/78.0.4093.147 | Opera Generic Win10 |
0.2% | Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1.3 Safari/605.1.15 | Safari 13.1 macOS |
0.2% | Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.93 Safari/537.36 | Chrome 90.0 Win10 |
0.2% | Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:90.0) Gecko/20100101 Firefox/90.0 | Firefox 90.0 macOS |
0.2% | Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1.2 Safari/605.1.15 | Safari Generic macOS |
0.2% | Mozilla/5.0 (Windows NT 6.3; Win64; x64; rv:90.0) Gecko/20100101 Firefox/90.0 | Firefox 90.0 Win8.1 |
0.2% | Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Firefox/78.0 | Firefox 78.0 macOS |
0.2% | Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.164 Safari/537.36 | Chrome 91.0 macOS |
0.2% | Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:91.0) Gecko/20100101 Firefox/91.0 | Firefox 91.0 Win7 |
0.2% | Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.131 Safari/537.36 | Chrome 92.0 Win8.1 |
0.2% | Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36 | Chrome 90.0 Linux |
今天收了一台leaseweb服务器,上面有两个IP range,主IP是/29, 第二个IP range是/24.
第二个/24 IP range, 没有自己的gateway IP 和 broadcast IP,是因为直接把这个IP range static route 到服务器的主IP,这样做的好处是省了两个IP. 但是对于虚拟化来说,这却是个不好的消息. 因为没有gateway,需要自己设置一个gateway,比较麻烦. 下面是搜索到的解决方案:
1) 来自于WHT:
https://www.webhostingtalk.com/showthread.php?t=1411451
————————————–
1) Secondary IP blocks are delivered as a static route towards the main IP of the server. I f you are binding these IPs directly to your machine, you should use a 255.255.255.255 netmask for each IP to allow all IPs to be usable. If you are performing virtualization with anything other than OpenVZ, then you would need to establish a gateway in the secondary block and subnet accordingly on your side. --- 2) Secondary ranges are statically routed towards the main IP of the server itself and there is no defined gateway on our side. If you are using these directly on the machine or with OpenVZ, then no special configuration is needed and all IPs within the secondary subnet may be utilized without waste for a network, gateway, or broadcast. If you are configuring with Xen, KVM, or other similar methods of virtualization, you would need to setup a routed bridge to create a gateway for your VMs.
2) 来自于lowendtalk
https://www.lowendtalk.com/discussion/167250/proxmox-on-buyvm-routing https://www.lowendtalk.com/discussion/122957/routing-ip-address-on-a-network-bridge
3) 来自于iweb.com, 在他们的knowledgebase 直接写了几个example, 如果用hyper-v 或者proxmox 的话会非常舒服,用esxi 的话也基本上是一个原理.
在Linux下:
Additional IPs at iWeb are not provided with an additional gateway so customers using VMWare or other virtualization tools might be wondering how they can use the additional IPs to create new Guest OS or Virtual Machines. It can be done by configuring VMWare to bridge connection to eth0.
Here is the specific way to make it work
Configure your first additional IP as a secondary IP on eth0:0
IP configuration is done in /etc/sysconfig/network-scripts/ifcfg-eth0:0
Enable IP forwarding to route VM traffic
IP forwarding can be enabled by adding net.ipv4.ip_forward = 1 to /etc/sysctl.conf
In VMWare make sure that your VM uses the bridge connection to eth0.
Configure your VM with one of your remaining 5 additional IPs.
The netmask is 255.255.255.248 (If you have been provided with 6 IPs). You can calculate the netmask via a website such as http://www.ipcalc.net/
Use XX.XX.XX.1 as the gateway
Example with actual IPs:
If you have been assigned the following additional IPs:
72.55.155.169
72.55.155.170
72.55.155.171
72.55.155.172
72.55.155.173
72.55.155.174
You would :
Configure the ip 72.55.155.169 as a secondary IP on eth0:0
Enable IP forwarding to route VM traffic
Make sure that your VM uses the bridge connection to eth0
Configure your VM with one of the available IPs (.170, .171, .172, .173 or .174)
Use 255.255.255.248 as the Netmask.
Use 72.55.155.169 as gateway.
Your VM’s network should now be properly configured!
在windows下:
This document takes in consideration that the host server network interface is configured with the following network configuration
Primary IP: <your primary ip address>
Netmask: 255.255.255.224
Gateway: <your primary ip address gateway>
Secondary IP: <your secondary ip address>
Netmask: 255.255.255.248
Gateway: <your primary ip address gateway>:
The secondary IP is crucial since it acts as a gateway for the virtual machine, in this case we used the first IP of the range.
Step 1. Enable bridged network configuration on virtual network interfaces
Open Start->Program Files->Vmware->Vmware server->Manage Virtual network
Open the Automatic bridging tab
Uncheck the automatic bridging
Open the Host Virtual Network Mapping tab
In the vmnet0 drop down menu select the interfaces which is configured with your primary address
Close the virtual network manager
Open Start->Program Files->Vmware->Vmware server-> Vmware server
Within the summary of the vm set the network interface for each vm to bridged
Step 2. Configure vm virtual network interfaces
Open the vm you wish to configure
Open Start->Network Connections (within the vm)
Configure the network interface with one of your secondary ip address (except the secondary ip you are using on the main host):
IP: <another secondary ip address>
Netmask: 255.255.255.248
Gateway: <the main host secondary ip address>
Step 3. Enable routing and remote access
Mare sure the windows firewall is disabled.
Routing and Remote access must be enabled on the main host as well as the vm’s
Open Start->Administrative Tools->Routing and Remote access
Right-click on the server
Select Configure and Enable Routing and Remote access
Select Custom configuration, click next
Select LAN Routing, click next
Click Finish
Make sure the service is started
Update: Since September 2012, iWeb provides a /28 range of primary IP. It allows you to use the same gateway for the VM as well as the host itself in bridge mode.
https://miketabor.com/how-to-upgrade-vcenter-server-appliance-6-7-to-7-0/
在升级vCSA的时候经常用到:
https://knowledge.broadcom.com/external/article/326316/build-numbers-and-versions-of-vmware-vce.html
在升级ESXi的时候经常用到.
https://knowledge.broadcom.com/external/article/316595/build-numbers-and-versions-of-vmware-esx.html
awk 的用法实在太多了,网上的文章写的也很乱,下面的两篇文章写的非常的好,在以后写shell 脚本的过程中可以使用:
https://einverne.github.io/post/2018/01/awk.htmlAWK 简明教程
第一种方法, 根据这篇文章所说:
float=1.23 int=${float%.*}
第二种方法: 使用bc 命令
$ echo "($float+0.5)/1" | bc
第三种方法: 使用 printf
$ myduration=6.5 $ myduration=$( printf "%.0f" $myduration ) $ echo $myduration 6
四种模式匹配替换结构:
${var%pattern},${var%%pattern},${var#pattern},${var##pattern}
第一种模式:${variable%pattern},这种模式时,shell在variable中查找,看它是否一给的模式pattern结尾,如果是,就从命令行把variable中的内容去掉右边最短的匹配模式
第二种模式: ${variable%%pattern},这种模式时,shell在variable中查找,看它是否一给的模式pattern结尾,如果是,就从命令行把variable中的内容去掉右边最长的匹配模式
第三种模式:${variable#pattern} 这种模式时,shell在variable中查找,看它是否一给的模式pattern开始,如果是,就从命令行把variable中的内容去掉左边最短的匹配模式
第四种模式: ${variable##pattern} 这种模式时,shell在variable中查找,看它是否一给的模式pattern结尾,如果是,就从命令行把variable中的内容去掉右边最长的匹配模式
这四种模式中都不会改变variable的值,其中,只有在pattern中使用了*匹配符号时,%和%%,#和##才有区别。结构中的pattern支持通配符,*表示零个或多个任意字符,?表示零个或一个任意字符,[…]表示匹配中括号里面的字符,[!…]表示不匹配中括号里面的字符
bogon:/home/bash # var=testcase bogon:/home/bash # echo $var testcase bogon:/home/bash # echo ${var%s*e} testca bogon:/home/bash # echo $var testcase bogon:/home/bash # echo ${var%%s*e} te bogon:/home/bash # echo ${var#?e} stcase bogon:/home/bash # echo ${var##?e} stcase bogon:/home/bash # echo ${var##*e} bogon:/home/bash # echo ${var##*s} e bogon:/home/bash # echo ${var##test} case