-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
1527 lines (913 loc) · 158 KB
/
index.html
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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="referrer" content="no-referrer">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link rel="dns-prefetch" href="https://SmallFlames.github.io">
<title>
南汐
</title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta property="og:type" content="website">
<meta property="og:title" content="南汐">
<meta property="og:url" content="https://smallflames.github.io/index.html">
<meta property="og:site_name" content="南汐">
<meta property="og:locale" content="zh_CN">
<meta property="article:author" content="Xia Zheng">
<meta name="twitter:card" content="summary">
<link rel="alternative" href="/atom.xml" title="南汐" type="application/atom+xml">
<link rel="icon" href="/img/head.png">
<link rel="stylesheet" type="text/css" href="/./main.0cf68a.css">
<style type="text/css">
#container.show {
background: linear-gradient(200deg,#a0cfe4,#e8c37e);
}
</style>
<meta name="generator" content="Hexo 6.3.0"></head>
<body>
<div id="container" q-class="show:isCtnShow">
<canvas id="anm-canvas" class="anm-canvas"></canvas>
<div class="left-col" q-class="show:isShow">
<div class="overlay" style="background: #4d4d4d"></div>
<div class="intrude-less">
<header id="header" class="inner">
<a href="/" class="profilepic">
<img src="/img/18221454.jpg" class="js-avatar">
</a>
<hgroup>
<h1 class="header-author"><a href="/">南 汐</a></h1>
</hgroup>
<p class="header-subtitle">勇敢的去做你认为正确的事情!</p>
<nav class="header-menu">
<ul>
<li><a href="/">主页</a></li>
<li><a href="/tags/%E6%97%A5%E5%B8%B8/">日常</a></li>
</ul>
</nav>
<nav class="header-smart-menu">
<a q-on="click: openSlider(e, 'innerArchive')" href="javascript:void(0)">所有文章</a>
<a q-on="click: openSlider(e, 'friends')" href="javascript:void(0)">友链</a>
<a q-on="click: openSlider(e, 'aboutme')" href="javascript:void(0)">关于我</a>
</nav>
<nav class="header-nav">
<div class="social">
<a class="github" target="_blank" href="https://github.com/SmallFlames/SmallFlames.github.io" title="github"><i class="icon-github"></i></a>
<a class="weixin" target="_blank" href="https://s.pdb2.com/pages/20231028/DnsqlbLaqT1CgmQg.html" title="weixin"><i class="icon-weixin"></i></a>
<a class="qq" target="_blank" href="https://wpa.qq.com/msgrd?v=3&uin=3213138337&site=qq&menu=yes&jumpflag=1" title="qq"><i class="icon-qq"></i></a>
<a class="mail" target="_blank" href="mailto: [email protected]" title="mail"><i class="icon-mail"></i></a>
</div>
<!-- 网易云音乐插件 -->
</nav>
</header>
</div>
</div>
<div class="mid-col" q-class="show:isShow,hide:isShow|isFalse">
<nav id="mobile-nav">
<div class="overlay js-overlay" style="background: #4d4d4d"></div>
<div class="btnctn js-mobile-btnctn">
<div class="slider-trigger list" q-on="click: openSlider(e)"><i class="icon icon-sort"></i></div>
</div>
<div class="intrude-less">
<header id="header" class="inner">
<div class="profilepic">
<img src="/img/18221454.jpg" class="js-avatar">
</div>
<hgroup>
<h1 class="header-author js-header-author">南 汐</h1>
</hgroup>
<p class="header-subtitle"><i class="icon icon-quo-left"></i>勇敢的去做你认为正确的事情!<i class="icon icon-quo-right"></i></p>
<nav class="header-nav">
<div class="social">
<a class="github" target="_blank" href="https://github.com/SmallFlames/SmallFlames.github.io" title="github"><i class="icon-github"></i></a>
<a class="weixin" target="_blank" href="https://s.pdb2.com/pages/20231028/DnsqlbLaqT1CgmQg.html" title="weixin"><i class="icon-weixin"></i></a>
<a class="qq" target="_blank" href="https://wpa.qq.com/msgrd?v=3&uin=3213138337&site=qq&menu=yes&jumpflag=1" title="qq"><i class="icon-qq"></i></a>
<a class="mail" target="_blank" href="mailto: [email protected]" title="mail"><i class="icon-mail"></i></a>
</div>
</nav>
<nav class="header-menu js-header-menu">
<ul style="width: 50%">
<li style="width: 50%"><a href="/">主页</a></li>
<li style="width: 50%"><a href="/tags/%E6%97%A5%E5%B8%B8/">日常</a></li>
</ul>
</nav>
</header>
</div>
<div class="mobile-mask" style="display:none" q-show="isShow"></div>
</nav>
<div id="wrapper" class="body-wrap">
<div class="menu-l">
<div class="canvas-wrap">
<canvas data-colors="#eaeaea" data-sectionHeight="100" data-contentId="js-content" id="myCanvas1" class="anm-canvas"></canvas>
</div>
<div id="js-content" class="content-ll">
<article id="post-Python编程基础篇001" class="article article-type-post article-index" itemscope itemprop="blogPost">
<div class="article-inner">
<header class="article-header">
<h1 itemprop="name">
<a class="article-title" href="/2024/02/03/Python%E7%BC%96%E7%A8%8B%E5%9F%BA%E7%A1%80%E7%AF%87001/">Python编程基础篇001</a>
</h1>
<a href="/2024/02/03/Python%E7%BC%96%E7%A8%8B%E5%9F%BA%E7%A1%80%E7%AF%87001/" class="archive-article-date">
<time datetime="2024-02-02T16:06:59.000Z" itemprop="datePublished"><i class="icon-calendar icon"></i>2024-02-03</time>
</a>
</header>
<div class="article-entry" itemprop="articleBody">
<h1><center>Python编程基础篇</center></h1>
<blockquote>
<p> ✨ 在pyhton中,经常会用到input()语句,但是input()语句输入的内容只能时字符串类型,而我们经常要输入int类型的数据等,那么就需要用到int()方法给输入的内容强制转换为int类型,但是如果输入的不是数字,而是字母、标点等,这样就会报错,所以我们就要判断一下,输入的内容输入的内容是否为我们的期望类型。</p>
</blockquote>
<h2 id="一、判断input-输入的数据的类型">一、判断input()输入的数据的类型</h2>
<p>str.isdigit()为True表示输入的所有字符都是数字(小数会返回False)<br>
str.isalnum()为True表示输入的所有字符都是数字或者字母<br>
str.isalpha()为True表示输入的所有字符都是字母<br>
str.isdigit()为True表示输入的所有字符都是数字<br>
str.islower()为True表示输入的所有字符都是小写<br>
str.isupper()为True表示输入的所有字符都是大写<br>
str.istitle()为True表示输入的所有单词都是首字母大写,像标题<br>
str.isspace()为True表示输入的所有字符都是空白字符、\t、\n、\r</p>
<h2 id="二、基础编程训练">二、基础编程训练</h2>
<table><tr><td bgcolor=#000000><font color="white">需求分析</font></td></tr></table>
<p><font color="#fc5531">▚ 需求 :用Python实现输入三个整数,并判断其最大值。</font></p>
<table><tr><td bgcolor=#000000><font color="white">实现效果</font></td></tr></table>
<p><img src="https://gitee.com/XZ6606/image-bed/raw/master/img/image-20240426234435273.png" alt="image-20240426234435273"></p>
<a class="article-more-a" href="/2024/02/03/Python%E7%BC%96%E7%A8%8B%E5%9F%BA%E7%A1%80%E7%AF%87001/#more">more >></a>
</div>
<div class="article-info article-info-index">
<div class="article-tag tagcloud">
<i class="icon-price-tags icon"></i>
<ul class="article-tag-list">
<li class="article-tag-list-item">
<a href="javascript:void(0)" class="js-tag article-tag-list-link color5">运维之路</a>
</li>
<li class="article-tag-list-item">
<a href="javascript:void(0)" class="js-tag article-tag-list-link color2">Python</a>
</li>
</ul>
</div>
<p class="article-more-link">
<a class="article-more-a" href="/2024/02/03/Python%E7%BC%96%E7%A8%8B%E5%9F%BA%E7%A1%80%E7%AF%87001/">展开全文 >></a>
</p>
<div class="clearfix"></div>
</div>
</div>
</article>
<aside class="wrap-side-operation">
<div class="mod-side-operation">
<div class="jump-container" id="js-jump-container" style="display:none;">
<a href="javascript:void(0)" class="mod-side-operation__jump-to-top">
<i class="icon-font icon-back"></i>
</a>
<div id="js-jump-plan-container" class="jump-plan-container" style="top: -11px;">
<i class="icon-font icon-plane jump-plane"></i>
</div>
</div>
</div>
</aside>
<article id="post-Ubantu搭建内网仓库" class="article article-type-post article-index" itemscope itemprop="blogPost">
<div class="article-inner">
<header class="article-header">
<h1 itemprop="name">
<a class="article-title" href="/2024/02/01/Ubantu%E6%90%AD%E5%BB%BA%E5%86%85%E7%BD%91%E4%BB%93%E5%BA%93/">Ubantu搭建内网仓库</a>
</h1>
<a href="/2024/02/01/Ubantu%E6%90%AD%E5%BB%BA%E5%86%85%E7%BD%91%E4%BB%93%E5%BA%93/" class="archive-article-date">
<time datetime="2024-02-01T15:30:55.000Z" itemprop="datePublished"><i class="icon-calendar icon"></i>2024-02-01</time>
</a>
</header>
<div class="article-entry" itemprop="articleBody">
<h1><center>Ubantu搭建内网仓库</center></h1>
<blockquote>
<p>✨ Ubuntu基于Debian发行版和GNOME桌面环境,与Debian的不同在于它每6个月会发布一个新版本。Ubuntu的目标在于为一般用户提供一个最新的、同时又相当稳定的主要由自由软件构建而成的操作系统。<br>
🎉 Shell 是一个程序,提供一个与用户对话的环境。这个环境只有一个命令提示符,让用户从键盘输入命令,所以又称为命令行环境(command line interface,简写为 CLI)。</p>
</blockquote>
<h2 id="font-color-red-▚-u-Step-01-u-:搭建本地源仓库-font"><font color=red>▚ <u>Step 01</u> :搭建本地源仓库</font></h2>
<figure class="highlight bash"><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><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br></pre></td><td class="code"><pre><span class="line">apt clean </span><br><span class="line">apt -y install -d nginx 举例</span><br><span class="line"><span class="comment"># /var/cache/apt/archives # deb包的位置</span></span><br><span class="line"></span><br><span class="line"><span class="built_in">mkdir</span> /root/ceshi</span><br><span class="line"><span class="built_in">mv</span> /var/cache/apt/archives/*.deb /root/ceshi</span><br><span class="line"></span><br><span class="line">apt -y install dpkg-dev (生成源所需工具)</span><br><span class="line"><span class="built_in">cd</span> /root/ceshi</span><br><span class="line">apt-ftparchive packages . > Packages <span class="comment"># 安装包信息都读取到 Packages</span></span><br><span class="line">apt-ftparchive release . > Release</span><br><span class="line"><span class="comment"># dpkg-scanpackages ./packages | gzip -9c > Packages.gz</span></span><br><span class="line"><span class="comment"># gpg --clearsign -o InRelease Release # 生成 Release 的明文签名文件</span></span><br><span class="line"><span class="comment"># gpg -ab -o Release.gpg Release # 生成 Release 的文本分离签名文件</span></span><br></pre></td></tr></table></figure>
<p><img src="https://gitee.com/XZ6606/image-bed/raw/master/img/image-20240221115118994.png" alt="image-20240221115118994"></p>
<a class="article-more-a" href="/2024/02/01/Ubantu%E6%90%AD%E5%BB%BA%E5%86%85%E7%BD%91%E4%BB%93%E5%BA%93/#more">more >></a>
</div>
<div class="article-info article-info-index">
<div class="article-tag tagcloud">
<i class="icon-price-tags icon"></i>
<ul class="article-tag-list">
<li class="article-tag-list-item">
<a href="javascript:void(0)" class="js-tag article-tag-list-link color5">运维之路</a>
</li>
<li class="article-tag-list-item">
<a href="javascript:void(0)" class="js-tag article-tag-list-link color2">Docker</a>
</li>
</ul>
</div>
<p class="article-more-link">
<a class="article-more-a" href="/2024/02/01/Ubantu%E6%90%AD%E5%BB%BA%E5%86%85%E7%BD%91%E4%BB%93%E5%BA%93/">展开全文 >></a>
</p>
<div class="clearfix"></div>
</div>
</div>
</article>
<aside class="wrap-side-operation">
<div class="mod-side-operation">
<div class="jump-container" id="js-jump-container" style="display:none;">
<a href="javascript:void(0)" class="mod-side-operation__jump-to-top">
<i class="icon-font icon-back"></i>
</a>
<div id="js-jump-plan-container" class="jump-plan-container" style="top: -11px;">
<i class="icon-font icon-plane jump-plane"></i>
</div>
</div>
</div>
</aside>
<article id="post-Dockerfile制作镜像" class="article article-type-post article-index" itemscope itemprop="blogPost">
<div class="article-inner">
<header class="article-header">
<h1 itemprop="name">
<a class="article-title" href="/2024/02/01/Dockerfile%E5%88%B6%E4%BD%9C%E9%95%9C%E5%83%8F/">Dockerfile制作镜像</a>
</h1>
<a href="/2024/02/01/Dockerfile%E5%88%B6%E4%BD%9C%E9%95%9C%E5%83%8F/" class="archive-article-date">
<time datetime="2024-02-01T13:42:21.000Z" itemprop="datePublished"><i class="icon-calendar icon"></i>2024-02-01</time>
</a>
</header>
<div class="article-entry" itemprop="articleBody">
<h1><center>Dockerfile制作镜像</center></h1>
<p><img src="https://gitee.com/XZ6606/image-bed/raw/master/img/docker-architecture.webp" alt="Docker Architecture diagram"></p>
<h2 id="一、Dockerfile常用指令">一、Dockerfile常用指令</h2>
<table>
<thead>
<tr>
<th>指令</th>
<th>释义</th>
</tr>
</thead>
<tbody>
<tr>
<td>FROM</td>
<td>指定基础镜像,必须放在首行。(注意,scratch是保留字,并不是镜像!如果使用了该关键字表示不依赖于任何镜像) && 调用基础镜像触发器(ONBUILD)。</td>
</tr>
<tr>
<td>ONBUILD</td>
<td>基础镜像触发器。当镜像用作另一个构建的基础时触发。后面可以跟其他的镜像指令运行,所以当我们基于他人镜像构建新镜像时为安全考虑应当特别注意基础镜像是否有不安全的ONBUILD指令。</td>
</tr>
<tr>
<td>MAINTAINER</td>
<td>管理者(维护者)标识,用于声明作者的信息。(<mark>已弃用</mark>)</td>
</tr>
<tr>
<td>LABEL</td>
<td>为镜像打标签。基于KEY=VALUE方式打标签。</td>
</tr>
<tr>
<td>USER</td>
<td>指定容器的运行用户,若不指定,默认为root用户,一些服务可能会用到,比如ES服务…</td>
</tr>
<tr>
<td>RUN</td>
<td>在容器中运行指令。</td>
</tr>
<tr>
<td>WORKDIR</td>
<td>指定容器的工作目录,当用户连接到容器时,就默认在该目录,若不指定,则默认在"/"路径。</td>
</tr>
<tr>
<td>VOLUME</td>
<td>对容器的指定路径生成随机存储卷。</td>
</tr>
<tr>
<td>COPY</td>
<td>将宿主机的文件拷贝到容器中。如果容器目录不存在,则会自动创建。</td>
</tr>
<tr>
<td>ADD</td>
<td>与COPY作用不同的是,它可以自动解压tar包文件并删除源文件。</td>
</tr>
<tr>
<td>ENV</td>
<td>将变量传递给容器,容器运行时会有该变量。在容器启动或创建时可以使用-e,–env选项替换默认值。</td>
</tr>
<tr>
<td>ARG</td>
<td>在编译阶段生效的变量。容器运行时不会存在该变量!在编译的时候可以使用"–build-arg"选项替换默认值。</td>
</tr>
<tr>
<td>EXPOSE</td>
<td>暴露容器内端口,外部使用随机端口映射时,可以暴露此处定义的服务端口,通常建议暴露的端口和服务有关。用户启动容器时使用"-P"时会为容器暴露的端口自动做映射</td>
</tr>
<tr>
<td>CMD</td>
<td>容器启动时执行的指令,我们在制作容器时,通常会在此处阻塞终端。</td>
</tr>
<tr>
<td>ENTRYPOINT</td>
<td>同CMD,容器启动时执行的指令,但是此处可传入参数,启动指令可能因参数产生变化。</td>
</tr>
<tr>
<td>HEALTHCHECK</td>
<td>容器健康检查。</td>
</tr>
<tr>
<td>SHELL</td>
<td>调用系统命令的shell。这对Windows很有用,Linux无需使用,默认就是linux的shell。</td>
</tr>
</tbody>
</table>
<div class="warning">
<p> <strong>相似指令区分</strong><br>
1️⃣ <strong>COPY和ADD:</strong> COPY用于将宿主机文件拷贝至容器,或者在多阶段构建时用于将上一构建阶段的文件拷贝至本阶段构建。ADD指令同样可用于拷贝文件,但是该指令可以自动解压tar包,并删除源文件。</p>
<p> 2️⃣ <strong>ARG和ENV:</strong> ARG指令和ENV指令的作用域不同,ARG指令指定的便令仅在镜像构建时起作用,镜像构建完成生命周期即结束。ENV指令将环境变量 <code><key></code> 设置为值 <code><value></code>将在构建阶段的所有后续指令的环境中,并且也可以在许多指令中内联替换。</p>
<p> 3️⃣ <strong>CMD和ENTRYPOINT:</strong> CMD指令设置从镜像运行容器时固定要执行的命令。Dockerfile中只能有一条 <code>CMD</code> 指令。如果您列出多个 <code>CMD</code> ,则只有最后一个生效。如果用户为 <code>docker run</code> 指定参数,那么他们将覆盖 <code>CMD</code> 中指定的默认值。ENTRYPOINT指令设置从镜像运行容器时要执行的命令,但用户可以为该指令传递参数,若CMD指令和ENTRYPOINT指令同时使用则CMD指令将作为ENTRYPOINT指令的参数传递。</p>
</div>
<h2 id="二、Dockerfile制作镜像">二、Dockerfile制作镜像</h2>
<p>1️⃣ 创建Dockerfile文件。 根据个人习惯而言,一般为了文件的可读性,我们需要先创建一个空目录,并在目录下创建Dockerfile文件,(约定俗成我们一般就以Dockerfile为名,编译时也会自动寻找这个文件,也可自定义文件名,但是我们在编译文件时需用 <code>-f</code> 指定需编译文件的绝对路径,自定义文件名语义混乱容易导致文件错落,不建议!)</p>
<a class="article-more-a" href="/2024/02/01/Dockerfile%E5%88%B6%E4%BD%9C%E9%95%9C%E5%83%8F/#more">more >></a>
</div>
<div class="article-info article-info-index">
<div class="article-tag tagcloud">
<i class="icon-price-tags icon"></i>
<ul class="article-tag-list">
<li class="article-tag-list-item">
<a href="javascript:void(0)" class="js-tag article-tag-list-link color5">运维之路</a>
</li>
<li class="article-tag-list-item">
<a href="javascript:void(0)" class="js-tag article-tag-list-link color2">Docker</a>
</li>
</ul>
</div>
<p class="article-more-link">
<a class="article-more-a" href="/2024/02/01/Dockerfile%E5%88%B6%E4%BD%9C%E9%95%9C%E5%83%8F/">展开全文 >></a>
</p>
<div class="clearfix"></div>
</div>
</div>
</article>
<aside class="wrap-side-operation">
<div class="mod-side-operation">
<div class="jump-container" id="js-jump-container" style="display:none;">
<a href="javascript:void(0)" class="mod-side-operation__jump-to-top">
<i class="icon-font icon-back"></i>
</a>
<div id="js-jump-plan-container" class="jump-plan-container" style="top: -11px;">
<i class="icon-font icon-plane jump-plane"></i>
</div>
</div>
</div>
</aside>
<article id="post-Git及gitlab使用简述" class="article article-type-post article-index" itemscope itemprop="blogPost">
<div class="article-inner">
<header class="article-header">
<h1 itemprop="name">
<a class="article-title" href="/2024/01/29/Git%E5%8F%8Agitlab%E4%BD%BF%E7%94%A8%E7%AE%80%E8%BF%B0/">Git及gitlab使用简述</a>
</h1>
<a href="/2024/01/29/Git%E5%8F%8Agitlab%E4%BD%BF%E7%94%A8%E7%AE%80%E8%BF%B0/" class="archive-article-date">
<time datetime="2024-01-29T10:47:09.000Z" itemprop="datePublished"><i class="icon-calendar icon"></i>2024-01-29</time>
</a>
</header>
<div class="article-entry" itemprop="articleBody">
<h1><center>Git及gitlab使用简述</center></h1>
<blockquote>
<p>🎄 官网介绍:Git是一个自由和开源的分布式版本控制系统,旨在快速和高效地处理从小型到大型的所有项目。Git简单易学,占用空间小,性能快如闪电。它比Subversion、CVS、Perforce和ClearCase等SCM工具更有优势,具有廉价的本地分支、方便的登台区和多个工作流等特性。</p>
</blockquote>
<h2 id="font-color-red-▚-u-01-u-简述:Git的使用要点-font"><font color=red>▚ <u>01</u> 简述:Git的使用要点</font></h2>
<p><img src="https://gitee.com/XZ6606/image-bed/raw/master/img/image-20240129192325464.png" alt="image-20240129192325464"></p>
<div class="tips">
<p>一般linux系统会自带由git工具,如果没有需自行下载安装,<code>yum -y install git</code></p>
</div>
<a class="article-more-a" href="/2024/01/29/Git%E5%8F%8Agitlab%E4%BD%BF%E7%94%A8%E7%AE%80%E8%BF%B0/#more">more >></a>
</div>
<div class="article-info article-info-index">
<div class="article-tag tagcloud">
<i class="icon-price-tags icon"></i>
<ul class="article-tag-list">
<li class="article-tag-list-item">
<a href="javascript:void(0)" class="js-tag article-tag-list-link color5">运维之路</a>
</li>
<li class="article-tag-list-item">
<a href="javascript:void(0)" class="js-tag article-tag-list-link color5">软件应用</a>
</li>
</ul>
</div>
<p class="article-more-link">
<a class="article-more-a" href="/2024/01/29/Git%E5%8F%8Agitlab%E4%BD%BF%E7%94%A8%E7%AE%80%E8%BF%B0/">展开全文 >></a>
</p>
<div class="clearfix"></div>
</div>
</div>
</article>
<aside class="wrap-side-operation">
<div class="mod-side-operation">
<div class="jump-container" id="js-jump-container" style="display:none;">
<a href="javascript:void(0)" class="mod-side-operation__jump-to-top">
<i class="icon-font icon-back"></i>
</a>
<div id="js-jump-plan-container" class="jump-plan-container" style="top: -11px;">
<i class="icon-font icon-plane jump-plane"></i>
</div>
</div>
</div>
</aside>
<article id="post-Shell脚本篇006" class="article article-type-post article-index" itemscope itemprop="blogPost">
<div class="article-inner">
<header class="article-header">
<h1 itemprop="name">
<a class="article-title" href="/2024/01/28/Shell%E8%84%9A%E6%9C%AC%E7%AF%87006/">Shell脚本篇006</a>
</h1>
<a href="/2024/01/28/Shell%E8%84%9A%E6%9C%AC%E7%AF%87006/" class="archive-article-date">
<time datetime="2024-01-28T10:45:09.000Z" itemprop="datePublished"><i class="icon-calendar icon"></i>2024-01-28</time>
</a>
</header>
<div class="article-entry" itemprop="articleBody">
<h1><center>Shell脚本篇006</center></h1>
<table><tr><td bgcolor=#000000><font color="white">脚本需求</font></td></tr></table>
<font color="#fc5531">▚ 需求 :写一个脚本实现批量免密钥分发。</font>
<table><tr><td bgcolor=#000000><font color="white">实现效果</font></td></tr></table>
<p><img src="https://gitee.com/XZ6606/image-bed/raw/master/img/image-20240128184852368.png" alt="image-20240128184852368"></p>
<a class="article-more-a" href="/2024/01/28/Shell%E8%84%9A%E6%9C%AC%E7%AF%87006/#more">more >></a>
</div>
<div class="article-info article-info-index">
<div class="article-tag tagcloud">
<i class="icon-price-tags icon"></i>
<ul class="article-tag-list">
<li class="article-tag-list-item">
<a href="javascript:void(0)" class="js-tag article-tag-list-link color5">运维之路</a>
</li>
<li class="article-tag-list-item">
<a href="javascript:void(0)" class="js-tag article-tag-list-link color3">Shell编程</a>
</li>
</ul>
</div>
<p class="article-more-link">
<a class="article-more-a" href="/2024/01/28/Shell%E8%84%9A%E6%9C%AC%E7%AF%87006/">展开全文 >></a>
</p>
<div class="clearfix"></div>
</div>
</div>
</article>
<aside class="wrap-side-operation">
<div class="mod-side-operation">
<div class="jump-container" id="js-jump-container" style="display:none;">
<a href="javascript:void(0)" class="mod-side-operation__jump-to-top">
<i class="icon-font icon-back"></i>
</a>
<div id="js-jump-plan-container" class="jump-plan-container" style="top: -11px;">
<i class="icon-font icon-plane jump-plane"></i>
</div>
</div>
</div>
</aside>
<article id="post-Shell脚本篇005" class="article article-type-post article-index" itemscope itemprop="blogPost">
<div class="article-inner">
<header class="article-header">
<h1 itemprop="name">
<a class="article-title" href="/2024/01/28/Shell%E8%84%9A%E6%9C%AC%E7%AF%87005/">Shell脚本篇005</a>
</h1>
<a href="/2024/01/28/Shell%E8%84%9A%E6%9C%AC%E7%AF%87005/" class="archive-article-date">
<time datetime="2024-01-28T06:48:18.000Z" itemprop="datePublished"><i class="icon-calendar icon"></i>2024-01-28</time>
</a>
</header>
<div class="article-entry" itemprop="articleBody">
<h1><center>Shell脚本篇005</center></h1>
<table><tr><td bgcolor=#000000><font color="white">脚本需求</font></td></tr></table>
<font color="#fc5531">▚ 需求 :写一个脚本检测CPU使用情况,当使用CPU使用率大于90%即报警。</font>
<table><tr><td bgcolor=#000000><font color="white">实现效果</font></td></tr></table>
<p><img src="https://gitee.com/XZ6606/image-bed/raw/master/img/image-20240128161507444.png" alt="image-20240128161507444"></p>
<a class="article-more-a" href="/2024/01/28/Shell%E8%84%9A%E6%9C%AC%E7%AF%87005/#more">more >></a>
</div>
<div class="article-info article-info-index">
<div class="article-tag tagcloud">
<i class="icon-price-tags icon"></i>
<ul class="article-tag-list">
<li class="article-tag-list-item">
<a href="javascript:void(0)" class="js-tag article-tag-list-link color5">运维之路</a>
</li>
<li class="article-tag-list-item">
<a href="javascript:void(0)" class="js-tag article-tag-list-link color3">Shell编程</a>
</li>
</ul>
</div>
<p class="article-more-link">
<a class="article-more-a" href="/2024/01/28/Shell%E8%84%9A%E6%9C%AC%E7%AF%87005/">展开全文 >></a>
</p>
<div class="clearfix"></div>
</div>
</div>
</article>
<aside class="wrap-side-operation">
<div class="mod-side-operation">
<div class="jump-container" id="js-jump-container" style="display:none;">
<a href="javascript:void(0)" class="mod-side-operation__jump-to-top">
<i class="icon-font icon-back"></i>
</a>
<div id="js-jump-plan-container" class="jump-plan-container" style="top: -11px;">
<i class="icon-font icon-plane jump-plane"></i>
</div>
</div>
</div>
</aside>
<article id="post-Shell脚本篇004" class="article article-type-post article-index" itemscope itemprop="blogPost">
<div class="article-inner">
<header class="article-header">
<h1 itemprop="name">
<a class="article-title" href="/2024/01/27/Shell%E8%84%9A%E6%9C%AC%E7%AF%87004/">Shell脚本篇004</a>
</h1>
<a href="/2024/01/27/Shell%E8%84%9A%E6%9C%AC%E7%AF%87004/" class="archive-article-date">
<time datetime="2024-01-27T11:07:53.000Z" itemprop="datePublished"><i class="icon-calendar icon"></i>2024-01-27</time>
</a>
</header>
<div class="article-entry" itemprop="articleBody">
<h1><center>Shell脚本篇004</center></h1>
<table><tr><td bgcolor=#000000><font color="white">脚本需求</font></td></tr></table>
<font color="#fc5531">▚ 需求 :写一个脚本反向破解由随机数生成的MD5值。</font>
<table><tr><td bgcolor=#000000><font color="white">实现效果</font></td></tr></table>
<p><img src="https://gitee.com/XZ6606/image-bed/raw/master/img/image-20240127191533426.png" alt="image-20240127191533426"></p>
<a class="article-more-a" href="/2024/01/27/Shell%E8%84%9A%E6%9C%AC%E7%AF%87004/#more">more >></a>
</div>
<div class="article-info article-info-index">
<div class="article-tag tagcloud">
<i class="icon-price-tags icon"></i>
<ul class="article-tag-list">
<li class="article-tag-list-item">
<a href="javascript:void(0)" class="js-tag article-tag-list-link color5">运维之路</a>
</li>
<li class="article-tag-list-item">
<a href="javascript:void(0)" class="js-tag article-tag-list-link color3">Shell编程</a>
</li>
</ul>
</div>
<p class="article-more-link">
<a class="article-more-a" href="/2024/01/27/Shell%E8%84%9A%E6%9C%AC%E7%AF%87004/">展开全文 >></a>
</p>
<div class="clearfix"></div>
</div>
</div>
</article>
<aside class="wrap-side-operation">
<div class="mod-side-operation">
<div class="jump-container" id="js-jump-container" style="display:none;">
<a href="javascript:void(0)" class="mod-side-operation__jump-to-top">
<i class="icon-font icon-back"></i>
</a>
<div id="js-jump-plan-container" class="jump-plan-container" style="top: -11px;">
<i class="icon-font icon-plane jump-plane"></i>
</div>
</div>
</div>
</aside>
<article id="post-Shell编程知识补充(四)" class="article article-type-post article-index" itemscope itemprop="blogPost">
<div class="article-inner">
<header class="article-header">
<h1 itemprop="name">
<a class="article-title" href="/2024/01/26/Shell%E7%BC%96%E7%A8%8B%E7%9F%A5%E8%AF%86%E8%A1%A5%E5%85%85%EF%BC%88%E5%9B%9B%EF%BC%89/">Shell编程知识补充(四)</a>
</h1>
<a href="/2024/01/26/Shell%E7%BC%96%E7%A8%8B%E7%9F%A5%E8%AF%86%E8%A1%A5%E5%85%85%EF%BC%88%E5%9B%9B%EF%BC%89/" class="archive-article-date">
<time datetime="2024-01-26T07:33:08.000Z" itemprop="datePublished"><i class="icon-calendar icon"></i>2024-01-26</time>
</a>
</header>
<div class="article-entry" itemprop="articleBody">
<h1><center>Shell编程基础知识补充</center></h1>
<h2 id="font-color-red-▚-u-01-u-补充:普通数组和关联数组-font"><font color=red>▚ <u>01</u> 补充:普通数组和关联数组</font></h2>
<figure class="highlight bash"><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><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># 普通数组示例</span></span><br><span class="line">[root@ceshi ~]<span class="comment">#a=(a b c d)</span></span><br><span class="line">[root@ceshi ~]<span class="comment">#echo ${a[*]}</span></span><br><span class="line">a b c d</span><br><span class="line">[root@ceshi ~]<span class="comment">#echo ${a[@]}</span></span><br><span class="line">a b c d</span><br><span class="line">[root@ceshi ~]<span class="comment">#echo ${!a[@]}</span></span><br><span class="line">0 1 2 3</span><br><span class="line">[root@ceshi ~]<span class="comment">#echo ${!a[*]}</span></span><br><span class="line">0 1 2 3</span><br></pre></td></tr></table></figure>
<figure class="highlight bash"><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><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># 关联数组示例</span></span><br><span class="line">[root@ceshi ~]<span class="comment">#unset a</span></span><br><span class="line">[root@ceshi ~]<span class="comment">#declare -A a</span></span><br><span class="line">[root@ceshi ~]<span class="comment">#a[a]=1</span></span><br><span class="line">[root@ceshi ~]<span class="comment">#a[b]=2</span></span><br><span class="line">[root@ceshi ~]<span class="comment">#a[c]=3</span></span><br><span class="line">[root@ceshi ~]<span class="comment">#echo ${a[*]}</span></span><br><span class="line">1 2 3</span><br><span class="line">[root@ceshi ~]<span class="comment">#echo ${a[@]}</span></span><br><span class="line">1 2 3</span><br><span class="line">[root@ceshi ~]<span class="comment">#echo ${!a[@]}</span></span><br><span class="line">a b c</span><br><span class="line">[root@ceshi ~]<span class="comment">#echo ${!a[*]}</span></span><br><span class="line">a b c</span><br><span class="line">-----------------------------------</span><br><span class="line">[root@ceshi ~]<span class="comment">#unset a</span></span><br><span class="line">[root@ceshi ~]<span class="comment">#declare -A a</span></span><br><span class="line">[root@ceshi ~]<span class="comment">#a=([nanxi]="i" [love]="love" [you]="you")</span></span><br><span class="line">[root@ceshi ~]<span class="comment">#echo ${a[*]}</span></span><br><span class="line">you love i</span><br><span class="line">[root@ceshi ~]<span class="comment">#echo ${!a[*]}</span></span><br><span class="line">you love nanxi</span><br></pre></td></tr></table></figure>
<div class="warning">
<p>shell中的普通数组和C的一维数组一样,但是关联数组有所不同,关联数组可以用任意的文本作为数组索引,而普通数组中的索引都是整数,且关联数组使用之前需要声明:<code>declare -A ass_array</code></p>
</div>
<a class="article-more-a" href="/2024/01/26/Shell%E7%BC%96%E7%A8%8B%E7%9F%A5%E8%AF%86%E8%A1%A5%E5%85%85%EF%BC%88%E5%9B%9B%EF%BC%89/#more">more >></a>
</div>
<div class="article-info article-info-index">
<div class="article-tag tagcloud">
<i class="icon-price-tags icon"></i>
<ul class="article-tag-list">
<li class="article-tag-list-item">
<a href="javascript:void(0)" class="js-tag article-tag-list-link color5">运维之路</a>
</li>
<li class="article-tag-list-item">
<a href="javascript:void(0)" class="js-tag article-tag-list-link color3">Shell编程</a>
</li>
</ul>
</div>
<p class="article-more-link">
<a class="article-more-a" href="/2024/01/26/Shell%E7%BC%96%E7%A8%8B%E7%9F%A5%E8%AF%86%E8%A1%A5%E5%85%85%EF%BC%88%E5%9B%9B%EF%BC%89/">展开全文 >></a>
</p>
<div class="clearfix"></div>
</div>
</div>
</article>
<aside class="wrap-side-operation">
<div class="mod-side-operation">