In this paper, the scene
When writing HTML using VS Code, the imported JS file needs to import modules across domains.
why
Use File protocol, need to use HTTP, Data, Chrome-Extension, Edge, HTTPS and other protocols, commonly speaking is the need to use the server to open a port.
The solution
Right click directly in VS Code and select Open with Live Server.
Centos7 installing Kafka
website: http://kafka.apache.org/
enter the url: http://kafka.apache.org/downloads
System environment
1, the operating system: 64 CentOS7
2, JDK version: 1.8.0 comes with _271 version
3, they are: they are – 3.4.6
4, three server deployment success: 192.168.192.150; 192.168.192.152; 192.168.192.155;
Pre-setting:
[root@localhost /]# timedatectl set-timezone Asia/Shanghai
root@localhost /]# timedatectl
[root@localhost /]# timedatectl
[root@localhost /]# timedatectl
[root@localhost /]# timedatectl
[root@master /]# yum-y install NTP
p1
[>daoplaceholder1 /]# ntpdate ntp1.aliyun.com
hostname ectl set-hostname master
stname ectl set-hostname node1
h>ame ectl set-hostname node2
hostname ectl set-hostname node2
hostname ectl set-hostname node2
hostname ectl set-hostname node2
192.168.192.150 master
2.168.192.152 node1
1>68.192.155 node2
192.168.192.155
127.0.0.1 localhost
: 1 localhost
1>68.93.150 master
192.168>152 node1
192.168.93.15>de2
192.168.93.155 node2
192.168.93.155 node2
192.168.93.155 nod> br> If you change the hosts in Windows 10, you can copy this file to the desktop and add the above contents. Then replace the hosts file under C:\Windows\System32\ Drivers \etc with
.
props. Put (consumerConfig. Bootstrap_servers_config,”node1:9092,node2:9092″);
tar-zxvf /usr/local/soft/kafka_2.11-2.2.0.tgz -c /usr/local/ kafka
tar-zxvf /usr/local/soft/kafka_2.11-2.2.0.tgz -c /usr/local/
2, configuration, kafka
[root @ localhost] # vi/usr/local/kafka_2. 11-2.2.0/config/server properties
Kafka’s configuration information is configured in server.properties
Find the following two lines of code and comment them separately
#broker.id=0
#zookeeper.connect=localhost:2181
Modify the directory where the logs are stored
The log. The dirs =/kafka_2. 11-2.2.0/kafka – logs
Add the following three configurations at the bottom of the file:
Broker. Id = 1
zookeeper. Connect = 192.168.192.150:2181192168 192.152:2181192168 192.155:2181
Listeners = PlainText :// Master :9092 Listeners :// Master :9092
[root@localhost local]# CD kafka2.11-2.2.0 /
root@localhost kafka2.11-2.2.0]# mkdir kafka-logs
[root@localhost local]# CD kafka2.11-2.2.0 /
[root@localhost kafka2.11-2.2.0]# mkdir kafka-logs
Note: If it is a stand-alone version, the default is fine, we do not need to change anything. Now we are configuring the cluster, so we need to configure some parameters
1), Broker. id: Each machine cannot be the same
2), ZooKeeper. Connect: Since I have 3 ZooKeeper servers, I set ZooKeeper. Connect to 3 servers and must add all of them
3), Listeners: Listeners must be set when configuring the cluster, otherwise the leader error will not be found for future operations
WARN [Producer clientId = console – Producer] Error while fetching the metadata with the correlation id 40: {test = LEADER_NOT_AVAILABLE} workClient (org.apache.kafka.clients.Net)
4) Notice that the two servers, ZooKeeper. Connect, are configured the same as here, but the Broker. ID and Listeners cannot be configured the same
5 copies, kafka to two other servers
[root @ localhost config] # SCP – r/usr/local/kafka_2. 11-2.2.0 [email protected]:/usr/local/
[root @ localhost config] # SCP – r/usr/local/kafka_2. 11-2.2.0 [email protected]:/usr/local /
You will be asked to enter the password of the target machine. Just follow the instructions and modify the Broker. id and Listeners of the two servers as follows:
6, 192.168.192.152
[root @ localhost] # vi/usr/local/kafka_2. 11-2.2.0/config/server properties
Then a change on the broker. Id = 2 and listeners = PLAINTEXT:// 192.168.192.152:9092, the zookeeper. Connect don’t need to change are the same
Broker.
id = 2 zookeeper. Connect = 192.168.192.150:2181192168 192.152:2181192168 192.155:2181
listeners = PLAINTEXT:// node1:9092
7, 192.168.192.155
[root @ localhost] # vi/usr/local/kafka_2. 11-2.2.0/config/server properties
Then a change on the broker. Id = 3 and listeners = PLAINTEXT:// 192.168.192.155:9092, the zookeeper. Connect don’t need to change are the same
Broker. Id = 3
zookeeper. Connect = 192.168.192.150:2181192168 192.152:2181192168 192.155:2181
listeners = PLAINTEXT:// 2:9092
If the firewall has been turned off, it can be ignored.
All three machines must be turned on. Kafka communication is conducted through port 9092 by default, which is the Listed Listeners we have provided above
[root@localhost config]# firewall-cmd –zone=public –add-port=9092/tcp –permanent
[root@localhost config]# firewall-cmd –reload
[root@localhost /]# /usr/local/ ZooKeeper -3.4.6/bin/ zkserver.sh start
[root@localhost /]# /usr/local/ ZooKeeper -3.4.6/bin/ zkserver.sh start
[root@localhost /]# /usr/local/ ZooKeeper -3.4.6/bin/ zkserver.sh start
10, start, kafka,
three is to launch the
[root @ localhost /] #/usr/local/kafka_2. 11-2.2.0/bin/kafka – server – start. Sh – daemon/usr/local/kafka_2. 11-2.2.0/config/server properties
[root@localhost /]# JPS
87 JPS
9>kafka
9224 Kafka
9224 Kafka
[root@localhost /]# CD /usr/local/kafka_2.11-2.2.0/
root@localhost kafka_2.11-2.2.0]# bin/ kafka-Topics. Sh –create — ZooKeeper 192.168.192.150:2181 –replication-factor 1 –partitions 1 –topic test
Created topic test.
If successful, it outputs: Created Topic “test”.
13, see the topic
while 192.168.192.150 created on the topic, but the other two machine also can see that the 192.168.192.152 client
[root@localhost /]# CD /usr/local/kafka_2.11-2.2.0/
[root@localhost kafka_2.11-2.2.0]# bin/ kafka-Topics — List — ZooKeeper 192.168.192.152:2181
st
Note: The IP here can be 192.168.192.150, 192.168.192.152, 192.168.192.155. Themes can be seen on any of the three servers
root@localhost kafka_2.11-2.2.0]# bin/kafka-console-producer.sh –broker — list 192.168.192.150:9092 –topic test
>> a
> b
> c
# bin/kafka-console-consumer.sh –bootstrap-server 192.168.192.152:9092 — Topic test –from — Beginning
a
c>
Running course of Kafka in Windows Environment
Start ZooKeeper, run CMD and type
zkserver
E:\kafka\kafka_2.12-2.3.0
en run
.\> \ Windows \kafka-server-start.bat.\config\server.properties
CMD
: \kafka\kafka_2.12-2.3.0
<>> kafka-t>s. Bat –create –zookeeper localhost:2181 –replication-factor 1 –partitions 1-topic test
Producer
run CMD, enter kafka bin\ Windows folder
: \kafka\kafka_2.12-2.3.0\bin\ Windows
t>run
kafka-c>le-producer.bat — broke-list localhost:9092 –topic test
E:\kafka\kafka_2.12-2.3.0\bin\ Windows
en run
k>-console-consumer.bat –bootstrap-server localhost:9092 –topic test –from — beginning
There is no windows solution in dual system Ubuntu grub startup
After installing Ubuntu16.04, Win10 from the GRUB menu was somehow missing. (If you don’t even have GRUB on display, click on Windows 10 to install Ubuntu.)
Goal: Access Win10 from Ubuntu GRUB.
Implementation:
The terminal executes the following commands in turn
sudo grub-install /dev/sda
sudo chmod -x /etc/grub.d/30_os-prober
sudo gedit /etc/grub.d/40_custom
Enter the following in the 40_custom file that opens:
menuentry 'Win10' {
insmod part_gpt
insmod chain
insmod ntfs
set root='(hd0,gpt1)'
chainloader /EFI/Microsoft/Boot/bootmgfw.efi
}
The terminal continues to execute sudo update-grub
The file /boot/grub/grub.cfg has been changed.
After rebooting, the Win10 option appears in the GRUB menu.
More:
If need to modify the order of the grub or modify grub background:
this is grub Customizer installation method: https://www.tuziang.com/combat/635.html
How to disable icloud drive on Mac?
ICloud Drive is a very useful feature that makes it easy to share files and documents between your devices (including other Macs, iPhones, and iPads) by automatically synchronizing and copying files between devices, so you should only disable iCloud Drive if you don’t have it enabled. So how to disable the iCloud drive on the Mac, there is a need for friends to welcome the reference!

Please note that this is disabling iCloud Drive completely on the Mac, not just disabling the iCloud desktop and documents that only store these two directories in iCloud.
Before attempting this step, make sure your Mac has a valid Internet connection.
The specific methods are as follows
1. Go to the Apple icon in the menu bar and select “System Preferences”.
2. Select “iCloud Settings”.
3. Uncheck the iCloud drive next to this check box.

4. Make sure to disable the iCloud drive and remove the iCloud files from your Mac.
You now have two options to choose what you want to do with your iCloud file.
Keep a copy – This keeps a downloaded copy of the iCloud files on the Mac. This option is recommended if you want to access the files offline later. This option works for most Mac users.
Delete from Mac – Selecting this option will remove all files from the iCloud drive on your Mac, and you will no longer be able to access these files on your computer.

5. Once you have selected the desired options, exit System Preferences on your Mac.
When you close the iCloud drive on your Mac, you’ll notice that the iCloud options disappear from the sidebar of the Finder, as well as from the Dock or anywhere else on your system. This is because you have completely disabled iCloud Drive from your Mac. You will not be able to save, copy, move, or upload files from your Mac on your iCloud drive.
To re-enable iCloud Drive, go back to System Preferences and select the iCloud Drive box.
Clion compiles and runs a single C / cpp file
C/CPP is all right, but you need to create a new project first. You can only have one main at a time, so you need to be able to let it compile and execute a single file
Installing a plug-in
in the Settings to find the plug-in installation, after the completion of the open folder, you first create a new Cmakelist files, and right click on the need to perform the c file
choose the bottom of the add, you will see the main function on the left side of a small arrow, direct execution
Restoring web applications from an installatron backup on my Linux host
Required: Installatron does not automatically create a backup file for your application – you must have created the backup file manually and then follow these steps.
- Go to the US Domain Center product page. Under Web Hosting, select Manage next to the Linux Hosting account you want to use. In the Accounts Dashboard (control panel), select CPanel Admin (CPanel Administrator). On the cPanel home page, select Web Applications, and then under My Applications, select the Web application that you want to restore (for example, WordPress in the screenshot below). On the installed page, in the top right corner, click My Backup. Next to the backup you want to use, click the icon below Restore to the original location, and click Continue. Click Restore.
Development board cannot be mounted, uboot has a lot of JFFS2: alert information
References and materials:
“Uboot sf command usage” kickxxx
When running the development board, it prompts the following alarm:
cp: can't stat '/progs/rec/*': No such file or directory
/dev/mtdblock5
jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000010: 0xdde4 instead
jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000014: 0x9a31 instead
jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000018: 0x2648 instead
jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0000001c: 0xb317 instead
jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000020: 0xe2ae instead
jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000024: 0x36f7 instead
jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000028: 0xe9f5 instead
jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0000002c: 0xecb9 instead
jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000030: 0xc0b5 instead
jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000034: 0x5339 instead
jffs2: Further such events for this erase block will not be printed
………… ………… …………
………… ………… …………
………… ………… …………
jffs2: Empty flash at 0x00072000 ends at 0x00072010
jffs2: Empty flash at 0x00074000 ends at 0x00074004
jffs2: Empty flash at 0x00074008 ends at 0x00074010
jffs2: Empty flash at 0x00076000 ends at 0x00076010
jffs2: Empty flash at 0x00078000 ends at 0x0007800c
jffs2: Empty flash at 0x0007a000 ends at 0x0007a010
jffs2: Empty flash at 0x0007c000 ends at 0x0007c010
jffs2: Empty flash at 0x0007e000 ends at 0x0007e010
jffs2: Cowardly refusing to erase blocks on filesystem with no valid JFFS2 nodes
jffs2: empty_blocks 0, bad_blocks 0, c->nr_blocks 8
mount: mounting /dev/mtdblock5 on /etc/conf.d/ failed: Input/output error
/home/bashrc.sh: line 38: can't create /proc/sys/vm/extra_free_kbytes: nonexistent directory
probe 0x0;
SF probe 0x0; sf erase 0x780000 0x800000
SF read erase
read erase
SF read erase
SF read erase
SF read>se
SF read erase>r> SF write erase
SF read erase
SF read erase
SF read erase
SF read erase
SF write
| command th> | explain th> | use example th> | meaning th> tr> | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| sf, the probe [[bus:] cs] [hz] [mode] td> | init flash device on given SPI bus and chip Select td> | td> | td> tr> | ||||||||||||||
| td> | td> | td> | td> tr> | ||||||||||||||
| sf, read addr offset len td> | read 'len bytes starting at "offset" to the memory at "addr" td> | sf, read 0x82000000 0x10000 0x20000 | ash offset 0x10000(64KB), length 0x20000(128KB), 0x82000000 Offset and length minimum unit operation is Byte td> tr> | ||||||||||||||
| td> | td> | td> | td> tr> | ||||||||||||||
| sf, write addr offset len td> | write 'len bytes from memor at' addr to flash at "offset" td> | 0 x82000000 sf, write 0x0 0x20000 TD> | 8200 0000 bytes, 0x0 bytes, 0x20000 bytes, 0x0 bytes, 0x0 bytes, 0x0 bytes, 0x0 bytes Offset and length minimum unit operation is Byte td> tr> | ||||||||||||||
| td> | td> | td> | td> tr> | ||||||||||||||
| sf, erase offset [+] len td> | erase 'len bytes from' offset '+' len 'round up' len 'to block size td> | sf, erase 0 x0 0x10000 | ase block at offset 0x0 to 0x10000 Erase block at offset 0x0 Offset and len parameters must be erase block aligned td> tr> | ||||||||||||||
| td> | td> | td> | td> tr> | ||||||||||||||
| sf, update addr offset len td> | erase and write 'len bytes from the memory at "addr" to flash the at "Offset" td> | td> | td> tr> tbody> table> From the SF command, we can see several points: p> Support Byte level read and write operation, support random access. Referring to StackFlow, it was decided to restart the server, which was resolved after the restart. Nmap lists open ports for remote machines Nmap profile
Nmap — DNS-Sever DNS server IP address to probe the domain name
Use Fiddler to capture mobile APP package detailed tutorial |














