-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsearch.xml
1639 lines (1412 loc) · 216 KB
/
search.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?xml version="1.0" encoding="utf-8"?>
<search>
<entry>
<title></title>
<url>http://example.com/2021/01/16/Git%2520and%2520GitHub/</url>
<content type="html"><![CDATA[<h1 id><a href="#" class="headerlink" title></a></h1><h2 id="Personal-blog-alvincr-com-if-updated-https-alvincr-com-2021-01-git-and-github"><a href="#Personal-blog-alvincr-com-if-updated-https-alvincr-com-2021-01-git-and-github" class="headerlink" title="Personal blog: alvincr.com, if updated: https://alvincr.com/2021/01/git-and-github/ "></a>Personal blog: alvincr.com, if updated: <a href="https://alvincr.com/2021/01/git-and-github/">https://alvincr.com/2021/01/git-and-github/ </a></h2><h2 id="One-background"><a href="#One-background" class="headerlink" title="One: background"></a>One: background</h2><p>I wrote an article about building GitHub_Pages two days ago, and I used Git. I can’t help but wonder what the relationship between GitHub and Git is, and why is Github named after it? </p>
<h2 id="Two-Git"><a href="#Two-Git" class="headerlink" title="Two: Git"></a>Two: Git</h2><h3 id="1-Basic-knowledge"><a href="#1-Basic-knowledge" class="headerlink" title="1 Basic knowledge"></a>1 Basic knowledge</h3><p>First, let’s first understand what Git is. </p>
<p>Git is a version control tool for Linux kernel development. Unlike centralized version control tools such as CVS and Subversion, it adopts a distributed version library approach, and version control can be operated without server-side software, making the release and exchange of source code extremely convenient. </p>
<h3 id="2-Git-features"><a href="#2-Git-features" class="headerlink" title="2 Git features"></a>2 Git features</h3><p>Git is a distributed version control software, we can see in just this sentence: </p>
<ol>
<li>Git usage scenarios are distributed rather than centralized management, so the object of use should be a personal PC; </li>
<li>The role of Git is to version control files. </li>
</ol>
<p>In addition, Git has the following features: </p>
<ol>
<li>Git is developed in C language to pursue the highest performance. </li>
<li>Git can automatically complete garbage collection, or it can be called directly with the command git gc -prune. </li>
<li>The typical TCP listening port of the Git server is 9418. </li>
<li>Git uses the packs operation to compress files into a file (packfile) using differential compression. Both packfile and index files use SHA-1 as the checksum and the file name. </li>
</ol>
<h3 id="3-The-biggest-advantage"><a href="#3-The-biggest-advantage" class="headerlink" title="3 The biggest advantage"></a>3 The biggest advantage</h3><p>The biggest advantage of Git is that it can record the contents of file modifications step by step and time, which has an incomparable advantage for saving historical files and multiple people modifying files together. </p>
<p>(1) Save historical files: Since Git only records the modified content, other unmodified content does not need to be saved additionally, saving a lot of storage space. </p>
<p>(2) Multi-person modification: Suppose alvincr wrote a program today. God A looked at the bugs in the program and took away a backup to modify the bugs. Alvincr looked at his program and found that the bugs were indeed piled up. Modified a bit. The next day, God A passed the modified program to me. At this time, I must think about what I modified myself, what was modified by God, and how to combine the two. The bitterness is hard to explain. Using Git can directly solve such pain points, using Git can directly record the modified content and then automatically merge it. </p>
<h3 id="4-Comparison-with-other-management-methods"><a href="#4-Comparison-with-other-management-methods" class="headerlink" title="4 Comparison with other management methods"></a>4 Comparison with other management methods</h3><p>The management systems that have the same effect as Git include CVS, Subversion, and Perforce. Although they are similar in effect to Git, the principles of implementation are completely different. </p>
<blockquote>
<p>The following content is summarized from the official Git website: <a href="https://git-scm.com/book/zh/v2/%E8%B5%B7%E6%AD%A5-Git-%E6%98%AF%E4%BB%80%E4%B9%88%EF%BC%9F">https://git-scm.com/book/zh/v2/%E8%B5%B7%E6%AD%A5-Git-%E6%98%AF%E4%BB%80 %E4%B9%88%EF%BC%9F </a>, other reference: WIKI </p>
<ol>
<li>Git directly records snapshots and builds indexes </li>
</ol>
<p>CVS, Subversion, Perforce, Bazaar and other management methods: It is a delta-based version control, that is to say, the differences between two files (1V1) will be found, and only the differences between the two will be recorded. </p>
<p>Git first builds an index based on all initial files (multiple Vs), if you add other content, then only build the index of the content you added. </p>
<p>Personal understanding: CVS is equivalent to the class teacher, each class teacher is responsible for recording the changes of each class, and only when there is a change in the class, the class teacher will report to the school; Git is equivalent to the head of the level, recording the overall changes of the entire level every period of time, Only record the changed part and report it to the school. That is: CVS is responsible for a single file, and Git is responsible for the entire file. </p>
<p>The following pictures are from the original text (please forgive the original author if the watermark is automatically added): </p>
<p>Use CVS, Subversion, Perforce, Bazaar </p>
<p><img src="/2021/01/16/Git%20and%20GitHub/2c8934d64a9cd23a3ebcbd5f7008091e.png" alt="Store the difference between each file and the initial version. "></p>
<p>Use Git </p>
<p><img src="/2021/01/16/Git%20and%20GitHub/31b5d86d7e5f58e79a33b0a0390f467a.png" alt="Git stores snapshots of project changes over time. "></p>
<ol>
<li>Git stores almost all files locally </li>
</ol>
<p>There is a complete history of the project on the local disk, but it depends on the network. </p>
<ol>
<li>Git can only add data </li>
</ol>
<p>Since only data can be added, using Git will not cause accidental deletion of database data, so Git will basically not perform any operations that may cause files to be unrecoverable. But like other VCS, the modified content may be lost or messed up when the update is not submitted. </p>
</blockquote>
<h3 id="5-Supplement-CVS-bottleneck"><a href="#5-Supplement-CVS-bottleneck" class="headerlink" title="5 Supplement: CVS bottleneck"></a>5 Supplement: CVS bottleneck</h3><blockquote>
<p>Original: <a href="https://developer.ibm.com/zh/devpractices/devops/articles/os-cn-git-and-github-1/">https://developer.ibm.com/zh/devpractices/devops/articles/os-cn-git-and-github-1/</a> </p>
<p>The storage and copying of the code base is not the bottleneck of the version control system. Analyzing the differences in files and viewing the historical versions of the code base are often the real bottleneck. Based on the design of this snapshot stream, Git can quickly obtain all the files in the code base at a certain moment, and it can also quickly compare the differences between the historical versions of the files, and even the entire code base of each historical version or branch. Difference comparison. Imagine if it is a traditional incremental storage method, a code base has been developed for a long time, assuming that the code base has 100,000 files, and each file has undergone an average of 100 modifications, then the latest code base and the original code must be retrieved The difference in the library requires 10 million increments to be retrieved before the final successful comparison, which requires an unimaginable time cost. Git does not have this problem. Git only needs to retrieve the latest code base snapshot and compare the original code base snapshot directly. Relying on Git’s diff algorithm (Myers algorithm), Git can retrieve the two efficiently and quickly. The difference comes. </p>
</blockquote>
<h2 id="Three-GitHub"><a href="#Three-GitHub" class="headerlink" title="Three: GitHub"></a>Three: GitHub</h2><h3 id="1-Introduction"><a href="#1-Introduction" class="headerlink" title="1 Introduction"></a>1 Introduction</h3><p>Official website introduction: <a href="https://github.com/about">https://github.com/about</a> </p>
<p>GitHub is the world’s largest open source code hosting platform. (Finish) </p>
<h3 id="2-function"><a href="#2-function" class="headerlink" title="2 function"></a>2 function</h3><p>Common options </p>
<p>Creating a new warehouse is equivalent to creating a new folder on the hard disk. This folder is used to store a certain project file. </p>
<p><img src="/2021/01/16/Git%20and%20GitHub/4ff22e06f8b2a3c8464ae33d198b2a73.png" alt="img"></p>
<p>Fork command can copy other people’s resources to this folder of your own. </p>
<p>Star is used for collection, equivalent to favorites </p>
<p><img src="/2021/01/16/Git%20and%20GitHub/a5c18413e3cece2947d39609ea313c37.png" alt="img"></p>
<p>Clone can copy other people’s files or your own warehouse on github to local </p>
<p><img src="/2021/01/16/Git%20and%20GitHub/c25ce0dba4a147725fde42fadb0c5bb5.png" alt="img"></p>
<p>In addition, if you are visiting a personal warehouse, you can also modify and add files online </p>
<p><img src="/2021/01/16/Git%20and%20GitHub/c9596b0c91491b6c40cd76d44ab2ea3b.png" alt="img"></p>
<p>Browse Github </p>
<p>You can choose explore github on the github homepage, through this option you can view the articles recommended by github </p>
<p><img src="/2021/01/16/Git%20and%20GitHub/c1290a234208fcee0457632df36c3fa6.png" alt="img"></p>
<p><img src="/2021/01/16/Git%20and%20GitHub/ed6cf59b731cb87b15a2fbfc9f4de910.png" alt="img"></p>
<h2 id="Four-the-relationship-between-the-two"><a href="#Four-the-relationship-between-the-two" class="headerlink" title="Four: the relationship between the two"></a>Four: the relationship between the two</h2><p>(1) GitHub is a code hosting platform, and it utilizes Git-based hosting services. </p>
<p>(2) Git source code is also available on GitHub. </p>
<p>(3) Files on github can be cloned via git (login required). </p>
<p><img src="/2021/01/16/Git%20and%20GitHub/3524c345442ce0d209e89a7e5c6f9949.png" alt="img"></p>
<p>Personal guess: GitHub takes this name because it mainly uses Git, and the main storage method of Github is also based on Git, so the data we upload on Github will have historical versions, which is very friendly to find. </p>
<h2 id="Attach"><a href="#Attach" class="headerlink" title="Attach:"></a>Attach:</h2><h3 id="git-folder"><a href="#git-folder" class="headerlink" title=".git folder"></a>.git folder</h3><p>Reference article: <a href="https://juejin.cn/post/6844903986839945229">https://juejin.cn/post/6844903986839945229</a> </p>
<p>The newly created Git folder has the following files by default: </p>
<p><img src="/2021/01/16/Git%20and%20GitHub/851af8fa9c40baec962108d4eeef33ed.png" alt="img"></p>
<p>Config file: </p>
<p>Set up some information about .git here. </p>
<p><img src="/2021/01/16/Git%20and%20GitHub/e783f0d31de6faa082bff8736e7d4ffa.png" alt="img"></p>
<p>Descripton: </p>
<p><img src="/2021/01/16/Git%20and%20GitHub/dc57c9bfe496083625fb7f974d5d5bbf.png" alt="img"></p>
<blockquote>
<p>This file is used for GitWeb. GitWeb is a CGI script (Common Gateway Interface, which is simply a program running on a web server, but triggered by browser input) that allows users to view git content on web pages. If we want to start GitWeb, we can use the following command: </p>
<p><em># Make sure lighttpd is installed: brew install lighttpd</em> </p>
<p>$ git instaweb –start </p>
<p>By default, the lighttpd service will be started and the browser <a href="http://127.0.0.1:1234/">http://127.0.0.1:1234</a> will be opened. The page directly displays the current git warehouse name and description. </p>
</blockquote>
<p>Personal test the code given above is invalid: </p>
<p><img src="/2021/01/16/Git%20and%20GitHub/dbccbf63b50e837d028aec6fb66eabe4.png" alt="img"></p>
<p>Hooks file: </p>
<p>Hooks store the files submitted by git at various stages, which are used to check before and after the git command or do some custom actions. </p>
<p><img src="/2021/01/16/Git%20and%20GitHub/700735ea19ef01445bd90526b2eeef38.png" alt="img"></p>
<p>HEAD: </p>
<p>Modifying the content in the head can change the position of the pointer to point to the desired work partition. </p>
<p><img src="/2021/01/16/Git%20and%20GitHub/7ccd76e70361ff1aa610fb036d22c58a.png" alt="img"></p>
<p>Objects: </p>
<blockquote>
<p>Original: The default format used by Git to save objects to disk is the loose object format. When you modify even one line of the same file, git will use a new file to store the modified file and place it in objects. Git packs these objects into a binary file called packfile from time to time to save space and improve efficiency </p>
</blockquote>
<p>In summary, objects are equivalent to the temp folder. </p>
<p>Ref: </p>
<p>Store the branches of git generated files and the use of tags. </p>
]]></content>
<categories>
<category> git github net </category>
</categories>
<tags>
<tag> git </tag>
<tag> github </tag>
<tag> contact </tag>
</tags>
</entry>
<entry>
<title><![CDATA[The whole process of registering and using GitHub Pages]]></title>
<url>http://example.com/2021/01/14/Multiple%2520ways%2520to%2520clean%2520up%2520redundant%2520thumbnails%2520on%2520your%2520site/</url>
<content type="html"><![CDATA[<h5 id="view-my-personal-blog-original-article-for-more:"><a href="#view-my-personal-blog-original-article-for-more:" class="headerlink" title="view my personal blog original article for more:"></a>view my personal blog original article for more:</h5><p><a href="https://alvincr.com/2021/01/clear-thumbnail/">https://alvincr.com/2021/01/clear-thumbnail/</a></p>
<h1 id="0-ready"><a href="#0-ready" class="headerlink" title="0 ready"></a>0 ready</h1><h3 id="0-reason"><a href="#0-reason" class="headerlink" title="0 reason"></a>0 reason</h3><p>As I tested and used Smush, a super large number of thumbnails were generated in the directory of the alvincr.com website, which caused the size of the picture to change from 160M to 600M. However, after using it for a few days, I found that Smush saved a total of 15M bandwidth (14%) , Although you can choose the number of thumbnails generated in the settings, I personally think that this plugin does more harm than good.</p>
<p>Then I set up in the software to automatically clear the thumbnails after uninstallation, but when I uninstalled, I found that the thumbnails were not automatically deleted at all, or remained in the original folder, so I had to find a way to solve this problem.</p>
<p><img src="https://alvincr.com/wp-content/uploads/2021/01/Pasted-into-WP%E4%B8%AD%E4%B8%8D%E5%BF%85%E8%A6%81%E6%8F%92%E4%BB%B6%E6%80%BB%E7%BB%93.png" alt="img"></p>
<h3 id="1-Must-be-backed-up-to-avoid-problems"><a href="#1-Must-be-backed-up-to-avoid-problems" class="headerlink" title="1 Must be backed up to avoid problems"></a>1 Must be backed up to avoid problems</h3><h4 id="Packaging-instructions-tar"><a href="#Packaging-instructions-tar" class="headerlink" title="Packaging instructions-tar"></a>Packaging instructions-tar</h4><p>The Tar instruction is used for packaging rather than compressing files, so the files will be larger.</p>
<p>For example, use tar -zcvf alvincr.com.tar alvincr.com</p>
<p>-v generates detailed file information, -c to create a new archive file, -f to use archive file or equipment. When in use: It can run regardless of whether it is added or not. It is invalid to use tar -zcvf alvincr.com directly. If you use -z then gzip will be used for compression.</p>
<p><img src="/2021/01/14/Multiple%20ways%20to%20clean%20up%20redundant%20thumbnails%20on%20your%20site/word-image-25.png" alt="img"></p>
<p>Using the -z parameter will generate a file ending in tar.gz. Comparing the two files, you can see that the size of the alvincr.com file generated in the same time period is different (where the tar1 ending is a website that does not use gzip compression)</p>
<p><img src="/2021/01/14/Multiple%20ways%20to%20clean%20up%20redundant%20thumbnails%20on%20your%20site/word-image-26.png" alt="img"></p>
<h4 id="Download-command-sz"><a href="#Download-command-sz" class="headerlink" title="Download command -sz"></a>Download command -sz</h4><p>If it is not installed, you can use yum install lrzsz to install, and other download methods can be searched on the homepage of the site: <a href="https://alvincr.com/2020/05/win%E4%B8%8Elinux%E6%96%87%E4%BB%B6%E5%BF%AB%E9%80%9F%E5%88%86%E4%BA%AB%E5%8F%8A%E4%BA%92%E4%BC%A0%EF%BC%88vm%E8%99%9A%E6%8B%9F%E6%9C%BA%EF%BC%89/"><strong>Quick sharing of Win and Linux files</strong></a></p>
<p>Download from Linux server to PC, use -rz to upload.</p>
<p>Example: sz alvicr.com</p>
<p><img src="/2021/01/14/Multiple%20ways%20to%20clean%20up%20redundant%20thumbnails%20on%20your%20site/word-image-27.png" alt="img"></p>
<h3 id="2-Find-the-rule-to-clean-up-files"><a href="#2-Find-the-rule-to-clean-up-files" class="headerlink" title="2 Find the rule to clean up files"></a>2 Find the rule to clean up files</h3><p>If you use manual cleaning, this step must be done carefully, after all, no one wants to clean up useful content.</p>
<p>Feel free to open an article with pictures, because I want to clean up the thumbnails generated in January of 2021.1, so I will open the articles published in the corresponding time period.</p>
<p>Take <a href="https://alvincr.com/2021/01/%E5%A6%82%E4%BD%95%E7%BB%99%E4%BD%A0%E7%9A%84%E7%BD%91%E7%AB%99%E7%94%B3%E8%AF%B7google-adsense/">this article as an example</a> : <strong>How to apply for Google Adsense for your website</strong></p>
<p><strong>(Https://alvincr.com/2021/01/%e5%a6%82%e4%bd%95%e7%bb%99%e4%bd%a0%e7%9a%84%e7%bd%91% e7%ab%99%e7%94%b3%e8%af%b7google-adsense/)</strong></p>
<p>First enter the edit article interface, and select the text article.</p>
<p><img src="/2021/01/14/Multiple%20ways%20to%20clean%20up%20redundant%20thumbnails%20on%20your%20site/word-image-28.png" alt="img"></p>
<p>You can see which picture is called by the picture with the img tag. For example, the picture called Google-Adsense-1 is called here, and the location is 2021/01. It is best to read the names of pictures used in several groups of articles here to avoid accidental deletion.</p>
<p><img class=”alignnone wp-image-1074 size-full” src=”<a href="http://alvincr.com/wp-content/uploads/2021/01/Pasted-into-How">http://alvincr.com/wp-content/uploads/2021/01/Pasted-into-How</a> to apply Google-Adsense- for your website 1.png” /></p>
<p><img src="/2021/01/14/Multiple%20ways%20to%20clean%20up%20redundant%20thumbnails%20on%20your%20site/word-image-29.png" alt="img"></p>
<p>Enter the background through shell and other methods, and display all pictures with the name of Google-Adsense-1. It should be noted here that although the contents of these thumbnails are different at first glance, you will find that these large and small thumbnails are all captured from the source file when you open the picture.</p>
<p>For example: Pasted-into-how to apply for your website Google-Adsense-1-150×85 square looks and Pasted-into-how to apply for your website Google-Adsense-1-1024×62 completely unnecessary , But they are all generated by one file (Pasted-into-how to apply Google-Adsense-1 for your website).</p>
<p><img src="/2021/01/14/Multiple%20ways%20to%20clean%20up%20redundant%20thumbnails%20on%20your%20site/word-image-30.png" alt="img"></p>
<p>So we got the pictures that we can delete, that is, Pasted-into-How to apply Google-Adsense-1 for your website and there are many files with suffixes, such as 75×75.</p>
<h2 id="1-Cleaning-method"><a href="#1-Cleaning-method" class="headerlink" title="1 Cleaning method"></a>1 Cleaning method</h2><h3 id="Manual-cleaning"><a href="#Manual-cleaning" class="headerlink" title="Manual cleaning"></a>Manual cleaning</h3><h4 id="1-Use-win-to-clean-up"><a href="#1-Use-win-to-clean-up" class="headerlink" title="1 Use win to clean up"></a>1 Use win to clean up</h4><p>Download the file, and then use the search function of win10 to directly clean it up.</p>
<p>Search for 75×75 like I did, then delete all</p>
<p><img src="/2021/01/14/Multiple%20ways%20to%20clean%20up%20redundant%20thumbnails%20on%20your%20site/word-image-31.png" alt="img"></p>
<p>It can be seen that only a 75×75 thumbnail has a size of 4M (more than 700 files), which is evident in the storage space occupied by those HD pictures.</p>
<p><img src="/2021/01/14/Multiple%20ways%20to%20clean%20up%20redundant%20thumbnails%20on%20your%20site/word-image-32.png" alt="img"></p>
<p>Finally, package the file, enter the rz command to upload the file, use the mv command to change the initial folder name, unzip the compressed package and rename it</p>
<h4 id="2-Use-the-pagoda-for-cleaning"><a href="#2-Use-the-pagoda-for-cleaning" class="headerlink" title="2 Use the pagoda for cleaning"></a>2 Use the pagoda for cleaning</h4><p>Before cleaning up, turn on the recycle bin function to temporarily save the deleted data. If you are not assured, you can not select the delete option, but move the files to other folders. If the website has no problems, it is not too late to delete. .</p>
<p>The method is the same as above, search for 75×75 (pay attention to check the include subdirectories), and then delete it.</p>
<p><img src="/2021/01/14/Multiple%20ways%20to%20clean%20up%20redundant%20thumbnails%20on%20your%20site/word-image-33.png" alt="img"></p>
<h4 id="3-Use-linux-commands-to-clean-up"><a href="#3-Use-linux-commands-to-clean-up" class="headerlink" title="3 Use linux commands to clean up"></a>3 Use linux commands to clean up</h4><p>method one:</p>
<p>Use this method with caution, if it is written as rm -rf / then it is over. Noob, please read this article: <a href="https://alvincr.com/2020/06/linux%E9%98%B2%E8%AF%AF%E5%88%A0%E6%93%8D%E4%BD%9C%EF%BC%88%E4%BD%BF%E7%94%A8safe-rm%EF%BC%9B%E4%BD%BF%E7%94%A8mv%E5%91%BD%E4%BB%A4%E5%88%A0%E9%99%A4%E6%96%87%E4%BB%B6%EF%BC%89%EF%BC%88%E6%9B%B4/">linux anti-error deletion operation</a></p>
<p>, Although this code is very simple, but I am afraid that there is no such method.</p>
<p>rm -rf <em>75×75</em> (the code is no problem in theory)</p>
<p>Here * is used in Filename expansion to represent any character, including null characters.</p>
<p>/* means all files in the root directory.</p>
<p>Method Two:</p>
<p>Below is the result of my test using cat> 75×75-1 to generate a file and use the move file command instead of deleting the file</p>
<p>mkdir temp</p>
<p>mv <em>75×75</em> ./temp</p>
<p><img src="/2021/01/14/Multiple%20ways%20to%20clean%20up%20redundant%20thumbnails%20on%20your%20site/word-image-34.png" alt="img"></p>
<h3 id="Plugin-cleanup"><a href="#Plugin-cleanup" class="headerlink" title="Plugin cleanup"></a>Plugin cleanup</h3><p>Personally, it is not very recommended to use plug-ins. Although it is very convenient, it is also prone to problems. The following are some of the more famous cleaning software:</p>
<p>DNUI</p>
<p>Media Cleaner</p>
<p>Force Regenerate Thumbnails</p>
<p>Personally tested WPvivid Image Cleaner (Beta)</p>
<p>Currently the software has a beta version to clean up pictures (2021.1.9)</p>
<p>Scan all pictures with Beta tab Scan</p>
<p><img src="https://alvincr.com/wp-content/uploads/2021/01/Pasted-into-WP%E4%B8%AD%E4%B8%8D%E5%BF%85%E8%A6%81%E6%8F%92%E4%BB%B6%E6%80%BB%E7%BB%93-2.png" alt="img"></p>
<p>But deleting files is more troublesome. You can only select more than a dozen pictures each time, but it is detected that more than 3000 pictures need to be deleted, so it was finally abandoned.</p>
<h2 id="2-review"><a href="#2-review" class="headerlink" title="2 review"></a>2 review</h2><h3 id="1-Need-to-know"><a href="#1-Need-to-know" class="headerlink" title="1 Need to know"></a>1 Need to know</h3><p>If you enable CDN acceleration, you need to suspend the CDN acceleration service (you can also enter the CDN acceleration server to enter the developer mode), or wait for a period of time to review.</p>
<h3 id="2-method"><a href="#2-method" class="headerlink" title="2 method"></a>2 method</h3><p>After the above methods are cleaned up, you can recheck whether any missing thumbnails have not been deleted. If they exist, just add rules to delete them; if they don’t exist, check whether the access to each device is normal.</p>
<p><img src="/2021/01/14/Multiple%20ways%20to%20clean%20up%20redundant%20thumbnails%20on%20your%20site/word-image-35.png" alt="img"></p>
<p>It is recommended to use the sorting method from largest to smallest for the review. It doesn’t matter if the image remains very small. Here all my thumbnails have “-number x”, so I only need to check this way. You can also use the win command “-*X” search, find something similar to 150×88 and delete it.</p>
<p><img src="/2021/01/14/Multiple%20ways%20to%20clean%20up%20redundant%20thumbnails%20on%20your%20site/word-image-36.png" alt="img"></p>
<p><img src="/2021/01/14/Multiple%20ways%20to%20clean%20up%20redundant%20thumbnails%20on%20your%20site/word-image-37.png" alt="img"></p>
<p>After the operation is completed, you can clearly see the folder size drop (600M->117M)</p>
]]></content>
<categories>
<category> Web building </category>
</categories>
<tags>
<tag> Github </tag>
<tag> register </tag>
<tag> Pages </tag>
</tags>
</entry>
<entry>
<title><![CDATA[The whole process of registering and using GitHub Pages]]></title>
<url>http://example.com/2021/01/12/github-pages/</url>
<content type="html"><![CDATA[<h1 id><a href="#" class="headerlink" title></a></h1><h5 id="view-my-personal-blog-original-article-for-more:"><a href="#view-my-personal-blog-original-article-for-more:" class="headerlink" title="view my personal blog original article for more:"></a>view my personal blog original article for more:</h5><p><a href="https://alvincr.com/2021/01/github-pages/">https://alvincr.com/2021/01/github-pages/</a></p>
<h1 id="1-background-knowledge"><a href="#1-background-knowledge" class="headerlink" title="1 background knowledge"></a><strong>1 background knowledge</strong></h1><p>If there is something unclear about the steps in my article, you can refer to the official website below. All content has detailed answers to the norms.</p>
<p><a href="https://github.com/">Official website address</a> : <a href="https://github.com/">https://github.com/</a></p>
<p><a href="https://docs.github.com/en/free-pro-team@latest/github/working-with-github-pages/creating-a-github-pages-site">Tutorial address</a> : <a href="https://docs.github.com/en/">https://docs.github.com/en/</a> free-pro-team@latest /github/working-with-github-pages/creating-a-github-pages-site</p>
<p>First To register github account, <a href="https://github.com/join?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=/&source=header-home">registered address</a> in accordance with the registration process on the line.</p>
<h2 id="1-What-are-github-pages"><a href="#1-What-are-github-pages" class="headerlink" title="1 What are github pages"></a><strong>1 What are github pages</strong></h2><p>GitHub Pages is a static site hosting service. You can get HTML, CSS, and JavaScript files directly from the repository on GitHub, and you can also choose to run these files during the build process and publish the website. You can host the site on GitHub’s github.io domain or your own custom domain.</p>
<p>The publishing source of the GitHub Pages website is the branch and folder where the source files of the website are stored. If there is a default publishing source in the repository, GitHub Pages will automatically publish the website from that source. The default release source for user and organization sites is the root of the default branch of the repository. The default publishing source of the project site is the root of the gh-pages branch.</p>
<p>Therefore, using github pages, you can create your own blog on the github server. I believe its server is many times better than the server I use. Of course, how many can be allocated to individuals.</p>
<h2 id="2-Create-a-repository"><a href="#2-Create-a-repository" class="headerlink" title="2 Create a repository"></a><strong>2 Create a repository</strong></h2><p>Before creating a site, you must have a site repository on GitHub. The repository is also called Repository. In this article, it is referred to as repo. Repo is equivalent to the company headquarters. The head office is controlled by github, and it controls many subsidiaries. These subsidiaries Owned by the individual. Individuals can obtain information from the head office, or share the information with the head office after research and development. Therefore, the connected client can push and pull resources (code) to the server, so as to update the code version in the server or download the code from the server to use locally.</p>
<h1 id="2-Create-a-new-github-blog"><a href="#2-Create-a-new-github-blog" class="headerlink" title="2 Create a new github blog"></a><strong>2 Create a new github blog</strong></h1><h2 id="1-New-repo"><a href="#1-New-repo" class="headerlink" title="1 New repo"></a><strong>1 New repo</strong></h2><p><strong>About repo knowledge refer to appendix</strong></p>
<p>After the registration is complete, log in and enter on the web page: <a href="https://github.com/">https://github.com/</a> to enter the official website interface (you can also directly enter the personal interface, but the creation method is different)</p>
<p>In the upper left corner, select New repositories (repository),</p>
<p><img src="/2021/01/12/github-pages/word-image-52.png" alt="img"></p>
<h2 id="2-matters-needing-attention"><a href="#2-matters-needing-attention" class="headerlink" title="2 matters needing attention"></a><strong>2 matters needing attention</strong></h2><p>(1) The name must be in the form of <username>.github.io, where <username> is replaced with your github account name. I use alvincr.github.io here</username></username></p>
<p>(2) You can see that I use the Creative Commons Agreement on No. 2. The specific choice can be based on the individual or not. For the <a href="https://alvincr.com/2021/01/%E4%BB%80%E4%B9%88%E6%98%AF%E5%BC%80%E6%BA%90%E5%8D%8F%E8%AE%AE%E4%B8%8E%E5%BC%80%E6%BA%90%E8%BD%AF%E4%BB%B6/">selection method, please refer to my choice agreement tutorial</a></p>
<p><img src="/2021/01/12/github-pages/word-image-55.png" alt="img"></p>
<h2 id="3-Set-up-Github-Pages"><a href="#3-Set-up-Github-Pages" class="headerlink" title="3 Set up Github Pages"></a>3 Set up Github Pages</h2><p>Find the setting tab, drop down to the bottom and there will be a github pages option.</p>
<p><img src="/2021/01/12/github-pages/word-image-56.png" alt="img"></p>
<p><img src="/2021/01/12/github-pages/word-image-57.png" alt="img"></p>
<p>Under “GitHub Pages”, use the “ <strong>None”</strong> or “ <strong>Branch”</strong> drop-down menu and select a release source.</p>
<p><img src="/2021/01/12/github-pages/unnamed-file.png" alt="Select the publishing source from the drop-down menu"></p>
<p>(Optional) Use the drop-down menu to select a folder for your publishing source.</p>
<p><img src="/2021/01/12/github-pages/unnamed-file-1.png" alt="Drop-down menu to select the folder for publishing source"></p>
<p>Click <strong>save</strong> .</p>
<p><img src="/2021/01/12/github-pages/unnamed-file-2.png" alt="Button to save changes to the publishing source settings"></p>
<h2 id="4-Choose-a-theme"><a href="#4-Choose-a-theme" class="headerlink" title="4 Choose a theme"></a>4 Choose a theme</h2><p><img src="/2021/01/12/github-pages/word-image-71.png" alt="img"></p>
<p>The theme selected here can be downloaded or not.</p>
<h1 id="3Set-up-using-GitHub-client"><a href="#3Set-up-using-GitHub-client" class="headerlink" title="3Set up using GitHub client"></a>3Set up using GitHub client</h1><h2 id="1-Clone-the-warehouse"><a href="#1-Clone-the-warehouse" class="headerlink" title="1 Clone the warehouse"></a>1 Clone the warehouse</h2><p>Shortcut key ctrl+shift+o</p>
<p><img src="/2021/01/12/github-pages/word-image-72.png" alt="img"></p>
<p>Select the library to be cloned, and then clone it locally.</p>
<p><img src="/2021/01/12/github-pages/word-image-73.png" alt="img"></p>
<h2 id="2-Clean-up-files"><a href="#2-Clean-up-files" class="headerlink" title="2 Clean up files"></a>2 Clean up files</h2><p>Only keep .git files, delete all others</p>
<p><img src="/2021/01/12/github-pages/word-image-74.png" alt="img"></p>
<h2 id="3-Download-the-creation-template"><a href="#3-Download-the-creation-template" class="headerlink" title="3 Download the creation template"></a>3 Download the creation template</h2><p>You can use the template in 2.4, or you can download the new template yourself, of course, you can also hand-write the entire web page. The personal blog alvincr.com will put a few templates I selected at the end of this article.</p>
<p><a href="http://jekyllthemes.org/">http://jekyllthemes.org/</a></p>
<p><a href="https://html5up.net/">https://html5up.net/</a></p>
<h2 id="4-Upload-template"><a href="#4-Upload-template" class="headerlink" title="4 Upload template"></a>4 Upload template</h2><p>After downloading, unzip to the cloned folder</p>
<p><img src="/2021/01/12/github-pages/word-image-75.png" alt="img"></p>
<p>You can see the changes in the GitHub desktop version, fill in the content at places 1 and 2 in the figure. (For example alvincr.com), click commit to mian to submit</p>
<p><img src="/2021/01/12/github-pages/word-image-76.png" alt="img"></p>
<h2 id="5-Push-to-github"><a href="#5-Push-to-github" class="headerlink" title="5 Push to github"></a>5 Push to github</h2><p>Click Push origin, the push progress will be displayed in the upper right corner, just wait for completion.</p>
<p><img src="/2021/01/12/github-pages/word-image-77.png" alt="img"></p>
<p><img src="/2021/01/12/github-pages/word-image-78.png" alt="img"></p>
<h2 id="6-Push-effect"><a href="#6-Push-effect" class="headerlink" title="6 Push effect"></a>6 Push effect</h2><p>Unsuccessful push will show:</p>
<p><img src="/2021/01/12/github-pages/word-image-79.png" alt="img"></p>
<p>Successful push will successfully enter the theme interface, the display effect is as follows:</p>
<p><img src="/2021/01/12/github-pages/word-image-80.png" alt="img"></p>
<h1 id="4-questions"><a href="#4-questions" class="headerlink" title="4 questions"></a>4 questions</h1><h2 id="1-Cannot-enter-the-blog-after-selecting-a-topic"><a href="#1-Cannot-enter-the-blog-after-selecting-a-topic" class="headerlink" title="1 Cannot enter the blog after selecting a topic"></a>1 Cannot enter the blog after selecting a topic</h2><p>Enter alvincr.github.io and you will see the following 404 interface, indicating that there is no GitHub Pages website. If you want to publish it, please read the complete documentation to learn how to set up GitHub Pages for your repository, organization or user account.</p>
<p><img src="/2021/01/12/github-pages/word-image-81.png" alt="img"></p>
<p>I ran into this problem at the beginning, until I followed the official website tutorial completely after the 404 interface was completed, thinking that maybe it was because the server was delayed, and then I created another one and waited, but when I created it with alvincasper.github.io There is no such problem. You can access directly.</p>
<p><img src="/2021/01/12/github-pages/word-image-82.png" alt="img"></p>
<p>In addition, I re-created alvincr.github.io and it is still invalid, so I think that the user name must be used when creating a blog with github, and other names are invalid.</p>
<p>But this conclusion is too sloppy, so I re-apply for an account and try two more names to create a blog to see if it succeeds.</p>
<h2 id="2-Recreate-account"><a href="#2-Recreate-account" class="headerlink" title="2 Recreate account"></a>2 Recreate account</h2><p>Reason: Question 1</p>
<p>I tried to rebuild the account and found that alvincasper.github.io could be established. However, this alvincasper.github.io has been used by another account of mine, so I can be completely sure that creating a blog on github can only be created with a user name, other names are No way.</p>
<p><img src="/2021/01/12/github-pages/word-image-83.png" alt="img"></p>
<h2 id="3-GitHub-Pages-is-currently-disabled"><a href="#3-GitHub-Pages-is-currently-disabled" class="headerlink" title="3 GitHub Pages is currently disabled"></a>3 GitHub Pages is currently disabled</h2><p>Since the account I used at the beginning was an account I created a long time ago, there was no problem with this newly created account.</p>
<p>But if you add README and other files during the precautions in the second step of this article (create a new github blog), this should not happen</p>
<p>The solution to the problem is as follows:</p>
<p>Click on the red arrow to create a new directory</p>
<p><img src="/2021/01/12/github-pages/word-image-84.png" alt="img">+</p>
<p>Click the figure 1 below (edit new file) to enter the content at will, and then click 3 to submit the file to solve it.</p>
<p><img src="/2021/01/12/github-pages/word-image-85.png" alt="img"></p>
<p>Effect picture:</p>
<p><img src="/2021/01/12/github-pages/word-image-86.png" alt="img"></p>
]]></content>
<categories>
<category> github </category>
</categories>
<tags>
<tag> github </tag>
<tag> web </tag>
<tag> register </tag>
</tags>
</entry>
<entry>
<title><![CDATA[When the file is uploaded, a solution appears as "This file type is not supported for security reasons"]]></title>
<url>http://example.com/2021/01/09/upload%2520error/</url>
<content type="html"><![CDATA[<h1 id="view-my-personal-blog-original-article-for-more:"><a href="#view-my-personal-blog-original-article-for-more:" class="headerlink" title="view my personal blog original article for more:"></a>view my personal blog original article for more:</h1><p><a href="https://alvincr.com/2021/01/%e6%96%87%e4%bb%b6%e4%b8%8a%e4%bc%a0%e6%98%af%e5%87%ba%e7%8e%b0%e6%97%b6%e5%87%ba%e7%8e%b0%e7%94%b1%e4%ba%8e%e5%ae%89%e5%85%a8%e5%8e%9f%e5%9b%a0%ef%bc%8c%e8%bf%99%e4%b8%aa%e6%96%87%e4%bb%b6/">https://alvincr.com/2021/01/%e6%96%87%e4%bb%b6%e4%b8%8a%e4%bc%a0%e6%98%af%e5%87%ba%e7%8e%b0%e6%97%b6%e5%87%ba%e7%8e%b0%e7%94%b1%e4%ba%8e%e5%ae%89%e5%85%a8%e5%8e%9f%e5%9b%a0%ef%bc%8c%e8%bf%99%e4%b8%aa%e6%96%87%e4%bb%b6/</a></p>
<h2 id="0-background"><a href="#0-background" class="headerlink" title="0 background"></a>0 background</h2><p>When I was analyzing and sorting out the code, I uploaded a file but the phenomenon of “Sorry, this file type is not supported for security reasons.” appeared. Through personal testing, I summarized the following methods so that everyone can quickly solve the same problem.</p>
<h2 id><a href="#" class="headerlink" title></a><img src="/2021/01/09/upload%20error/word-image-19.png" alt="img"></h2><h2 id="1-solution"><a href="#1-solution" class="headerlink" title="1 solution"></a>1 solution</h2><h3 id="1-code"><a href="#1-code" class="headerlink" title="1 code"></a>1 code</h3><h4 id="1-1-Allow-all-types-of-uploads"><a href="#1-1-Allow-all-types-of-uploads" class="headerlink" title="1.1 Allow all types of uploads"></a>1.1 Allow all types of uploads</h4><p>Put the following code in wp-config.php to directly solve this problem.</p>
<p>define(‘ALLOW_UNFILTERED_UPLOADS’, true); //Allow uploading various types of files</p>
<p><img src="/2021/01/09/upload%20error/word-image-20.png" alt="img"></p>
<p><img src="/2021/01/09/upload%20error/word-image-21.png" alt="img"></p>
<p>AlvinCR, 2021.1.9 (Supplement):</p>
<p>Using this function, the following error occurs:</p>
<p><img src="https://alvincr.com/wp-content/uploads/2021/01/Pasted-into-%E6%96%87%E4%BB%B6%E4%B8%8A%E4%BC%A0%E6%97%B6%E5%87%BA%E7%8E%B0%E5%87%BA%E7%8E%B0%E7%94%B1%E4%BA%8E%E5%AE%89%E5%85%A8%E5%8E%9F%E5%9B%A0%EF%BC%8C%E8%BF%99%E4%B8%AA%E6%96%87%E4%BB%B6%E7%B1%BB%E5%9E%8B%E4%B8%8D%E5%8F%97%E6%94%AF%E6%8C%81%E7%9A%84%E8%A7%A3%E5%86%B3%E6%96%B9%E6%B3%95-1.png" alt="img"></p>
<p>This is caused by a code input error, please recheck the correctness of the code. If copying and pasting the code above is wrong (caused by the input method), you can also manually enter it by referring to the code in the picture.</p>
<h4 id="1-2-Allow-certain-types-of-uploads"><a href="#1-2-Allow-certain-types-of-uploads" class="headerlink" title="1.2 Allow certain types of uploads"></a>1.2 Allow certain types of uploads</h4><p>The following is a code snippet, but when I use this code, an exception occurs (the server receives an unexpected response, and a fatal error causes the website to crash), maybe it is a problem with my settings.</p>
<blockquote>
<p>function my_custom_upload_mimes($mimes = array()) {</p>
<p>// Add a key and value for the SVG file type</p>
<p>$mimes['svg'] = “text/txt”; //Replace txt here with the type you want to open</p>
<p>return $mimes;</p>
<p>}</p>
<p>add_action('upload_mimes', 'my_custom_upload_mimes');</p>
</blockquote>
<p><img src="/2021/01/09/upload%20error/word-image-23.png" alt="img"></p>
<p><img src="/2021/01/09/upload%20error/word-image-24.png" alt="img"></p>
<h4 id="1-3-Add-specific-code"><a href="#1-3-Add-specific-code" class="headerlink" title="1.3 Add specific code"></a>1.3 Add specific code</h4><p>Since there is no application function in my function.php file, the following content is for reference only, and the effect is unknown:</p>
<p>Wordpress adds custom upload attachment type and rar support</p>
<p>Find application/zip in the wp-includes/functions.php file, and add it above the line “// openoffice formats”</p>
<p>‘rar’ =>’application/rar’,</p>
<h3 id="2-plugin"><a href="#2-plugin" class="headerlink" title="2 plugin"></a>2 plugin</h3><ul>
<li><a href="https://wordpress.org/plugins/wp-add-mime-types/">WP Add Mime Types</a></li>
<li><a href="https://wordpress.org/plugins/mime-types-plus/">Mime Types Plus</a></li>
<li><a href="https://wordpress.org/plugins/mime-types-extended/">Mime Types Extended</a></li>
<li><a href="https://wordpress.org/plugins/unsafe-mimetypes/">Unsafe Mime Types</a></li>
</ul>
<h3 id="3-Adjust-the-format"><a href="#3-Adjust-the-format" class="headerlink" title="3 Adjust the format"></a>3 Adjust the format</h3><p>When uploading, you can directly change the suffix of rar to jpg, and then manually change it back after uploading</p>
<h2 id="2-Other-reasons-and-methods"><a href="#2-Other-reasons-and-methods" class="headerlink" title="2 Other reasons and methods"></a>2 Other reasons and methods</h2><h3 id="2-1-Upload-permissions"><a href="#2-1-Upload-permissions" class="headerlink" title="2.1 Upload permissions"></a>2.1 Upload permissions</h3><p>It may also be because there is no open upload permission, you can find</p>
<p>/www/wwwroot/alvincr.com/wp-content/uploads</p>
<p>Open all the permissions of the uploads folder, which is set to 777</p>
<h3 id="2-2-Other-codes"><a href="#2-2-Other-codes" class="headerlink" title="2.2 Other codes"></a>2.2 Other codes</h3><blockquote>
<p> add_filter(‘upload_mimes’,’custom_upload_mimes’);</p>
<p>function custom_upload_mimes ($existing_mimes=array())</p>
<p>{</p>
<p>// Add file extension’extension’ with mime type’mime/type’</p>
<p>$existing_mimes[‘extension’] =’mime/type’;</p>
<p>// add as many as you like eg</p>
<p>$existing_mimes[‘rar’] =’application/rar’; //Add rar type files</p>
<p>// remove items here if desired…</p>
<p>//unset( $existing_mimes[‘exe’] );</p>
<p>// and return the new full result</p>
<p>return $existing_mimes;</p>
<p>}</p>
<p><a href="https://www.eee-eee.com/blog-news/90-wordpress/1174-wordpress-permissions.html">https://www.eee-eee.com/blog-news/90-wordpress/1174-wordpress-permissions.html</a></p>
</blockquote>
]]></content>
<categories>
<category> web </category>
</categories>
<tags>
<tag> web </tag>
<tag> upload </tag>
</tags>
</entry>
<entry>
<title><![CDATA[cc attack and countermeasures against attack]]></title>
<url>http://example.com/2021/01/08/cc%2520attack/</url>
<content type="html"><![CDATA[<h1 id><a href="#" class="headerlink" title></a></h1><h5 id="view-my-personal-blog-original-article-for-more:"><a href="#view-my-personal-blog-original-article-for-more:" class="headerlink" title="view my personal blog original article for more:"></a>view my personal blog original article for more:</h5><p><a href="https://alvincr.com/2021/01/cc%e6%94%bb%e5%87%bb%e5%8f%8a%e9%81%ad%e9%81%87%e6%94%bb%e5%87%bb%e7%9a%84%e5%af%b9%e7%ad%96/">https://alvincr.com/2021/01/cc%e6%94%bb%e5%87%bb%e5%8f%8a%e9%81%ad%e9%81%87%e6%94%bb%e5%87%bb%e7%9a%84%e5%af%b9%e7%ad%96/</a></p>
<h1 id="1-Basic-knowledge"><a href="#1-Basic-knowledge" class="headerlink" title="1 Basic knowledge"></a>1 Basic knowledge</h1><h2 id="1-What-is-cc-attack"><a href="#1-What-is-cc-attack" class="headerlink" title="1 What is cc attack"></a>1 What is cc attack</h2><p>CC attack (Challenge Collapsar Attack, CC) is an attack against web servers or applications, using standard GET/POST requests to obtain information, such as requesting URI (Universal Resource Identifier) involving database operations or other URIs that consume system resources The server resources are exhausted and cannot respond to normal requests.</p>
<p>You can also imitate a cc attack manually by doing this: open a website, hold down ctrl and keep clicking on a webpage link. When the number of links you click in a short period of time exceeds the limit allowed by the server, your visit becomes a cc attack At this time, your IP will be banned for a period of time, and the more ruthless website can directly block your IP.</p>
<p>For example, because I clicked on my site too many times (editing articles), I banned myself, which is commonly known as ruthless, even hitting myself…</p>
<p><img src="/2021/01/08/cc%20attack/20210108.png" alt="img"><img src="data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw==" alt="Click and drag to move"></p>
<h2 id="2-DDOS-attack-and-cc-attack"><a href="#2-DDOS-attack-and-cc-attack" class="headerlink" title="2 DDOS attack and cc attack"></a>2 DDOS attack and cc attack</h2><blockquote>
<p>DDoS attacks hit the server of the website, while the CC attack is aimed at the page of the website. In terms, one is a WEB network layer denial of service attack (DDoS) and the other is a WEB application layer denial of service attack (CC). CC attacks simulate users attacking some web pages that consume more resources, while DDoS attacks target ip. The harms of the two are also different. DDoS attacks are more difficult to defend than CC attacks and cause greater harm.</p>
<p><a href="https://www.huaweicloud.com/zhishi/dyl86.html">https://www.huaweicloud.com/zhishi/dyl86.html</a></p>
</blockquote>
<p>In summary, DDoS attacks will crash all the websites on your specific server, while cc attacks will only make a lot of visits to specific websites.</p>
<p>In addition: cc is attacking the web page, the server can be pinged, but the web page cannot be accessed.</p>
<h2 id="3-Attack-methods"><a href="#3-Attack-methods" class="headerlink" title="3 Attack methods"></a>3 Attack methods</h2><p>It is divided into broiler cc attack and proxy cc attack. Broiler cc uses many innocent but controlled computers to attack the website (for example, alvincr accidentally opened a virus, and the hacker used my computer to attack alvincr. com)</p>
<p>Broiler CC attack is that hackers use CC attack software to control a large number of broilers and launch an attack. Compared with the latter, it is more difficult to defend than the former. Because the broiler can simulate the request of normal users to visit the website.</p>
<p>Acting <strong>CC</strong> attack <strong>is</strong> hacker With a proxy server to generate a legitimate page requests to the victim host, to achieve DDoS, and disguise it <strong>called</strong> : <strong>CC</strong></p>
<h1 id="2-Solution"><a href="#2-Solution" class="headerlink" title="2 Solution"></a>2 Solution</h1><h2 id="Method-1-Set-up-a-blacklist"><a href="#Method-1-Set-up-a-blacklist" class="headerlink" title="Method 1: Set up a blacklist"></a>Method 1: Set up a blacklist</h2><p>If you use the pagoda for management, use the nginx firewall to add a blacklist, or you can add a whitelist so that the situation above will not appear.</p>
<p><img src="/2021/01/08/cc%20attack/20210108-1.png" alt="img"><img src="data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw==" alt="Click and drag to move"></p>
<h2 id="Method-2-nginx’s-limit-req-module-module"><a href="#Method-2-nginx’s-limit-req-module-module" class="headerlink" title="Method 2: nginx’s limit_req_module module"></a>Method 2: nginx’s limit_req_module module</h2><blockquote>
<p>The following is reproduced from (personally think that the following is a machine translation, not the original author): <a href="https://www.jianshu.com/p/dff5a0d537d8">https://www.jianshu.com/p/dff5a0d537d8</a>, the links provided inside are invalid, jump to GitHub can not be accessed, it should be the original author closed the account Up.</p>
<p><a href="https://link.jianshu.com/?t=http://xrong.net/2015/05/07/Nginx%E9%98%B2CC%E6%94%BB%E5%87%BB/#%E5%AE%9E%E9%AA%8C">experiment</a></p>
<p><a href="https://link.jianshu.com/?t=http://xrong.net/2015/05/07/Nginx%E9%98%B2CC%E6%94%BB%E5%87%BB/#Nginx%E9%85%8D%E7%BD%AE">Nginx configuration</a></p>
<p>http {</p>
<p>limit_req_zone $binary_remote_addr zone=one:10m rate=1r/s;</p>
<p>server {</p>
<p>#Limit no more than 20 requests per ip per second, the number of leaky buckets burst is 5</p>
<p>#brust means that if there are 19 requests for the first second, second, third, and fourth second,</p>
<p>#The 5th second request is 25 is allowed.</p>
<p>#But if you have 25 requests in the first second, the requests that exceed 20 in the second second will return a 503 error.</p>
<p>#nodelay, if this option is not set, the average rate is strictly used to limit the number of requests,</p>
<p>#1st second when there are 25 requests, 5 requests will be executed in the second second,</p>
<p>#Set nodelay, 25 requests will be executed in the first second.</p>
<p>limit_req zone=one burst=1 nodelay;</p>
<p>}</p>
<p>}</p>
<p>What does the configuration of the above sample mean?</p>
<p>$binary_remote_addr means: client IP address</p>
<p>zone represents the name of the leaky bucket</p>
<p>rate indicates how fast nginx processes the request</p>
<p>burst means peak</p>
<p>nodelay indicates whether to delay processing the request, or directly return 503 to the client, if the rate setting is exceeded.</p>
<p>For details, please refer to the official documentation: <a href="https://link.jianshu.com/?t=http://nginx.org/en/docs/http/ngx_http_limit_req_module.html">Module ngx_http_limit_req_module</a></p>
<p><a href="https://link.jianshu.com/?t=http://xrong.net/2015/05/07/Nginx%E9%98%B2CC%E6%94%BB%E5%87%BB/#%E6%A8%A1%E6%8B%9F%E8%AF%B7%E6%B1%82">Mock request</a></p>
<p>Here we need a small tool like Apache Benchmark to generate requests</p>
<p>//1 user sends a request to the server for 100s</p>
<p>ab -t 100 -c 1 -vvv <a href="http://example.com/">http://example.com/</a></p>
<p><a href="https://link.jianshu.com/?t=http://xrong.net/2015/05/07/Nginx%E9%98%B2CC%E6%94%BB%E5%87%BB/#Nginx%E9%85%8D%E7%BD%AE%E6%A0%B7%E6%9C%AC%E4%B8%80">Nginx configuration sample one</a></p>
<p>http {</p>
<p>limit_req_zone $binary_remote_addr zone=one:10m rate=1r/s;</p>
<p>server {</p>
<p>limit_req zone=one burst=1 nodelay;</p>
<p>}</p>
<p>}</p>
</blockquote>
<h2 id="Method-3-Enable-CDN-acceleration"><a href="#Method-3-Enable-CDN-acceleration" class="headerlink" title="Method 3: Enable CDN acceleration"></a>Method 3: Enable CDN acceleration</h2><p>Using CDN acceleration can use the server of the CDN acceleration service provider to automatically block, which saves a lot of worry, but if you are learning web-related knowledge, it is better not to use the blocking of CDN manufacturers. It is better to suffer more attacks and find countermeasures.</p>
<p>Another benefit is: CDN acceleration can cache your web pages, even if your site is abnormal, other people can still see the content of your site.</p>
<p><img src="/2021/01/08/cc%20attack/20210108-2.png" alt="img"><img src="data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw==" alt="Click and drag to move"></p>
]]></content>
<categories>
<category> web </category>
</categories>
<tags>
<tag> web </tag>
<tag> net </tag>
</tags>
</entry>
<entry>
<title><![CDATA[Quickly generate Sitemap and provide it to Google Baidu to speed up inclusion]]></title>
<url>http://example.com/2021/01/08/generate%2520Sitemap/</url>
<content type="html"><![CDATA[<h1 id><a href="#" class="headerlink" title></a></h1><h5 id="view-my-personal-blog-original-article-for-more:"><a href="#view-my-personal-blog-original-article-for-more:" class="headerlink" title="view my personal blog original article for more:"></a>view my personal blog original article for more:</h5><p><a href="https://alvincr.com/2021/01/sitemap/">https://alvincr.com/2021/01/sitemap/</a></p>
<h1 id="0-Basic-knowledge"><a href="#0-Basic-knowledge" class="headerlink" title="0 Basic knowledge"></a>0 Basic knowledge</h1><h2 id="1-The-difference-between-different-formats-of-sitemaps"><a href="#1-The-difference-between-different-formats-of-sitemaps" class="headerlink" title="1 The difference between different formats of sitemaps"></a>1 The difference between different formats of sitemaps</h2><blockquote>
<p>The xml format and txt format are <strong>for search engines</strong> , while the html format is <strong>for users</strong> .</p>
<table>
<thead>
<tr>
<th><strong>Site schema format</strong></th>
<th><strong>Difference description</strong></th>
</tr>
</thead>
<tbody><tr>
<td>html format</td>
<td>1. The html format is convenient for users to quickly find the pages inside the website. 2. Flatten the structure of the website. 3. Provide search engine spiders with crawling pages.</td>
</tr>
<tr>
<td>xml format</td>
<td>1. The site map format supported by each search engine webmaster platform can be submitted directly through the webmaster platform 2. Provide a variety of data, such as Priority (priority), Lastmod (final modification time) and other data. It is convenient for search engine spiders to judge, and it is also the most friendly form comprehensively.</td>
</tr>
<tr>
<td>txt format</td>
<td>1. The data is concise and the loading speed is fast. 2. <a href="https://park.mobayke.com/tools/ping.html">Ping submission</a> can be done quickly in Google</td>
</tr>
</tbody></table>
<p>Compared with html format, xml format and txt format are smaller in size under the same data volume (many of them are only tens of KB). Search engines <strong>do not need to load many resources</strong> when reading, and the crawling speed will be faster.</p>
<p>On the contrary, the html format is <strong>for users to see</strong> . The <strong>visual effect from the</strong> user’s point of view and <strong>the speed at which</strong> users <strong>find the corresponding page are</strong> much <strong>faster</strong> than xml and txt.</p>
<p><a href="https://park.mobayke.com/tools/for-sitemap.html">https://park.mobayke.com/tools/for-sitemap.html</a></p>
</blockquote>
<h1 id="1-reason"><a href="#1-reason" class="headerlink" title="1 reason"></a>1 reason</h1><h2 id="My-personal-article-was-stolen-without-permission-but-the-original-article-on-my-site-was-not-included-by-Google-and-Baidu…"><a href="#My-personal-article-was-stolen-without-permission-but-the-original-article-on-my-site-was-not-included-by-Google-and-Baidu…" class="headerlink" title="My personal article was stolen without permission, but the original article on my site was not included by Google and Baidu…"></a>My personal article was stolen without permission, but the original article on my site was not included by Google and Baidu…</h2><h1 id="2-Manually-add"><a href="#2-Manually-add" class="headerlink" title="2 Manually add"></a>2 Manually add</h1><h2 id="1-Generate-sitemap-sitemap"><a href="#1-Generate-sitemap-sitemap" class="headerlink" title="1 Generate sitemap sitemap"></a>1 Generate sitemap sitemap</h2><p>Here I used the following tools to automatically generate a site map:</p>
<p><a href="http://tools.bugscaner.com/sitemapspider">http://tools.bugscaner.com/sitemapspider</a></p>
<p>First generate a site map suitable for Google. Alvincr’s personal settings are as follows. Alvincr believes that it is best for Baidu and Google to create site maps separately.</p>
<p><img src="/2021/01/08/generate%20Sitemap/20210108112938608.png" alt="img"><img src="data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw==" alt="Click and drag to move"></p>
<p>Download the sitemap in xml format after generation. The txt format is too old and it is best not to use it.</p>
<p><img src="/2021/01/08/generate%20Sitemap/2021010811310512.png" alt="img"><img src="data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw==" alt="Click and drag to move"></p>
<h2 id="2-Place-the-site-map"><a href="#2-Place-the-site-map" class="headerlink" title="2 Place the site map"></a>2 Place the site map</h2><p>``Create a directory under alvincr.com, what I created here is the sitemap folder, upload the downloaded files to the folder, and then rename it to alvincr.com_2021.1.8.xml</p>
<p><img src="https://alvincr.com/wp-content/uploads/2021/01/Pasted-into-%E5%BF%AB%E9%80%9F%E7%94%9F%E6%88%90Sitemap%E5%B9%B6%E5%B0%86%E5%85%B6%E6%8F%90%E4%BE%9B%E7%BB%99%E8%B0%B7%E6%AD%8C%E7%99%BE%E5%BA%A6%E4%BB%A5%E5%8A%A0%E5%BF%AB%E6%94%B6%E5%BD%95-2.png" alt="img"></p>
<h2 id="3-Provide-sitemap"><a href="#3-Provide-sitemap" class="headerlink" title="3 Provide sitemap"></a>3 Provide sitemap</h2><blockquote>
<p>The original translation of alvincr.com is the official Google document: <a href="https://developers.google.com/search/docs/advanced/sitemaps/build-sitemap?hl=zh-cn#addsitemap">https://developers.google.com/search/docs/advanced/sitemaps/build-sitemap?hl=zh-cn#addsitemap</a></p>
<p>Google does not check the sitemap every time it crawls a website. We only view the site map when we first discover it; then only when you use the ping function to notify us of changes to the site map. Please only send sitemap-related reminders to Google when creating or updating a sitemap. If there are no changes to the sitemap, please do not submit or ping the sitemap to us multiple times.</p>
<p>There are several different ways you can provide sitemaps to Google:</p>
<ul>
<li><p><a href="https://support.google.com/webmasters/answer/7451001?hl=zh-cn">Submit it to Google using the Search Console sitemap tool</a></p>
</li>
<li><p>Insert the following line <code>robots.txt</code> anywhere in the file to specify the path to your site map.<br><code>Sitemap: http://example.com/sitemap_location.xml</code></p>
</li>
<li><p>Use the “ping” function to request us to crawl the site map. Send an HTTP GET request like the following: For example:<br><code>http://www.google.com/ping?sitemap=<*complete_url_of_sitemap*></code></p>
<p><code>http://www.google.com/ping?sitemap=https://example.com/sitemap.xml</code></p>
</li>
</ul>
</blockquote>
<h3 id="Method-1-Use-the-Search-Console-sitemap"><a href="#Method-1-Use-the-Search-Console-sitemap" class="headerlink" title="Method 1: Use the Search Console sitemap"></a>Method 1: <a href="https://support.google.com/webmasters/answer/7451001?hl=zh-cn">Use the Search Console sitemap</a></h3><h2 id="-1"><a href="#-1" class="headerlink" title></a><img src="/2021/01/08/generate%20Sitemap/2021010811350862.png" alt="img"><img src="data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw==" alt="Click and drag to move"></h2><p>Open the site map report and select the alvincr.com website in search property in the upper right corner.</p>
<h2 id="-2"><a href="#-2" class="headerlink" title></a><img src="/2021/01/08/generate%20Sitemap/20210108113526355.png" alt="img"><img src="data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw==" alt="Click and drag to move"></h2><p>Add the address of the server where the sitemap is located. According to the above operation, I put it in the sitemap folder and named it alvincr.com_2021.1.8.xml. Do not add / in front of the sitemap, Google adds it by default</p>
<p><img src="https://alvincr.com/wp-content/uploads/2021/01/Pasted-into-%E5%BF%AB%E9%80%9F%E7%94%9F%E6%88%90Sitemap%E5%B9%B6%E5%B0%86%E5%85%B6%E6%8F%90%E4%BE%9B%E7%BB%99%E8%B0%B7%E6%AD%8C%E7%99%BE%E5%BA%A6%E4%BB%A5%E5%8A%A0%E5%BF%AB%E6%94%B6%E5%BD%95-5.png" alt="img"></p>
<p>Add successfully display interface:</p>
<p><img src="https://alvincr.com/wp-content/uploads/2021/01/Pasted-into-%E5%BF%AB%E9%80%9F%E7%94%9F%E6%88%90Sitemap%EF%BC%8C%E5%B9%B6%E5%B0%86%E5%85%B6%E6%8F%90%E4%BE%9B%E7%BB%99%E8%B0%B7%E6%AD%8C%E7%99%BE%E5%BA%A6%E4%BB%A5%E5%8A%A0%E5%BF%AB%E6%94%B6%E5%BD%95-2.png" alt="img"></p>
<h3 id="Method-2-Use-robots"><a href="#Method-2-Use-robots" class="headerlink" title="Method 2: Use robots"></a>Method 2: Use robots</h3><blockquote>
<p><strong>robots.txt</strong> (uniform lowercase) is an <a href="https://zh.wikipedia.org/wiki/ASCII">ASCII-</a> encoded <a href="https://zh.wikipedia.org/wiki/%E6%96%87%E6%9C%AC%E6%96%87%E4%BB%B6">text file</a> stored in the root directory of a <a href="https://zh.wikipedia.org/wiki/%E7%BD%91%E7%AB%99">website</a> . It usually tells the bots of web <a href="https://zh.wikipedia.org/wiki/%E6%90%9C%E7%B4%A2%E5%BC%95%E6%93%8E">search engines</a> (also known as <a href="https://zh.wikipedia.org/wiki/%E7%BD%91%E7%BB%9C%E8%9C%98%E8%9B%9B">web spiders</a> ) which content on this website should not be searched Which ones can be obtained by the bot of the engine? Because URLs in some systems are case sensitive, the file name of robots.txt should be unified in lower case. robots.txt should be placed in the root directory of the website. If you want to individually define the behavior of search engine robots when accessing subdirectories, you can merge your customized settings into robots.txt in the root directory, or use robots <a href="https://zh.wikipedia.org/wiki/%E5%85%83%E6%95%B0%E6%8D%AE">metadata</a> (Metadata, also known as metadata).</p>
</blockquote>
<p>I remember that I have written an article about robots. You can use the search function to search, but I deleted the original robot file when I was dealing with the problem. Here I need to recreate a blank file and add the following code:</p>
<p>Sitemap: <a href="http://alvincr.com/sitemap/alvincr.com_2021.1.8.xml">http://alvincr.com/sitemap/alvincr.com_2021.1.8.xml</a></p>
<p><img src="https://alvincr.com/wp-content/uploads/2021/01/Pasted-into-%E5%BF%AB%E9%80%9F%E7%94%9F%E6%88%90Sitemap%EF%BC%8C%E5%B9%B6%E5%B0%86%E5%85%B6%E6%8F%90%E4%BE%9B%E7%BB%99%E8%B0%B7%E6%AD%8C%E7%99%BE%E5%BA%A6%E4%BB%A5%E5%8A%A0%E5%BF%AB%E6%94%B6%E5%BD%95-1.png" alt="img"></p>
<h3 id="Method-3-Use-the-ping-function-I-think-this-is-quite-convenient"><a href="#Method-3-Use-the-ping-function-I-think-this-is-quite-convenient" class="headerlink" title="Method 3: Use the ping function, I think this is quite convenient"></a>Method 3: Use the ping function, I think this is quite convenient</h3><p><code>http://www.google.com/ping?sitemap=:</code><a href="https://alvincr.com/sitemap/alvincr.com_2021.1.8.xml">http://alvincr.com/sitemap/alvincr.com_2021.1.8.xml</a></p>
<p>``</p>
<p>2021.1.8 supplement:</p>
<p>Do not use the above method to ping the site map, it is best to ping the newly created url link.</p>
<h3 id="Method-4-2021-1-8-supplement"><a href="#Method-4-2021-1-8-supplement" class="headerlink" title="Method 4: 2021.1.8 supplement"></a>Method 4: 2021.1.8 supplement</h3><p>Add update service in wp background-settings-compose, for example, Baidu’s update is <a href="http://ping.baidu.com/ping/RPC2">http://ping.baidu.com/ping/RPC2</a></p>
<p><img src="https://alvincr.com/wp-content/uploads/2021/01/Pasted-into-%E5%BF%AB%E9%80%9F%E7%94%9F%E6%88%90Sitemap%E5%B9%B6%E5%B0%86%E5%85%B6%E6%8F%90%E4%BE%9B%E7%BB%99%E8%B0%B7%E6%AD%8C%E7%99%BE%E5%BA%A6%E4%BB%A5%E5%8A%A0%E5%BF%AB%E6%94%B6%E5%BD%95-3.png" alt="img"></p>
<h1 id="3-Automatically-added"><a href="#3-Automatically-added" class="headerlink" title="3 Automatically added"></a>3 Automatically added</h1><p>Use the seo plug-in to follow the relevant settings, basically no operation is required, seo will automatically add a site map by default.</p>
<p>All in one SEO personally feels that the effect is not good. After all, it seems that I haven’t seen it for so long. Maybe it is a problem with my settings.</p>
<p>New Search Console (Google official tool)</p>
<p><img src="/2021/01/08/generate%20Sitemap/20210108133432683.png" alt="img"><img src="data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw==" alt="Click and drag to move"></p>
<p><a href="http://linkprocessor.com/affiliates/idevaffiliate.php?id=2164">Link Processor</a></p>
<h1 id="4-Attachment-Submitted-by-Baidu"><a href="#4-Attachment-Submitted-by-Baidu" class="headerlink" title="4 Attachment: Submitted by Baidu"></a>4 Attachment: Submitted by Baidu</h1><p>Address: <a href="https://ziyuan.baidu.com/linksubmit/index">https://ziyuan.baidu.com/linksubmit/index</a></p>
<p>Obtain Baidu’s sitemap file as described above, put it on the server and rename it.</p>
<p><img src="https://alvincr.com/wp-content/uploads/2021/01/Pasted-into-%E5%BF%AB%E9%80%9F%E7%94%9F%E6%88%90Sitemap%EF%BC%8C%E5%B9%B6%E5%B0%86%E5%85%B6%E6%8F%90%E4%BE%9B%E7%BB%99%E8%B0%B7%E6%AD%8C%E7%99%BE%E5%BA%A6%E4%BB%A5%E5%8A%A0%E5%BF%AB%E6%94%B6%E5%BD%95.png" alt="img"></p>
<p>Disclaimer: The author and ownership of this article belong to alvincr, address: alvincr.com</p>
]]></content>
<categories>
<category> web </category>
</categories>
<tags>
<tag> web </tag>
<tag> building </tag>
</tags>
</entry>
<entry>
<title><![CDATA[Hexo+github quickly builds the whole process of html5 static webpage]]></title>
<url>http://example.com/2021/01/05/Hexo+github/</url>
<content type="html"><![CDATA[<h5 id="view-my-personal-blog-original-article-for-more:"><a href="#view-my-personal-blog-original-article-for-more:" class="headerlink" title="view my personal blog original article for more:"></a>view my personal blog original article for more:</h5><p><a href="https://alvincr.com/2021/01/hexo-with-github_pages/">https://alvincr.com/2021/01/hexo-with-github_pages/</a></p>
]]></content>
<categories>
<category> hexo </category>
</categories>
<tags>
<tag> github </tag>
<tag> web </tag>
<tag> hexo </tag>
</tags>
</entry>
<entry>
<title><![CDATA[Knowledge about what cookies are and how to use them]]></title>
<url>http://example.com/2021/01/03/cookies%2520/</url>
<content type="html"><![CDATA[<p> view my personal blog original article for more:</p>
<p><a href="https://alvincr.com/2021/01/%e4%bd%95%e4%b8%bacookie%e5%8f%8a%e5%a6%82%e4%bd%95%e5%88%a9%e7%94%a8%e7%9a%84%e7%9b%b8%e5%85%b3%e7%9f%a5%e8%af%86/">https://alvincr.com/2021/01/%e4%bd%95%e4%b8%bacookie%e5%8f%8a%e5%a6%82%e4%bd%95%e5%88%a9%e7%94%a8%e7%9a%84%e7%9b%b8%e5%85%b3%e7%9f%a5%e8%af%86/</a></p>
<h1 id="1-Basic-knowledge"><a href="#1-Basic-knowledge" class="headerlink" title="1 Basic knowledge"></a>1 Basic knowledge</h1><p>I am not very interested in the history of cookie development, so I have taken a sentence: In June 1994, programmer Lou Montulli proposed to use cookies for calculations in network communications.</p>
<h2 id="1-1-Origin-of-the-name"><a href="#1-1-Origin-of-the-name" class="headerlink" title="1.1 Origin of the name"></a>1.1 Origin of the name</h2><blockquote>
<p>An <strong>HTTP cookie</strong> (also called <strong>web cookie</strong> , <strong>Internet cookie</strong> , <strong>browser cookie</strong> , or simply <strong>cookie</strong> ) is a small piece of <a href="https://en.wikipedia.org/wiki/Data_(computing)">data</a> stored on the <a href="https://en.wikipedia.org/wiki/User_(computing)">user</a> ‘s computer by the <a href="https://en.wikipedia.org/wiki/Web_browser">web browser</a> while <a href="https://en.wikipedia.org/wiki/Browsing">browsing</a> a <a href="https://en.wikipedia.org/wiki/Website">website</a> .</p>
<p>Cookies were once used for general client-side storage. While this was legitimate when they were the only way to store data on the client.</p>
</blockquote>
<p>Foreigners like to use daily necessities to name, especially Google uses food to name programs every day. The literal translation of a cookie is a cookie. It feels inexplicable to translate it literally, but it is relatively simple to understand. Cookies are a collection of cookies. Each cookie represents an individual, which is a piece of data.</p>
<h2 id="1-2-Safety-and-function"><a href="#1-2-Safety-and-function" class="headerlink" title="1.2 Safety and function"></a>1.2 Safety and function</h2><h3 id="1-2-1-Security"><a href="#1-2-1-Security" class="headerlink" title="1.2.1 Security"></a>1.2.1 Security</h3><blockquote>
<p>Under normal circumstances, cookies cannot transfer viruses or malware to your computer. Because the data in a cookie doesn’t change when it travels back and forth, it has no way to affect how your computer runs.</p>
</blockquote>
<p>Under normal circumstances, cookies cannot transfer viruses or malware to personal PCs, and the data in cookies will not change when transferred back and forth, so computer security will not be threatened.</p>
<p>In addition , the security of the authentication cookie usually depends on the security of the publishing website and the user’s web browser, and whether the cookie data is encrypted. Security vulnerabilities may allow hackers to read cookie data, or use it to gain access to user data, or (using the user’s credentials) to gain access to the website to which the cookie belongs. That is to say, if others really want to attack you, you will be recruited if you have cookies. Normal use of cookies is encrypted and security is guaranteed.</p>
<h3 id="1-2-2-Function"><a href="#1-2-2-Function" class="headerlink" title="1.2.2 Function"></a>1.2.2 Function</h3><p>The purpose of computer cookies is to help websites track personal activities, record and analyze user behavior . Everything has advantages and disadvantages. This will not only cause information leakage, but also bring great convenience to daily use. After all, every time I open it in my own home When I log on to the website on my computer, I really don’t want to repeatedly enter my account and password again and again; I don’t want the items added to the shopping cart to be emptied inexplicably.</p>
<h2 id="1-3-Create-cookies"><a href="#1-3-Create-cookies" class="headerlink" title="1.3 Create cookies"></a>1.3 Create cookies</h2><h3 id="1-3-1-Request"><a href="#1-3-1-Request" class="headerlink" title="1.3.1 Request"></a>1.3.1 Request</h3><p>After receiving the HTTP request, the server can send one or more Set-Cookie headers with a response. Cookies are usually stored by the browser, and then the cookie is sent with the request to the same server within the HTTP HTTP header. You can specify an expiration date or duration, after which cookies will no longer be sent. You can set other restrictions on specific domains and paths to limit the location of the cookie.</p>
<h3 id="1-3-2-Format"><a href="#1-3-2-Format" class="headerlink" title="1.3.2 Format"></a>1.3.2 Format</h3><p>(1) The Set-Cookie HTTP response header sends the cookie from the server to the user agent. The following is the simplest form</p>
<p>Set-Cookie: <cookie-name>=<cookie-value></cookie-value></cookie-name></p>
<p>(2) Server -> Client, make it store cookies: (Sure enough, they are named after the food, and even include the taste of it…)</p>
<blockquote>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">HTTP/2.0 200 OK</span><br><span class="line">Content-Type: text/html</span><br><span class="line">Set-Cookie: yummy_cookie=choco //choco是巧克力的简称</span><br><span class="line">Set-Cookie: tasty_cookie=strawberry</span><br><span class="line"></span><br><span class="line">[page content]</span><br></pre></td></tr></table></figure>
</blockquote>
<h3 id="1-3-3-Define-time-to-live"><a href="#1-3-3-Define-time-to-live" class="headerlink" title="1.3.3 Define time to live"></a>1.3.3 Define time to live</h3><p>Cookies do not exist indefinitely, they have a certain period. The survival of the settings is for the client, not the server. In addition, the Set-Cookie HTTP response header is used to send cookies from the server to the user agent.</p>
<blockquote>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">Set-Cookie: id=AlvinCR; Wed Dec 29 2021 14:23:41 GMT+0800 (中国标准时间);</span><br></pre></td></tr></table></figure>
</blockquote>
<h3 id="1-3-4-Security-Assurance"><a href="#1-3-4-Security-Assurance" class="headerlink" title="1.3.4 Security Assurance"></a>1.3.4 Security Assurance</h3><blockquote>
<p>There are two ways to ensure that the cookie is sent safely and cannot be accessed by accidental participants or scripts: the Secure attribute and the HttpOnly attribute.</p>
<p>Cookies with secure attributes are only sent to the server through encrypted requests based on the HTTPS protocol, and will never be sent to the server using insecure HTTP (except for the local host), so man-in-the-middle attackers cannot easily access them. Unsafe websites (with http: in the URL) cannot use the Secure attribute to set cookies. However, do not assume that Secure will block all access to sensitive information in cookies; for example, people who can access the client’s hard disk (if the HttpOnly attribute is not set, can access JavaScript) can read and modify it.</p>
<p>The JavaScript Document.cookie API cannot access cookies with the HttpOnly attribute. It is only sent to the server. For example, cookies that persist server-side sessions do not need to be available to JavaScript and should have the HttpOnly attribute. This preventive measure helps mitigate cross-site scripting (XSS) attacks.</p>
<p><a href="https://developer.mozilla.org/">https://developer.mozilla.org/</a></p>
</blockquote>
<h3 id="1-3-5-Relevance"><a href="#1-3-5-Relevance" class="headerlink" title="1.3.5 Relevance"></a>1.3.5 Relevance</h3><p>Cookies are associated with domains. If this domain is the same as the domain name of the page you are on, the cookie is called a first-party cookie. If the domain name is different, it is a third-party cookie. When the server hosting a webpage sets a first-party cookie, the page may contain images or other components stored on servers in other domains. The first cookie may generate third-party cookies, which are mainly used for advertising and track.</p>
<h2 id="1-4-Location"><a href="#1-4-Location" class="headerlink" title="1.4 Location"></a>1.4 Location</h2><h3 id="1-4-1-Own-program"><a href="#1-4-1-Own-program" class="headerlink" title="1.4.1 Own program"></a>1.4.1 Own program</h3><p>Since I haven’t added the SSL certificate to the website, the triangle icon + unsecure will be displayed; if it is a secure connection, a lock will be displayed. Click here and the following pop-up window will appear.</p>
<p><img src="https://alvincr.com/wp-content/uploads/2021/01/%E4%BD%95%E4%B8%BAcookie%E5%8F%8A%E5%A6%82%E4%BD%95%E5%88%A9%E7%94%A8%E7%9A%84%E7%9B%B8%E5%85%B3%E7%9F%A5%E8%AF%8620210113.png" alt="Knowledge about what cookies are and how to use them">Knowledge about what cookies are and how to use them</p>
<p>Click on the cookie to see the use of cookies on the website.</p>
<p><img src="https://alvincr.com/wp-content/uploads/2021/01/%E4%BD%95%E4%B8%BAcookie%E5%8F%8A%E5%A6%82%E4%BD%95%E5%88%A9%E7%94%A8%E7%9A%84%E7%9B%B8%E5%85%B3%E7%9F%A5%E8%AF%8620210113-1.png" alt="Knowledge about what cookies are and how to use them">Knowledge about what cookies are and how to use them</p>
<h3 id="1-4-2-Use-editthiscookie-plugin"><a href="#1-4-2-Use-editthiscookie-plugin" class="headerlink" title="1.4.2 Use editthiscookie plugin"></a>1.4.2 Use editthiscookie plugin</h3><p>Both have their own strengths</p>
<p><img src="https://alvincr.com/wp-content/uploads/2021/01/%E4%BD%95%E4%B8%BAcookie%E5%8F%8A%E5%A6%82%E4%BD%95%E5%88%A9%E7%94%A8%E7%9A%84%E7%9B%B8%E5%85%B3%E7%9F%A5%E8%AF%8620210113-2.png" alt="Knowledge about what cookies are and how to use them">Knowledge about what cookies are and how to use them</p>
<h2 id="1-5-Add-cookie"><a href="#1-5-Add-cookie" class="headerlink" title="1.5 Add cookie"></a>1.5 Add cookie</h2><p>Can be used boldly</p>
<p>javascript:document.cookie=”add cookie in there”</p>
<p>You can also use the above two tools to import cookies</p>
<h2 id="1-6-Clean-up-cookies"><a href="#1-6-Clean-up-cookies" class="headerlink" title="1.6 Clean up cookies"></a>1.6 Clean up cookies</h2><p>Basically, many software comes with cleanup items, and the general operations are</p>
<ol>
<li>Select the “Tools” button, point to “Security”, and select “Delete Browsing History”.</li>
<li>Check the “ <strong>Cookies and website data</strong> “ checkbox and select “ <strong>Delete</strong> “.</li>
</ol>
<h1 id="2-Special-operations"><a href="#2-Special-operations" class="headerlink" title="2 Special operations"></a>2 Special operations</h1><p>If you don’t want to remember a more complicated password, and you consider security, you can save the cookie after setting the password. When logging in from another computer, you only need to copy the cookie to log in (you need a better storage medium, in many cases The following is purely for trouble, but this article is mainly for learning cookie records, so the following content should also be understood)</p>
<h2 id="2-1-Login-with-cookie"><a href="#2-1-Login-with-cookie" class="headerlink" title="2.1 Login with cookie"></a>2.1 Login with cookie</h2><h3 id="2-1-1-Log-in-to-Netflix"><a href="#2-1-1-Log-in-to-Netflix" class="headerlink" title="2.1.1 Log in to Netflix"></a>2.1.1 Log in to Netflix</h3><p>Just use the <strong>cookies</strong> marked in red and imported into other personal computers <strong>.</strong></p>
<p><img src="https://alvincr.com/wp-content/uploads/2021/01/%E4%BD%95%E4%B8%BAcookie%E5%8F%8A%E5%A6%82%E4%BD%95%E5%88%A9%E7%94%A8%E7%9A%84%E7%9B%B8%E5%85%B3%E7%9F%A5%E8%AF%8620210113-3.png" alt="Knowledge about what cookies are and how to use them">Knowledge about what cookies are and how to use them</p>
<h3 id="2-1-2-Log-in-to-Baidu-Netdisk"><a href="#2-1-2-Log-in-to-Baidu-Netdisk" class="headerlink" title="2.1.2 Log in to Baidu Netdisk"></a>2.1.2 Log in to Baidu Netdisk</h3><p><a href="https://pandownload.com/faq/cookie.html">https://pandownload.com/faq/cookie.html</a></p>
<p>Other main reference articles:</p>
<p><a href="https://en.wikipedia.org/wiki/HTTP_cookie">https://en.wikipedia.org/wiki/HTTP_cookie</a></p>
<h1 id><a href="#" class="headerlink" title></a></h1><h1 id="3-A-powerful-way-to-view-cookies-added-on-January-13-2020"><a href="#3-A-powerful-way-to-view-cookies-added-on-January-13-2020" class="headerlink" title="3 A powerful way to view cookies: (added on January 13, 2020)"></a>3 A powerful way to view cookies: (added on January 13, 2020)</h1><h3 id="1View-the-request-header-recommended"><a href="#1View-the-request-header-recommended" class="headerlink" title="1View the request header (recommended)"></a>1View the request header (recommended)</h3><h4 id="1-1-Notes"><a href="#1-1-Notes" class="headerlink" title="1.1 Notes"></a>1.1 Notes</h4><p>Firefox browser is recommended, because the cookie generated by Google Chrome is not easy to use directly, and the generated format is the same as that generated by other methods. It is in the form of a list.</p>
<p>If there is no file generated in the console, just refresh the page (F5).</p>
<h4 id="1-2-Firefox-browser-★"><a href="#1-2-Firefox-browser-★" class="headerlink" title="1.2 Firefox browser (★)"></a>1.2 Firefox browser (★)</h4><p>Press F12 to enter the developer tools or right click-check (or direct shortcut Ctrl+shidt+i)</p>
<p>Select network-choose website on the left-choose file / option in the middle (root directory)-choose cookie on the right</p>
<p><img src="/2021/01/03/cookies%20/word-image-110.png" alt="img"></p>
<p>The obtained cookie can be directly copied and used by right-clicking, and Google Chrome can only copy line by line</p>
<p><img src="/2021/01/03/cookies%20/word-image-111.png" alt="img"></p>
<h4 id="1-3-Google-Chrome"><a href="#1-3-Google-Chrome" class="headerlink" title="1.3 Google Chrome"></a>1.3 Google Chrome</h4><p>Press F12 to enter the developer tools or right click-check (or direct shortcut Ctrl+shidt+i)</p>
<p><img src="/2021/01/03/cookies%20/word-image-112.png" alt="img"></p>
<p><img src="/2021/01/03/cookies%20/word-image-113.png" alt="img"></p>
<h3 id="2-console"><a href="#2-console" class="headerlink" title="2 console"></a>2 console</h3><h4 id="problem"><a href="#problem" class="headerlink" title="problem"></a>problem</h4><p>This method can view the content of the cookie, but it cannot be copied directly, so some special methods are needed, such as image to text, etc.</p>
<h4 id="method"><a href="#method" class="headerlink" title="method"></a>method</h4><p>Press F12 to enter the developer tools, enter in the console at position 1 below</p>
<p>javascript:alert(document.cookie)</p>
<p>Note: This code cannot be copied directly. In order to ensure security, the browser disables copying JS scripts by default and can only be entered manually.</p>
<p><img src="/2021/01/03/cookies%20/word-image-114.png" alt="img"></p>
<h3 id="3-View-Application-directly"><a href="#3-View-Application-directly" class="headerlink" title="3 View Application directly"></a>3 View Application directly</h3><p>Press F12 to enter the developer tools, select application, select cookies</p>
<p><img src="/2021/01/03/cookies%20/word-image-115.png" alt="img"></p>
<h3 id="4-attached"><a href="#4-attached" class="headerlink" title="4 attached:"></a>4 attached:</h3><h4 id="View-local-cookies"><a href="#View-local-cookies" class="headerlink" title="View local cookies"></a>View local cookies</h4><p>Taking Google cookie as an example, I searched for the location of all cookies through everything,</p>
<p><img src="/2021/01/03/cookies%20/word-image-116.png" alt="img"></p>
<p>Open the default cookies in C:\Users\Administrator\AppData\Local\Google\Chrome\User Data\Default, but this method is completely unclear where the cookie is used, it is only for developers.</p>
]]></content>
<categories>
<category> web </category>
</categories>
<tags>
<tag> web </tag>
<tag> building </tag>
<tag> cookies </tag>
</tags>
</entry>
<entry>
<title><![CDATA[Search engine skills finishing (Google) (reproduced)]]></title>
<url>http://example.com/2020/07/28/google%2520engine/</url>
<content type="html"><![CDATA[<h1 id><a href="#" class="headerlink" title></a></h1><p><img src="/2020/07/28/google%20engine/image-20210116133210994.png" alt="image-20210116133210994"></p>
<h1 id="1-General-search-technology"><a href="#1-General-search-technology" class="headerlink" title="1. General search technology"></a>1. General search technology</h1><h2 id="Default-fuzzy-search-automatic-phrase-split"><a href="#Default-fuzzy-search-automatic-phrase-split" class="headerlink" title="Default fuzzy search, automatic phrase split"></a>Default fuzzy search, automatic phrase split</h2><p>When you directly enter a search term in the search box, Google will perform fuzzy search by default, and can automatically split long phrases or sentences into small words for search;</p>
<h2 id="Exact-phrase-search"><a href="#Exact-phrase-search" class="headerlink" title="Exact phrase search"></a>Exact phrase search</h2><p>Add half-width quotation marks ([“”]) to keywords to achieve precise search;</p>
<h2 id="Wildcard"><a href="#Wildcard" class="headerlink" title="Wildcard"></a>Wildcard</h2><p>Google’s wildcard is the asterisk “*”, which must be used inside the exact search character double quotes. Use wildcards to replace unidentifiable words in keywords or phrases;</p>
<h2 id="Dot-matches-any-character"><a href="#Dot-matches-any-character" class="headerlink" title="Dot matches any character"></a>Dot matches any character</h2><p>Unlike the wildcard asterisk “*”, the dot “.” matches characters, not words, phrases, etc. The reserved characters are [, (,-etc;</p>
<h2 id="Boolean-logic"><a href="#Boolean-logic" class="headerlink" title="Boolean logic"></a>Boolean logic</h2><p>Boolean logic is the basic retrieval technology of many retrieval systems, and it is also applicable in search engines. In Google web search, you need to pay attention to: Google and many search engines, the logical relationship between multiple words is logical and (space )</p>
<p>When using logical operators, the words and logical operators need to be separated by spaces, including the various grammars described later, there must be spaces. Logical negation is a special case, that is, the minus sign must be connected with the corresponding word. For complex logical relationships, brackets can be used to group.</p>
<p>Logical AND: [Electronic Industry AND Research Report], there is little difference between spaces and AND and lowercase search results. This example is a research report in the search electronics industry.</p>
<p>Logical OR: [Electronics industry AND research report AND (talent | risk)] This example is to search for talent or risk research reports in the electronic industry.</p>
<p>Logical negation: [Electronics industry AND research report AND (talent | risk) -2007] This example is to search for research reports on talents or risks in the electronic industry, but not in 2007.</p>
<h2 id="Restrictions"><a href="#Restrictions" class="headerlink" title="Restrictions"></a>Restrictions</h2><p>The plus sign “+” is used to force a search, that is, the content after the plus sign must be included. Generally used together with the exact search symbol;</p>
<h2 id="Synonym"><a href="#Synonym" class="headerlink" title="Synonym"></a>Synonym</h2><p>Search only in English. Generally speaking, adding ~ symbols will result in more search results than not adding them. Overall, the effect is not very obvious.</p>
<h2 id="Number-range"><a href="#Number-range" class="headerlink" title="Number range"></a>Number range</h2><p>Use two dots “..” to indicate a range of numbers. It is generally used to search within the range of date, currency, size, weight, height, etc. It is best to give a certain meaning when used as a range.</p>
<p>[Olympics 1980..2004] When we search for the Olympic Games, especially in 2008, when we search for the word, the first few pages of the search results are almost all related to the 2008 Beijing Olympic Games, but some people want to know more The situation of the Olympic Games hosted elsewhere. The example is to search for Olympic information from 1980 to 2004.</p>
<p>[Gree Air Conditioning 2000..2800 yuan] Search price range. This example only searches for information where the price of Gree air-conditioning is between 2,000 yuan and 2,800 yuan.</p>
<p>[Gree Air Conditioning: 2800 yuan] Less than 2800 yuan.</p>
<p>[Gree Air Conditioning 2800.. Yuan] Above 2800 Yuan.</p>
<h2 id="Bracket-grouping"><a href="#Bracket-grouping" class="headerlink" title="Bracket grouping"></a>Bracket grouping</h2><p>Group when logical grouping to avoid logical confusion. Brackets “()” are grouping symbols.</p>
<p>[(Gree Air Conditioning | Haier Air Conditioning) RMB 2800..] Gree air conditioners or Haier air conditioners above 2800 yuan.</p>
<h1 id="2-Advanced-search-syntax"><a href="#2-Advanced-search-syntax" class="headerlink" title="2. Advanced search syntax"></a>2. Advanced search syntax</h1><h2 id="Search-in-title"><a href="#Search-in-title" class="headerlink" title="Search in title"></a>Search in title</h2><p>Usually the title is a high-level summary of the content, and the search results in the title will be more accurate. The syntax for restricting the title of the search page or document in Google search is: intitle</p>
<h2 id="Search-in-text"><a href="#Search-in-text" class="headerlink" title="Search in text"></a>Search in text</h2><p>Search only in the body of a web page or document. The syntax for restricting the search page or document body in the search is: intext</p>
<h2 id="Search-in-URL"><a href="#Search-in-URL" class="headerlink" title="Search in URL"></a>Search in URL</h2><p>The syntax for restricting the search URL in the search is: inurl.</p>
<p>It is the most powerful of the In-system commands. In other words, this advanced command can directly mine information from the URL of the website. As long as you have a little understanding of the URL format of ordinary websites, you can find what you need in a targeted manner. Resources-even hidden content.</p>
<p>Website builders usually concentrate a certain type of information in a website directory, so searching for words in the URL itself is a restriction on a certain aspect of content. If you add a certain word to match, the search results will be closer to the needs.</p>
<p>Search for pictures-[inurl:photo] Search results for all web addresses that contain the keyword “photo”. If Google image search focuses on displaying images, inurl search allows you to understand the general text content of the page before seeing the image, which is more convenient for judgment.</p>
<p>Using this command, you can often find the content of the keyword group picture (the photo in the command can also be replaced by picture, image, etc.).</p>
<p>Search for music-[inurl: mp3 graduate], search for “graduate” in all web addresses that contain “mp3”. The “graduates” returned at this time must be music, not other topics about “graduates”.</p>
<p>Another effective way to search for music in Google is that MP3 can be replaced with wma/rm, etc.</p>
<p>Search software-[inurl:download qq], directly search the download page of QQ software.</p>
<p>Search for electronic papers-[inurl:eprint “Information Retrieval”] Search for electronic papers related to Information Retrieval (usually such search results can directly download the full text).</p>
<p>Search the content of a specific website [inurl:lib.nit.net.cn lecture] Search <a href="http://lib.nit.net.cn/">http://lib.nit.net.cn</a> for the content of “lecture”, and the network address can have a directory, such as lib.nit .net.cn/dlib.</p>
<h2 id="Anchor-link-search"><a href="#Anchor-link-search" class="headerlink" title="Anchor link search"></a>Anchor link search</h2><p>When doing a website, sometimes anchors are used to link other parts of a page, so as to facilitate browsing and positioning.</p>
<p>For example, the directory navigation at the top of this page is achieved through anchor links, that is to say, the content of anchor links is usually an important chapter or the beginning of the content of the web page content, so the search for them can also reflect the web page better Subject content to improve the accuracy of search results.</p>
<p>For those who are familiar with web page production, you can view the anchored HTML code from the source code of the web page. For example, this is an anchor link: The first part of the web page Google web search in the anchor link syntax is: inanchor or allinanchor. The search scope is limited to the description text of the link anchor on the page.</p>
<h2 id="Document-type-limitation"><a href="#Document-type-limitation" class="headerlink" title="Document type limitation"></a>Document type limitation</h2><p>Google web search can not only search web pages, but also search various documents. Only documents can be searched through document type limitation, so that the content of the page is not displayed. The syntax is: filetype.</p>
<p>This grammar is very useful. We often use this grammar when looking for some sample essays or reference materials on the Internet. Filetype searches for specific file types based on file suffixes. For example, the supported documents are: pdf, ppt, doc, xls, etc.; web files: htm, asp, php, etc.</p>
<h2 id="Define-search"><a href="#Define-search" class="headerlink" title="Define search"></a>Define search</h2><p>The grammar of search definition in google web search is: define. Used to search for definitions or explanations.</p>
<p>When you encounter unfamiliar words or abbreviations in reading, studying, researching or writing papers, you can use the grammar to get precise definitions or explanations. And you can understand the definition of multiple languages.</p>
<h1 id="3-Search-for-web-related-information"><a href="#3-Search-for-web-related-information" class="headerlink" title="3. Search for web related information"></a>3. Search for web related information</h1><p>The grammar for searching web page related information provided by Google is: info.</p>
<p>Through this grammar, the snapshot information of the webpage, webpage link status, linked status and similar webpage information can be selected for browsing.</p>
<p>cache: Search Google cached pages (snapshot information)</p>
<p>[Cache:lib.nit.net.cn] The current cache syntax does not support Google Chinese. The link example given here is the result of a search in Google English.</p>
<p>The general situation of using cache syntax is: **When a link is inaccessible (or when the information is blocked); when the information has been modified and you want to see the previous information. **</p>
<p>related: Search for sites related to a specific page</p>
<p>[Related:google.cn] The search results are more search engines. The related syntax is very useful for discovering a certain type of information:</p>
<p>When you search for a library website with related, a large number of library websites will come up, such as [related:lib.nit.net.cn];<br>when you search for a journal website, you can search for a large number of related journals for the subject area , Such as [related:<a href="http://www.lis.ac.cn]">www.lis.ac.cn]</a></p>
<p>link: Search all pages linked to a specific URL</p>
<p>[Link:lib.nit.net.cn] Search the page that links to the library of Ningbo Institute of Technology. People who make websites often want to know which pages link to the website. It can also be used to discover what web pages (such as blogs) or favorites a certain page (news, information, etc.) is referenced by. In fact, the best search strategy should be like this: [link:lib.nit.net.cn -site:lib.nit.net.cn], delete your own link to your own page.</p>
<p>site: The search scope is limited to a certain website or top-level domain name.</p>
<p>[Medicine site: edu.cn] Search for information about “medicine” in my country’s education and research network, such as information on medical colleges or majors. This can exclude many companies in the medical field.</p>
<p>[Site:lib.nit.net.cn] Check the number of pages of Ningbo Institute of Technology library indexed by Google. Compare the “size” of different libraries (websites) on the Internet.</p>
<p>[Service site: lib.nit.net.cn] Search all pages about “service” on the website of the Library of Ningbo Institute of Technology. URL can have a path, now search all pages under that URL.</p>
<p>Reference website:</p>
<p><a href="https://www.jianshu.com/p/2b81cffd20e5">https://www.jianshu.com/p/2b81cffd20e5</a></p>
]]></content>
<categories>
<category> google </category>
</categories>
<tags>
<tag> goolge </tag>
<tag> research </tag>
</tags>
</entry>
<entry>
<title><![CDATA[Linux prevention of accidental deletion operations (use safe-rm; use mv command to delete files, accidental deletion recovery method)]]></title>
<url>http://example.com/2020/06/27/Linux%2520prevention%2520of%2520accidental%2520deletion%2520operations/</url>
<content type="html"><![CDATA[<h1 id><a href="#" class="headerlink" title></a></h1><p>The update will be included in the original text: <a href="http://alvincr.com/2020/06/linux%E9%98%B2%E8%AF%AF%E5%88%A0%E6%93%8D%E4%BD%9C%EF%BC%88%E4%BD%BF%E7%94%A8safe-rm%EF%BC%9B%E4%BD%BF%E7%94%A8mv%E5%91%BD%E4%BB%A4%E5%88%A0%E9%99%A4%E6%96%87%E4%BB%B6%EF%BC%89%EF%BC%88%E6%9B%B4/">http://alvincr.com/2020/06/linux%e9%98%b2%e8%af%af%e5%88%a0%e6%93%8d%e4%bd%9c %ef%bc%88%e4%bd%bf%e7%94%a8safe-rm%ef%bc%9b%e4%bd%bf%e7%94%a8mv%e5%91%bd%e4%bb%a4 %e5%88%a0%e9%99%a4%e6%96%87%e4%bb%b6%ef%bc%89%ef%bc%88%e6%9b%b4/ </a></p>
<h1 id="1-Why-does-text-based-Linux-have-no-recycle-bin"><a href="#1-Why-does-text-based-Linux-have-no-recycle-bin" class="headerlink" title="1. Why does text-based Linux have no recycle bin?"></a>1. Why does text-based Linux have no recycle bin?</h1><p>In my opinion: </p>
<p>1.Linux is a command line operating system. Unlike the graphical interface of win, linux cannot easily recover files quickly. For example, using mv under linux can achieve the same effect as the recycle bin under win, but no one uses mv+file name+ The path method actually only needs to create a folder named trash in the root directory, which can fully realize the function of the recycle bin. What is the specific reason for not using mv? I personally think that it is because of inconvenience and use Most Linux users are not computer novices, and generally know what they are doing. </p>
<p>\2. When linux deletes a file, if you use rm -r, there will be a prompt whether to delete it, similar to the simple recycle bin of win10, but it does not store it, but you need to directly confirm whether the file is deleted. (A lot of materials are taught to use rm -rf when writing code now) </p>
<p>Views of others: </p>
<p>\1. </p>
<blockquote>
<p>The tree-shaped file system is not compatible with the recycle bin. Could it be that the eighteenth-level directories are deleted, and when restoring from the recycle bin, restore the entire directory structure again? Most of the things turned out from the trash can in daily life are useless. It is precisely because the operation of deleting a file from the computer does not change the content of the file itself, what is thrown in the trash can can be used again. The problem now is that in fact we only have one form of file system, which is tree-shaped. This is neither necessary nor convenient for storing personal files. We should remove the tree file system. Only keep the index function in BeFS. Deleting a file just marks the file. When the disk space is full, I will prompt you to delete the file. <a href="https://www.zhihu.com/question/32294243/answer/135858069">https://www.zhihu.com/question/32294243/answer/135858069</a> </p>
</blockquote>
<p>\2. </p>
<blockquote>
<p>original: </p>
<p>I think you may be sadly uninformed about what is and OS and what is a GUI. </p>
<p>When using the CLI in either Windows or Linux the delete/rm command does in fact immediately delete a file. And there are utilities that can attempt to recover such files if used immediatel after the mistake happens. </p>
<p>Every GUI I have seen in Linux does have a trash can. Linux GUIs I have seen also come with backup software and if they don’t a script file using rsync isn’t hard to write/find in order to efficiently backup the drives. </p>
<p>You might read this rather dated article about how to use the trashcan even from the CLI. </p>
<p><a href="https://linuxtipstricks.wordpress.com/2009/05/16/how-to-manage-trash-can-or-recycle-bin-in-linux-desktop-graphic-environment/">How to manage Trash can or Recycle bin in Linux Desktop graphic environment </a></p>
<p>translation: </p>
<p>When using CLI in Windows or Linux, the delete /rm command actually does delete the file immediately. And, if the utility is used immediately after the error occurs, they can try to recover such files. </p>
<p>Every GUI I see in Linux has a trash can. The Linux GUIs I have seen also come with backup software, if they don’t use rsync to write script files, it’s not difficult to write/find in order to effectively backup the drive. </p>
</blockquote>
<p>\3. The following view is similar to mine </p>
<blockquote>
<p>original: </p>
<p>linux was generally for competent users…you can delete a file and ask for cofirmation rm -i filename. </p>
<p>also a competent user has backups…so even if most files got removed it would be ok </p>
<p>but if a library was removed or something like that, then you are in trouble. as you dont back these things up..and it may make your system unworkable …that said you can easily with a little bit of know how chroot into your system or you can use a live dvd and reinstall the library. </p>
<p>bottom line is once you use linux for a while you will delete required files…but chances are …you will only do this once. </p>
<p>linux is made to be used from command line and in windows if you delete something from command line i dont even think there is a dustbin. </p>
<p>translation: </p>
<p>Linux is usually suitable for capable users… You can delete files and ask for confirmation rm -i filename. </p>
<p>A capable user also has backups…so it doesn’t matter even if most files are deleted </p>
<p>However, if you delete a library or a similar library, you will run into trouble. Because you do not back up these contents, this may make your system not work properly… This means that you can easily import the chroot into the system, or you can use a live DVD and reinstall the library. </p>
<p>The most important thing is that once you use linux for a while, you will delete the files you need…but most likely…you will only do it once. </p>
<p>Linux is used from the command line, in Windows, if you delete something from the command line, I don’t even think there is a trash can. </p>
</blockquote>
<h1 id="2-Use-the-safe-rm-package"><a href="#2-Use-the-safe-rm-package" class="headerlink" title="2. Use the safe-rm package"></a>2. Use the safe-rm package</h1><p>It is not recommended for users who are familiar with Linux to use this method, this article only provides ideas </p>
<p>Safe-rm is a security tool designed to prevent accidental deletion of important files by replacing /bin/rm with a packaging program that will perform a blacklist of configurable files and directories that will never delete given parameters with an examination. </p>
<p>wget <a href="https://launchpad.net/safe-rm/trunk/0.12/+download/safe-rm-0.12.tar.gz">https://launchpad.net/safe-rm/trunk/0.12/+download/safe-rm-0.12.tar.gz</a> </p>
<p>tar -xzvf safe-rm-0.12.tar.gz </p>
<p>cd safe-rm-0.12 </p>
<p>vi /etc/profile You can add the PATH path in the last line: PATH=/usr/local/bin:$PATH </p>
<p>source /etc/profile </p>
<p>vi /etc/safe-rm.conf </p>
<p>Then enter the directory of the folder that needs to be protected </p>
<p><img src="/2020/06/27/Linux%20prevention%20of%20accidental%20deletion%20operations/aHR0cDovL2FsdmluY3IuY29tL3dwLWNvbnRlbnQvdXBsb2Fkcy8yMDIwLzA2L2U2MDY0ZmMyNmViYjNjYzBkM2JlODUwODM2ZWU5MTViLnBuZw.png" alt="img"></p>
<blockquote>
<p><strong>Note:</strong> Writing this way can prevent the deletion of common files in the test directory and the test directory, but it cannot prevent the link files in the test directory from being deleted. Therefore like <code>/lib</code>or <code>/lib64</code>, directories , there will be a lot of link files to library files underneath, and <strong>using <code>safe-rm</code>them does not protect the files</strong> . (Reference: <a href="https://linuxgeeks.github.io/2015/11/25/172103-%E4%BD%BF%E7%94%A8safe-rm%E9%81%BF%E5%85%8Drm%E5%">https://linuxgeeks.github.io/2015/11/25/172103-%E4%BD%BF%E7%94%A8safe-rm%E9%81%BF%E5%85%8Drm%E5%</a> 91%BD%E4%BB%A4%E8%AF%AF%E5%88%A0%E6%96%87%E4%BB%B6/, Remarks: The method of the reference website can be implemented on my machine. Question, it is not recommended to read the original text) </p>
</blockquote>
<h2 id="1-2-Effect"><a href="#1-2-Effect" class="headerlink" title="1.2 Effect: "></a>1.2 Effect: <img src="/2020/06/27/Linux%20prevention%20of%20accidental%20deletion%20operations/aHR0cDovL2FsdmluY3IuY29tL3dwLWNvbnRlbnQvdXBsb2Fkcy8yMDIwLzA2LzMzNGQ2ZmFmNmZiODlkZDEwOTFmMGRkMDQ3M2ViM2NmLnBuZw.png" alt="img"></h2><h1 id="3-Disable-the-rm-command-and-use-the-mv-command-instead"><a href="#3-Disable-the-rm-command-and-use-the-mv-command-instead" class="headerlink" title="3. Disable the rm command and use the mv command instead"></a>3. Disable the rm command and use the mv command instead</h1><p>It is not recommended for users who are familiar with Linux to use this method, this article only provides ideas </p>
<h1 id="4-Recovery-tool-extundelete"><a href="#4-Recovery-tool-extundelete" class="headerlink" title="4. Recovery tool extundelete"></a>4. Recovery tool extundelete</h1><h2 id="4-1-Recovery-principle"><a href="#4-1-Recovery-principle" class="headerlink" title="4.1 Recovery principle:"></a>4.1 Recovery principle:</h2><blockquote>
<p>Under Linux, you can use the “ls -id” command to view the inode value of a file or directory. For example, to view the inode value of the root directory, you can enter: </p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">[root@cloud1 ~]# ls -id / 2 /</span><br></pre></td></tr></table></figure>
<p>It can be seen that the inode value of the root directory is 2. </p>
<p>When using extundelete to restore files, it does not rely on a specific file format. First, extundelete will use the inode information of the file system (the inode of the root directory is generally 2) to obtain the information of all files under the current file system, including existing and deleted files , This information includes file name and inode. Then use the inode information combined with the log to query the block location where the inode is located, including direct block, indirect block and other information. Finally, use the dd command to back up the information to restore the data file. </p>
</blockquote>
<p>Reference: <a href="https://blog.csdn.net/coco3600/article/details/100232811">https://blog.csdn.net/coco3600/article/details/100232811</a> </p>
<h2 id="4-2-Installation-and-use"><a href="#4-2-Installation-and-use" class="headerlink" title="4.2 Installation and use"></a>4.2 Installation and use</h2><p>Common open source recovery tools are: debugfs, R-Linux, ext3grep, extundelete, the following is the extundelete operation method </p>
<blockquote>
<p><strong>1. Install dependencies</strong> </p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">yum -y install e2fsprogs-devel gcc</span><br></pre></td></tr></table></figure>
<p><strong>2. Unzip the toolkit</strong> </p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">tar jxf extundelete-0.2.4.tar.bz2</span><br></pre></td></tr></table></figure>
<p><strong>3. Specify the installation directory, compile, compile and install</strong> </p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">./configure ; make ; make install</span><br></pre></td></tr></table></figure>
<hr>
<p><strong>use</strong> </p>
<p><strong>Common parameters:</strong> </p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">--after dtime 时间参数,表示在某段时间之后被删除的文件或目录</span><br><span class="line">--before dtime 时间参数,表示在某段时间之前被删除的文件或目录</span><br><span class="line">--inode ino 显示节点 ino 的信息</span><br><span class="line">--block blk 显示数据块 blk 的信息</span><br><span class="line">--restore-inode ino 表示恢复节点 ino 的文件,用来恢复单个文件</span><br><span class="line">--restore-file path 表示恢复指定路径下的文件,用来恢复目录下所有文件</span><br><span class="line">--restore-all 表示恢复所有被删除的目录跟文件</span><br></pre></td></tr></table></figure>
<p><strong>Start the recovery process:</strong> </p>
<p><strong>1. Find the directory id of the deleted file</strong> </p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">ls -id /xxx/xxx/</span><br></pre></td></tr></table></figure>
<p>Note: The leftmost output is the ID number. </p>
<p><strong>2. View the deleted upper directory inode</strong> </p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"># extundelete 所在分区名称 --inode ID号</span><br><span class="line">extundelete /dev/sdb1 --inode 130619</span><br></pre></td></tr></table></figure>
<p><strong>3. Restore data, restore all deleted data in the specified directory</strong> </p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"># extundelete 数据所在分区名称 --restore-directory 恢复数据的目录</span><br><span class="line">extundelete /dev/sdb1 --restore-directory /xxx/xxx/xxx/</span><br></pre></td></tr></table></figure>
<p><strong>4. Complete the follow-up work of recovery</strong> </p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"># 恢复数据后,会把恢复数据送到当前路径的RECOVERED_FILES/内,再把恢复的数据拿回原处</span><br><span class="line">cp RECOVERED_FILES/xxx/xxx/* /xxx/xxx/xxx/</span><br></pre></td></tr></table></figure>
<p>Method source: <a href="https://www.cnblogs.com/xiangsikai/p/10779457.html">https://www.cnblogs.com/xiangsikai/p/10779457.html</a> <a href="https://www.cnblogs.com/xiangsikai/p/10779457.html">https://www.cnblogs.com/xiangsikai/p/10779457.html</a> </p>
</blockquote>
]]></content>
<categories>
<category> linux </category>
</categories>
<tags>
<tag> linux </tag>
<tag> delete </tag>
</tags>
</entry>
<entry>
<title><![CDATA[Differences between dynamic webpages, pseudo-static and static webpages and related knowledge]]></title>
<url>http://example.com/2020/05/24/dynamic%2520webpages,%2520pseudo-static%2520and%2520static%2520/</url>
<content type="html"><![CDATA[<h1 id><a href="#" class="headerlink" title></a></h1><h5 id="view-my-personal-blog-original-article-for-more:"><a href="#view-my-personal-blog-original-article-for-more:" class="headerlink" title="view my personal blog original article for more:"></a>view my personal blog original article for more:</h5><p><a href="https://alvincr.com/2020/05/%e5%8a%a8%e6%80%81%e7%bd%91%e9%a1%b5%e3%80%81%e4%bc%aa%e9%9d%99%e6%80%81%e5%92%8c%e9%9d%99%e6%80%81%e7%bd%91%e9%a1%b5%e7%9a%84%e5%8c%ba%e5%88%ab%e5%8f%8a%e7%9b%b8%e5%85%b3%e7%9f%a5%e8%af%86/">https://alvincr.com/2020/05/%e5%8a%a8%e6%80%81%e7%bd%91%e9%a1%b5%e3%80%81%e4%bc%aa%e9%9d%99%e6%80%81%e5%92%8c%e9%9d%99%e6%80%81%e7%bd%91%e9%a1%b5%e7%9a%84%e5%8c%ba%e5%88%ab%e5%8f%8a%e7%9b%b8%e5%85%b3%e7%9f%a5%e8%af%86/</a></p>
<p><img src="/2020/05/24/dynamic%20webpages,%20pseudo-static%20and%20static%20/image-20210116124426414.png" alt="image-20210116124426414"></p>
<h1 id="1-Definition"><a href="#1-Definition" class="headerlink" title="1. Definition"></a>1. Definition</h1><h2 id="1-1-Dynamic-webpage"><a href="#1-1-Dynamic-webpage" class="headerlink" title="1.1 Dynamic webpage"></a>1.1 Dynamic webpage</h2><blockquote>
<p><strong>Dynamic webpage</strong> is a collective term for all dynamically generated and dynamically updated webpages. Contrary to traditional static web pages, it will generate different web pages due to changes in variables. This may be a web page generated on the server side, a web page generated on the user side, or a mixture of the two. </p>
<p>The dynamic web page on the server side refers server through the <a href="https://zh.wikipedia.org/wiki/%E6%87%89%E7%94%A8%E7%A8%8B%E5%BC%8F%E4%BC%BA%E6%9C%8D%E5%99%A8">application server </a>processing the server side <a href="https://zh.wikipedia.org/wiki/%E8%84%9A%E6%9C%AC">script </a>to the web page generated by the . The parameters passed by the server to the script determine how each web page is generated, sometimes including how to generate more user-side scripts. Common implementation methods are <a href="https://zh.wikipedia.org/wiki/PHP">PHP </a>, <a href="https://zh.wikipedia.org/wiki/Active_Server_Pages">Active Server Pages </a>(Asp), and <a href="https://zh.wikipedia.org/wiki/%E9%80%9A%E7%94%A8%E7%BD%91%E5%85%B3%E6%8E%A5%E5%8F%A3">Common Gateway Interface </a>(CGI). After the server-side script is executed, the generated web page is a standard HTML page, and all server-side scripts will not be passed to the client. </p>
<p>The dynamic webpage on the user side is processed when the browser loads the webpage. <a href="https://zh.wikipedia.org/wiki/JavaScript">JavaScript </a>and other scripting languages determine how the received HTML is embedded in the <a href="https://zh.wikipedia.org/wiki/%E6%96%87%E6%A1%A3%E5%AF%B9%E8%B1%A1%E6%A8%A1%E5%9E%8B">Document Object Model </a>(DOM). These scripting languages can also dynamically update or change the original <a href="https://zh.wikipedia.org/wiki/%E6%96%87%E6%A1%A3%E5%AF%B9%E8%B1%A1%E6%A8%A1%E5%9E%8B">document object model </a>. </p>
</blockquote>
<p>Summary: A dynamic web page is a web page that changes with operation, generated by a script, and may be a mixture of server-side and user-side. </p>
<h2 id="1-2-Pseudo-static-webpage"><a href="#1-2-Pseudo-static-webpage" class="headerlink" title="1.2 Pseudo-static webpage"></a>1.2 Pseudo-static webpage</h2><blockquote>
<p>Pseudo-static is relative to the real static. Usually, in order to enhance <a href="https://baike.baidu.com/item/%E6%90%9C%E7%B4%A2%E5%BC%95%E6%93%8E/104812">search engines </a>the friendliness of , we generate static pages of article content, but some friends display some information in real time. Or I want to use dynamic scripts to solve some problems. Do not use static methods to display website content. But this loses the friendliness of search engines. How to find an intermediate method between the two? This produces pseudo-static technology. Pseudo-static technology means that the display is in the form of static pages such as html, but it is actually processed by dynamic scripts such as ASP. </p>
</blockquote>
<p>Summary: Use dynamic scripts to process static pages and generate pages. </p>
<p>Note: Pseudo-static only changes the form of URL, but it is actually a dynamic page </p>
<h2 id="1-3-Static-webpage"><a href="#1-3-Static-webpage" class="headerlink" title="1.3 Static webpage"></a>1.3 Static webpage</h2><blockquote>
<p>Static pages, namely static pages, is real, without going through the <a href="https://baike.baidu.com/item/%E6%9C%8D%E5%8A%A1%E5%99%A8/100571">server </a>is <a href="https://baike.baidu.com/item/%E7%BC%96%E8%AF%91/1258343">compiled </a>, loaded directly to the client <a href="https://baike.baidu.com/item/%E6%B5%8F%E8%A7%88%E5%99%A8/213911">browser </a>is displayed on. Static pages need to occupy a certain amount of server space, and can not independently manage and publish updated pages. If you want to update the content of the web page, you must download through the <a href="https://baike.baidu.com/item/FTP/13839">FTP </a>the file software and use the web page creation software to modify (except for technologies such as fso). Examples of common static pages: .html extension, .htm extension. </p>
</blockquote>
<p>Summary: We often see static web pages ending with html in our downloads. They have not undergone plastic surgery since they were born, and they have always been like that. </p>
<h1 id="2-The-advantages-disadvantages-and-characteristics-of-various-web-pages"><a href="#2-The-advantages-disadvantages-and-characteristics-of-various-web-pages" class="headerlink" title="2. The advantages, disadvantages and characteristics of various web pages"></a>2. The advantages, disadvantages and characteristics of various web pages</h1><h2 id="2-1-Dynamic-web-pages"><a href="#2-1-Dynamic-web-pages" class="headerlink" title="2.1 Dynamic web pages"></a>2.1 Dynamic web pages</h2><p>Advantages: easy to maintain, easy to query data, small storage resources </p>
<p>Disadvantages: not conducive to search engine inclusion, high production cost, and need for maintenance </p>
<blockquote>
<p>Not conducive to inclusion: usually dynamic scripts need certain information to return the page content, the most common such as Cookie data, SessionID or an environment variable. But for search engine Spider programs, it is impossible for them to know how to use your search function or what questions to ask. Because of this, Spider’s retrieval of websites often has to stop before a dynamic site. In addition, a question mark (?) and a percent sign (%) are included in the URL of the dynamic page. There are also symbols such as &,%, + and $ which are often seen in the URL of a dynamic page. Such URLs are called “environmental variables” (querystring). However, most SPIDERs cannot interpret the characters after the symbol “?”. Obviously, since this URL does not actually exist, they found nothing. Therefore, if your entire website or most of the web pages on the website are dynamically generated, in order to make SPIDER easy to read the content on your website, you need to make certain modifications to the website. Some search engines often refuse to search the URL of the static page (that is, the dynamic page saved as a static page) URL under the cgi-bin directory when searching for the page. </p>
</blockquote>
<p>Features: Display the content stored in the database to the customer in a dynamic form, and store the customer’s data in the database for later use. Therefore, the information stored in the database running in the background of the website is updated faster. </p>
<h2 id="2-2-Pseudo-static-webpage"><a href="#2-2-Pseudo-static-webpage" class="headerlink" title="2.2 Pseudo-static webpage"></a>2.2 Pseudo-static webpage</h2><p>Advantages: easy to include </p>
<p>Disadvantages: take up more CPU </p>
<p><strong>Features: The address of the static page is real, does it not contain it in the path? Variable symbols such as &% are more friendly to search engines and easier to be trusted. In order to pursue the advantages of dynamic pages and static pages and avoid shortcomings, “pseudo-static” has been produced. On the basis of dynamic pages, url rewriting is used The technology inserts the transfer parameters into the URL address to confuse the spider.</strong> </p>
<h2 id="2-3-Static-webpage"><a href="#2-3-Static-webpage" class="headerlink" title="2.3 Static webpage"></a>2.3 Static webpage</h2><p>Advantages: fast speed, cross-platform, cross-server, and can separate the database and back-end system from the front desk, thereby improving site security. </p>
<p>Disadvantages: high resource consumption, poor interactivity, complicated content update and maintenance </p>
<blockquote>
<p>Since static pages are stored in the server, Chinese medicine occupies space and memory. It is conceivable that if a forum has 100,000 posts and the size of each post is 100K, if all the static pages exist in the server, they will occupy 10G, not including storage calculations. The space is wasted, so it consumes space resources. </p>
</blockquote>
<p>Features: Each page of a static webpage has a fixed URL, and the webpage URL is suffixed with common forms such as .htm, .html, .shtml, and does not contain “?”. </p>
<h1 id="3-File-format"><a href="#3-File-format" class="headerlink" title="3. File format"></a>3. File format</h1><p>The format of the web page acquisition page: </p>
<ul>
<li>Static surface: htm, html, shtml, xml </li>
<li>Dynamic pages: asp, jsp, php, perl, cgi, ASP.net, Perl, CGI </li>
</ul>
<h1 id="4-Working-principle"><a href="#4-Working-principle" class="headerlink" title="4. Working principle"></a>4. Working principle</h1><blockquote>
<p>The workflow of a static web page can be divided into the following 4 steps:<br>① Write a static file and publish it on the web server;<br>② The user enters the URL of the static web page in the address bar of the browser and presses the Enter key, the browser sends an access request to a web server;<br>③ web server to find the location of this static files, and converts it to <strong>stream HTML</strong> spread to the user’s browser;<br>④ browser has received <strong>the HTML stream</strong> , the display content of this page. </p>
</blockquote>
<hr>
<blockquote>
<p>The workflow of dynamic web pages is divided into the following 4 steps:<br>① compile dynamic web files, including program codes, and publish them on the web server;<br>② the user enters the URL of the dynamic web page in the address bar of the browser and presses enter , the browser sends an access request to a web server;<br>③ web server to find the location of this dynamic page, and wherein the program code <strong>dynamically creates HTML stream</strong> transmitted to the user’s browser;<br>④ the browser receives the <strong>HTML stream</strong> , the display of this page content. </p>
</blockquote>
<h1 id="5-Answers-to-related-questions"><a href="#5-Answers-to-related-questions" class="headerlink" title="5. Answers to related questions"></a>5. Answers to related questions</h1><h2 id="5-1-Why-don’t-search-engines-read-it-Content-after"><a href="#5-1-Why-don’t-search-engines-read-it-Content-after" class="headerlink" title="5.1 Why don’t search engines read it? Content after"></a>5.1 Why don’t search engines read it? Content after</h2><blockquote>
<p>The SPIDER of the search engine is unwilling to read the web pages placed in the cgi-bin directory, or the URL contains characters with the symbol “?”. The reason is that if an “infinite” number of URLs are provided in the CGI, then SPIDER will often be trapped in an endless loop because of the retrieval of these “infinite” web pages. These are the so-called spidertraps. The database program may also create a similar situation to SPIDER. Therefore, in order to avoid possible pitfalls, Spider will not read the characters after the “?” in URLs with the symbol “?”. If the Spider is trapped by your server, it is not only bad for the Spider itself, but Spider’s repeated access requests to your website pages will also cause your server system to completely paralyze. </p>
</blockquote>
<h2 id="5-2-Why-are-pseudo-static-web-pages-easy-to-be-included"><a href="#5-2-Why-are-pseudo-static-web-pages-easy-to-be-included" class="headerlink" title="5.2 Why are pseudo-static web pages easy to be included"></a>5.2 Why are pseudo-static web pages easy to be included</h2><blockquote>
<p>In the article list, convert the link of the article such as /blog/articleInfo.do?userName=zy&&blogId=1&&articleId=1 into a URL like blog/a/0101002526B90C548A833416.html, so that the spider can crawl in and see the corresponding content, because Each article in the article list is a different static URL. </p>
</blockquote>
<h2 id="5-3-The-significance-of-mod-rewrite"><a href="#5-3-The-significance-of-mod-rewrite" class="headerlink" title="5.3 The significance of mod_rewrite"></a>5.3 The significance of mod_rewrite</h2><p>Crawlers don’t like to crawl dynamic webpages with question marks. No matter how the parameters are added, the returned content remains the same. For example, <a href="http://alvincr.com/?2222222222222">http://alvincr.com/?2222222222222</a> will point to my first page. So with mod_rewrite, it can remap addresses. The web server receives the request for the address of the page and remaps it, and then executes the PHP program. (The above URLs are all hypothetical) In this way, the URL presented to the outside becomes the same as the URL of a static webpage without a question mark without internal changes. </p>
<h2 id="5-4-Why-crawlers-crawl-pseudo-dynamic-web-pages"><a href="#5-4-Why-crawlers-crawl-pseudo-dynamic-web-pages" class="headerlink" title="5.4 Why crawlers crawl pseudo-dynamic web pages"></a>5.4 Why crawlers crawl pseudo-dynamic web pages</h2><blockquote>
<p>Search engines will not record URLs with question marks because search engines are afraid of entering an endless loop due to question marks (previously, there was a loophole in the moving web, and spiders could not get in and out), so many times the address with question marks will not go in. , Pseudo-static is actually static for search engines, because there is no question mark in the address. </p>
<p>The address of the static page is real, is it not included in the path? Variable symbols such as &% are more friendly to search engines and easier to be trusted. In order to pursue the advantages of dynamic pages and static pages and avoid shortcomings, “pseudo-static” has been produced. Based on dynamic pages, URL rewriting is used The technology inserts the transfer parameters into the URL address to confuse the spider. </p>
</blockquote>
<h1 id="6-Related-knowledge"><a href="#6-Related-knowledge" class="headerlink" title="6. Related knowledge"></a>6. Related knowledge</h1><h2 id="6-1-AJAX"><a href="#6-1-AJAX" class="headerlink" title="6.1 AJAX "></a>6.1 <a href="https://zh.wikipedia.org/wiki/AJAX">AJAX </a></h2><blockquote>
<p><strong>AJAX</strong> “ <strong>Asynchronous JavaScript and XML</strong> “ (asynchronous <a href="https://zh.wikipedia.org/wiki/JavaScript">JavaScript </a>and <a href="https://zh.wikipedia.org/wiki/XML">XML </a>stands for technology), which refers to a set of that integrate multiple <a href="https://zh.wikipedia.org/wiki/%E7%80%8F%E8%A6%BD%E5%99%A8">browser- </a>side <a href="https://zh.wikipedia.org/wiki/%E7%B6%B2%E9%A0%81">web page </a>development technologies technologies. </p>
<p>Reason: </p>
<p>Traditional web applications allow the user to fill in a form and to the when the form is submitted <a href="https://zh.wikipedia.org/wiki/%E7%B6%B2%E9%A0%81%E4%BC%BA%E6%9C%8D%E5%99%A8">web server </a>send a request . The server receives and processes the incoming form, and then sends it back to a new web page, but this approach wastes a lot of bandwidth, because most of the in the two pages are <a href="https://zh.wikipedia.org/wiki/HTML">HTML </a>codes often the same. Since each application communication needs to send a request to the server, the response time of the application depends on the response time of the server. This causes the user interface to respond much slower than native applications. </p>
<p>Appearance: </p>
<p>Unlike this, AJAX applications can only send and retrieve necessary data to the server, and use JavaScript on the client to process the response from the server. Because the data exchanged between the server and the browser is greatly reduced, the server responds faster. At the same time, a lot of processing work can be done on the making the request <a href="https://zh.wikipedia.org/wiki/%E5%AE%A2%E6%88%B7%E7%AB%AF">client </a>machine , so the load on the Web server is also reduced. </p>
<p>There are problems: </p>
<p>The main criticism of the application of Ajax is that it may destroy the browser’s back and bookmark functions [<a href="https://zh.wikipedia.org/wiki/AJAX#cite_note-3">3] </a>. In the case of dynamically updating the page, the user cannot go back to the previous page state, because the browser can only record the in the history <a href="https://zh.wikipedia.org/w/index.php?title=%E9%9D%99%E6%80%81%E9%A1%B5%E9%9D%A2&action=edit&redlink=1">static page </a>. </p>
</blockquote>
<p>Summary: AJAX can achieve partial updates of web pages, and keep the parts that do not need to be updated, so that the web application can respond to user actions more quickly. </p>
<p>reference: </p>
<p>Wikipedia, Baidu Encyclopedia </p>
<p>Static website-pseudo-static & SEO </p>
<p><a href="https://blog.csdn.net/sunxianghuang/article/details/85938464">https://blog.csdn.net/sunxianghuang/article/details/85938464</a> </p>
<p>What is the difference between a static web page and a dynamic web page? </p>
<p><a href="https://zhuanlan.zhihu.com/p/104151537">https://zhuanlan.zhihu.com/p/104151537</a> </p>
<p>About the characteristics and advantages of pseudo-static </p>
<p><a href="https://blog.csdn.net/phphot/article/details/2208534">https://blog.csdn.net/phphot/article/details/2208534</a> </p>
]]></content>
<categories>
<category> web </category>
</categories>
<tags>
<tag> web </tag>
<tag> wordpress </tag>
</tags>
</entry>
<entry>
<title><![CDATA[VM installation Android X86 problem collection (install x86, GRUB boot, skip the console interface)]]></title>
<url>http://example.com/2020/05/12/VM%2520installation%2520Android%2520X86/</url>
<content type="html"><![CDATA[<h1 id><a href="#" class="headerlink" title></a></h1><p>The latest full version: </p>
<p><a href="http://alvincr.com/2020/05/vm%E5%AE%89%E8%A3%85%E5%AE%89%E5%8D%93x86/">http://alvincr.com/2020/05/vm%e5%ae%89%e8%a3%85%e5%ae%89%e5%8d%93x86/ </a></p>
<h2 id="Create-a-virtual-machine"><a href="#Create-a-virtual-machine" class="headerlink" title="Create a virtual machine"></a>Create a virtual machine</h2><p>PDF version link: Link: <a href="https://pan.baidu.com/s/11jZEzvC3PjBRQJxj8P_mUg">https://pan.baidu.com/s/11jZEzvC3PjBRQJxj8P_mUg </a>Extraction code: ccrr<br><img src="/2020/05/12/VM%20installation%20Android%20X86/20200419135454474.png" alt="Insert picture description here "></p>
<ol>
<li>Use typical<br>explanations </li>
</ol>
<p><img src="/2020/05/12/VM%20installation%20Android%20X86/20200419134917248.png" alt="Insert picture description here "></p>
<ol>
<li>Load the image file directly </li>
</ol>
<p><img src="/2020/05/12/VM%20installation%20Android%20X86/20200419134921593.png" alt="Insert picture description here "></p>
<ol>
<li>The following all use the default operation to install. </li>
<li>Show that you are ready to customize the hardware when creating a virtual machine (you can also customize it in the virtual machine tab settings, or you can customize it in the startup interface), and start the virtual machine after creation.<br><img src="/2020/05/12/VM%20installation%20Android%20X86/20200419134928977.png" alt="Insert picture description here "></li>
</ol>
<h2 id="Install-IOS-image-file"><a href="#Install-IOS-image-file" class="headerlink" title="Install IOS image file"></a>Install IOS image file</h2><blockquote>
<p>2.1 Wait for boot and choose to install to hard drive<br><img src="/2020/05/12/VM%20installation%20Android%20X86/20200419134933561.png" alt="Insert picture description here "></p>
</blockquote>
<blockquote>
<p>2.2 Create a new partition<br><img src="/2020/05/12/VM%20installation%20Android%20X86/20200419134938876.png" alt="Insert picture description here "></p>
</blockquote>
<blockquote>
<p>2.3 Do not use GPT to avoid BOOT failure.<br><img src="/2020/05/12/VM%20installation%20Android%20X86/20200419134942370.png" alt="Insert picture description here "></p>
</blockquote>
<blockquote>
<p>2.4 Create a new partition (new option)<br><img src="/2020/05/12/VM%20installation%20Android%20X86/20200419134945703.png" alt="Insert picture description here "></p>
</blockquote>
<blockquote>
<p>2.5 Select the first partition<br><img src="/2020/05/12/VM%20installation%20Android%20X86/20200419134949358.png" alt="Insert picture description here "></p>
</blockquote>
<blockquote>
<p>2.6 Customize the partition size. In order to facilitate the management, the SD card is not set, so use the default operation to divide all into one disk.<br><img src="/2020/05/12/VM%20installation%20Android%20X86/20200419135007604.png" alt="Insert picture description here "></p>
</blockquote>
<blockquote>
<p>2.7 Select Bootable, the word Boot will appear in Flags<br><img src="/2020/05/12/VM%20installation%20Android%20X86/20200419135026510.png" alt="Insert picture description here "></p>
</blockquote>
<blockquote>
<p>2.8 Select write for write operation, enter yes to confirm operation<br><img src="/2020/05/12/VM%20installation%20Android%20X86/20200419135040979.png" alt="Insert picture description here "></p>
<p><img src="/2020/05/12/VM%20installation%20Android%20X86/20200419135044628.png" alt="Insert picture description here "></p>
</blockquote>
<blockquote>
<p>2.9 Select Quit to exit. Since then, Android has created a new partition. Now let’s set up the boot </p>
</blockquote>
<blockquote>
<p>The following interface appears after Quit exits, use the default operation<br><img src="/2020/05/12/VM%20installation%20Android%20X86/20200419135057291.png" alt="Insert picture description here "></p>
</blockquote>
<blockquote>
<p>2.10 Choose ext4 for sda1 format, other formats are prone to BUG<br><img src="/2020/05/12/VM%20installation%20Android%20X86/20200419135100409.png" alt="Insert picture description here "></p>
</blockquote>