-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
943 lines (737 loc) · 42.1 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
<!DOCTYPE html>
<html lang="zh-CN" class="loading">
<head><meta name="generator" content="Hexo 3.9.0">
<!-- hexo-inject:begin --><!-- hexo-inject:end --><meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>Gvoidy - take your time</title>
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<meta name="google" content="notranslate">
<meta name="keywords" content="EwdAger gvoidy 机器学习,">
<meta name="author" content="EwdAger">
<link rel="alternative" href="atom.xml" title="Gvoidy" type="application/atom+xml">
<link rel="icon" href="/img/favicon.png">
<link href="https://fonts.loli.net/css?family=Roboto+Mono|Rubik&display=swap" rel="stylesheet">
<link rel="stylesheet" href="//at.alicdn.com/t/font_1429596_nzgqgvnmkjb.css">
<link rel="stylesheet" href="//cdn.bootcss.com/animate.css/3.7.2/animate.min.css">
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/social-share.js/1.0.16/css/share.min.css">
<link rel="stylesheet" href="//cdn.bootcss.com/codemirror/5.48.4/codemirror.min.css">
<link rel="stylesheet" href="//cdn.bootcss.com/codemirror/5.48.4/theme/dracula.css">
<link rel="stylesheet" href="/css/obsidian.css">
<link rel="stylesheet" href="/css/ball-atom.min.css"><!-- hexo-inject:begin --><!-- hexo-inject:end -->
</head>
</html>
<body class="loading">
<!-- hexo-inject:begin --><!-- hexo-inject:end --><div class="loader">
<div class="la-ball-atom la-2x">
<div></div>
<div></div>
<div></div>
<div></div>
</div>
</div>
<span id="config-title" style="display:none">Gvoidy</span>
<div id="loader"></div>
<div class="nav">
<ul id="menu-menu" class="menu">
<li class="animated fadeInDown menu-item menu-item-type-post_type menu-item-object-page">
<a href="/whoami/" title="关于">关于</a>
</li>
<li class="animated fadeInDown menu-item menu-item-type-post_type menu-item-object-page">
<a href="/categories/" title="目录">目录</a>
</li>
<li class="animated fadeInDown menu-item menu-item-type-post_type menu-item-object-page">
<a href="/tags/" title="标签">标签</a>
</li>
<li class="animated fadeInDown menu-item menu-item-type-post_type menu-item-object-page">
<a href="/archives/" title="文章">文章</a>
</li>
</ul>
<p class="copyright" id="copyright">
© 2021 EwdAger.
Powered by <a href="http://hexo.io/" title="Hexo" target="_blank" rel="noopener">Hexo</a>
Theme <a href="https://github.com/TriDiamond/hexo-theme-obsidian" title="Obsidian" target="_blank" rel="noopener">Obsidian</a>
</p>
</div>
<div id="container">
<div class="search-box">
<form class="site-search-form">
<span class="iconfont icon-search"></span>
<input type="text" id="local-search-input" class="st-search-input" />
<div class="iconfont icon-cross search-box-close"></div>
</form>
<div class="search-scrollable">
<div id="local-search-result" class="local-search-result-cls" data-initialise="首次搜索,正在载入索引文件,请稍后……"
data-start="输入关键词搜索。" data-empty="没有找到内容,请尝试更换检索词。">
<span>输入关键词搜索。</span>
</div>
</div>
</div>
<div id="header">
<div>
<div class="logo animated fadeInDown">
<img src="/img/favicon.png" alt="">
<a class="image-logo" href="/"></a>
</div>
<ul id="menu-menu" class="menu text-menu">
<li class="animated fadeInDown menu-item menu-item-type-post_type menu-item-object-page">
<a href="/whoami/" title="关于" class="menu-link">关于</a>
</li>
<li class="animated fadeInDown menu-item menu-item-type-post_type menu-item-object-page">
<a href="/categories/" title="目录" class="menu-link">目录</a>
</li>
<li class="animated fadeInDown menu-item menu-item-type-post_type menu-item-object-page">
<a href="/tags/" title="标签" class="menu-link">标签</a>
</li>
<li class="animated fadeInDown menu-item menu-item-type-post_type menu-item-object-page">
<a href="/archives/" title="文章" class="menu-link">文章</a>
</li>
<li class="animated fadeInDown search-bar iconfont icon-search"></li>
</ul>
<div class="iconfont icon-menu switchmenu gradient-text animated fadeInDown"></div>
</div>
</div>
<div id="screen">
<div id="mark">
<div class="cover animated fadeIn" style="
animation-delay: 900ms;
animation-duration: 2.8s;
background-image:
radial-gradient(ellipse closest-side, rgba(0, 0, 0, 0.56), #100e17),
url(/img/cover.jpg);">
</div>
</div>
<div id="post0" class="else">
<p class="animated fadeInDown">
<a href="/categories/服务器相关问题&备忘"><b>「
</b>服务器相关问题&备忘<b> 」</b></a>
三月 22, 2021
</p>
<h3 class="post-title animated fadeInDown">
<a href="/posts/9237cc38/" title="RedHat 更换 CentOS 源出现的坑" class="posttitle">RedHat 更换 CentOS 源出现的坑</a></h3>
<p class="post-count animated fadeInDown">
<span>
<b class="iconfont icon-text2"></b> <i>文章字数</i>
3.3k
</span>
<span>
<b class="iconfont icon-timer__s"></b> <i>阅读约需</i>
3 mins.
</span>
<span id="/posts/9237cc38/" class="leancloud_visitors" data-flag-title="">
<b class="iconfont icon-read"></b> <i>阅读次数</i>
<span class="leancloud-visitors-count">1000000</span>
</span>
</p>
<ul class="animated fadeInDown post-tags-list"><li class="animated fadeInDown post-tags-list-item"><a class="animated fadeInDown post-tags-list-link" href="/tags/Linux/">Linux</a></li></ul>
<div class="md-content animated fadeIn">
<p>今天在客户服务器上部署的时候需要用到某第三方源,但网上提供的只有 CentOS 源,没有用户 RedHat 系统的相关源。在网上查了很多方法,都说卸载 yum 再重装就可以解决,但是并没有解决。 发现...</p>
<span class="read-more"><a href="/posts/9237cc38/" title="查看全文" class="posttitle">查看全文</a>
<b class="iconfont icon-arrow-right- gradient-text"></b></span>
</div>
</div>
</div>
<div class="screen-gradient-after">
<div class="screen-gradient-content">
<div class="screen-gradient-content-inside">
<div class="bold-underline-links screen-gradient-sponsor">
<p>
<span class="typed-text"></span>
</p>
</div>
</div>
</div>
</div>
<div id="primary">
<div class="post" id="post">
<div class="post-cover animated fadeIn" style="
background-image:
radial-gradient(ellipse closest-side, rgba(0, 0, 0, 0.65), #100e17),
url(/img/welcome-cover.jpg);">
</div>
<div class="else">
<p class="animated fadeInDown">
<a href="/categories/不知道怎么归类">
<b>「 </b>不知道怎么归类<b> 」</b>
</a>
二月 03, 2021
</p>
<h3 class="post-title animated fadeInDown"><a href="/posts/55916608/" title="F**K ZZZQ - 记录那些因政治正确而改名的技术" class="posttitle">F**K ZZZQ - 记录那些因政治正确而改名的技术</a></h3>
<p class="post-count animated fadeInDown">
<span>
<b class="iconfont icon-text2"></b> <i>文章字数</i>
1.1k
</span>
<span>
<b class="iconfont icon-timer__s"></b> <i>阅读约需</i>
1 mins.
</span>
<span id="/posts/55916608/" class="leancloud_visitors" data-flag-title="">
<b class="iconfont icon-read"></b> <i>阅读次数</i>
<span class="leancloud-visitors-count">1000000</span>
</span>
</p>
<ul class="animated fadeInDown post-tags-list"><li class="animated fadeInDown post-tags-list-item"><a class="animated fadeInDown post-tags-list-link" href="/tags/Git/">Git</a></li></ul>
<div class="md-content animated fadeIn">
<p>请允许我首先给出一个和善而不失礼貌的微笑 :) 以纪念因为这些莫名其妙的事而浪费的时间。</p>
<blockquote>
<p>在今年早些时候乔治-弗洛伊德(George Floyd)的惨死和BLM抗议活动之后,科技公司希望通过放弃master、slave、blacklist和whitelist等非包容性术语来表达对黑人社区的支持。</p>
</blockquote>
<p>主分支从 master 改为 main</p>
<blockquote>
<p>适用范围: 目前新建的项目已修改,老项目不做变更</p>
</blockquote>
<p><strong>目前的变化</strong></p>
<ul>
<li>将 master-slave 架构的描述改为 master-replica</li>
<li>为 SLAVEOF...</li></ul>
<span class="read-more"><a href="/posts/55916608/" title="查看全文" class="posttitle">查看全文</a> <b class="iconfont icon-arrow-right- gradient-text"></b></span>
</div>
</div>
</div>
<div class="post" id="post">
<div class="post-cover animated fadeIn" style="
background-image:
radial-gradient(ellipse closest-side, rgba(0, 0, 0, 0.65), #100e17),
url(/img/welcome-cover.jpg);">
</div>
<div class="else">
<p class="animated fadeInDown">
<a href="/categories/不知道怎么归类">
<b>「 </b>不知道怎么归类<b> 」</b>
</a>
十二月 30, 2020
</p>
<h3 class="post-title animated fadeInDown"><a href="/posts/ba43525b/" title="记录一次celery消费失败的问题排除" class="posttitle">记录一次celery消费失败的问题排除</a></h3>
<p class="post-count animated fadeInDown">
<span>
<b class="iconfont icon-text2"></b> <i>文章字数</i>
1.2k
</span>
<span>
<b class="iconfont icon-timer__s"></b> <i>阅读约需</i>
1 mins.
</span>
<span id="/posts/ba43525b/" class="leancloud_visitors" data-flag-title="">
<b class="iconfont icon-read"></b> <i>阅读次数</i>
<span class="leancloud-visitors-count">1000000</span>
</span>
</p>
<ul class="animated fadeInDown post-tags-list"><li class="animated fadeInDown post-tags-list-item"><a class="animated fadeInDown post-tags-list-link" href="/tags/Linux/">Linux</a></li><li class="animated fadeInDown post-tags-list-item"><a class="animated fadeInDown post-tags-list-link" href="/tags/celery/">celery</a></li><li class="animated fadeInDown post-tags-list-item"><a class="animated fadeInDown post-tags-list-link" href="/tags/k8s/">k8s</a></li><li class="animated fadeInDown post-tags-list-item"><a class="animated fadeInDown post-tags-list-link" href="/tags/rabbitmq/">rabbitmq</a></li></ul>
<div class="md-content animated fadeIn">
<p>昨天发完UAT后,今天惯例点进UAT看看服务的情况,突然发现<code>flower</code>监测的<code>celery</code>竟然有半数以上的失败!</p>
<p></p>
<p>马上查看这个<code>queue</code>的日志,确实是有一堆失败的。</p>
<p></p>
<p>当前这个<code>queue</code>的业务是从<code>redis</code>里把数据取出来写入<code>minio</code>里落盘,但是涉及的数据均为几十k的数据,讲道理不应该会失败。</p>
<p>查询得到这几个失败的任务<code>redis</code> key的插入时间为<code>2020-12-28 15:17:48</code>,而消费的时间却是<code>2020-12-29 17:17:21</code></p>
<p></p>
<p>这里就出现了一个问题,业务逻辑上当一个key塞入<code>redis...</code></p>
<span class="read-more"><a href="/posts/ba43525b/" title="查看全文" class="posttitle">查看全文</a> <b class="iconfont icon-arrow-right- gradient-text"></b></span>
</div>
</div>
</div>
<div class="post" id="post">
<div class="post-cover animated fadeIn" style="
background-image:
radial-gradient(ellipse closest-side, rgba(0, 0, 0, 0.65), #100e17),
url(/img/welcome-cover.jpg);">
</div>
<div class="else">
<p class="animated fadeInDown">
<a href="/categories/工作之余">
<b>「 </b>工作之余<b> 」</b>
</a>
十月 11, 2020
</p>
<h3 class="post-title animated fadeInDown"><a href="/posts/38ad339f/" title="群晖中使用破解版 emby" class="posttitle">群晖中使用破解版 emby</a></h3>
<p class="post-count animated fadeInDown">
<span>
<b class="iconfont icon-text2"></b> <i>文章字数</i>
1.6k
</span>
<span>
<b class="iconfont icon-timer__s"></b> <i>阅读约需</i>
1 mins.
</span>
<span id="/posts/38ad339f/" class="leancloud_visitors" data-flag-title="">
<b class="iconfont icon-read"></b> <i>阅读次数</i>
<span class="leancloud-visitors-count">1000000</span>
</span>
</p>
<ul class="animated fadeInDown post-tags-list"><li class="animated fadeInDown post-tags-list-item"><a class="animated fadeInDown post-tags-list-link" href="/tags/群晖/">群晖</a></li></ul>
<div class="md-content animated fadeIn">
<p>本文基本来源 <a href="https://neko.re/" target="_blank" rel="noopener">Yukino’s 理想乡</a> 的 <a href="https://neko.re/archives/128.html" target="_blank" rel="noopener">emby 破解版完全食用方法</a></p>
<p>但是文中没有提供 docker 版的安装方法和相关配置!!所以这里完善一下!</p>
<p>套件版方案使用起来很舒服,但是需要 fan 墙刮削。docker 版可以以一种巧妙的方式刮削,但是配置起来麻烦。</p>
<ol>
<li><p>因为使用 emby 套件源,在国内难以访问,<a href="https://emby.media/synology-server.html" target="_blank" rel="noopener">所以我们从官网上下载 emby 并安装</a></p>
</li>
<li><p>安装好后关闭 emby</p>
</li>
<li><p>使用脚本破解 <code>wget https://neko.re/wp-content/uploads/simple-file-list...</code></p></li></ol>
<span class="read-more"><a href="/posts/38ad339f/" title="查看全文" class="posttitle">查看全文</a> <b class="iconfont icon-arrow-right- gradient-text"></b></span>
</div>
</div>
</div>
<div class="post" id="post">
<div class="post-cover animated fadeIn" style="
background-image:
radial-gradient(ellipse closest-side, rgba(0, 0, 0, 0.65), #100e17),
url(/img/welcome-cover.jpg);">
</div>
<div class="else">
<p class="animated fadeInDown">
<a href="/categories/工作之余">
<b>「 </b>工作之余<b> 」</b>
</a>
十月 11, 2020
</p>
<h3 class="post-title animated fadeInDown"><a href="/posts/304b0279/" title="解决群晖使用百度云docker镜像提示登陆过期的问题" class="posttitle">解决群晖使用百度云docker镜像提示登陆过期的问题</a></h3>
<p class="post-count animated fadeInDown">
<span>
<b class="iconfont icon-text2"></b> <i>文章字数</i>
732
</span>
<span>
<b class="iconfont icon-timer__s"></b> <i>阅读约需</i>
1 mins.
</span>
<span id="/posts/304b0279/" class="leancloud_visitors" data-flag-title="">
<b class="iconfont icon-read"></b> <i>阅读次数</i>
<span class="leancloud-visitors-count">1000000</span>
</span>
</p>
<ul class="animated fadeInDown post-tags-list"><li class="animated fadeInDown post-tags-list-item"><a class="animated fadeInDown post-tags-list-link" href="/tags/群晖/">群晖</a></li></ul>
<div class="md-content animated fadeIn">
<p>群晖中使用的百度套件是基于<code>VNC + Linux版百度云</code>打包的docker镜像实现的,但是作者因为稳定性原因通过修改检测更新的hosts方法将百度云版本锁定在3.0.1.2版本。可是这在部分机器上不生效,那么我们反之道而行,自己更新容器里的百度云版本。</p>
<ol>
<li><p>去百度云官网下载<code>.deb</code>版百度云: <a href="https://pan.baidu.com/download" target="_blank" rel="noopener">下载地址</a></p>
</li>
<li><p>将下好的镜像放到群晖已挂载的<code>baidudownload</code>文件夹里</p>
</li>
<li><p>进入容器中的<code>baidudownload</code>目录</p>
</li>
<li><p>执行 <code>sudo dpkg -i baidunetdisk_3.4.1_amd64.deb...</code></p></li></ol>
<span class="read-more"><a href="/posts/304b0279/" title="查看全文" class="posttitle">查看全文</a> <b class="iconfont icon-arrow-right- gradient-text"></b></span>
</div>
</div>
</div>
<div class="post" id="post">
<div class="post-cover animated fadeIn" style="
background-image:
radial-gradient(ellipse closest-side, rgba(0, 0, 0, 0.65), #100e17),
url(/img/welcome-cover.jpg);">
</div>
<div class="else">
<p class="animated fadeInDown">
<a href="/categories/知识储备">
<b>「 </b>知识储备<b> 」</b>
</a>
九月 29, 2020
</p>
<h3 class="post-title animated fadeInDown"><a href="/posts/c6f5fe28/" title="Python 中的上下文管理" class="posttitle">Python 中的上下文管理</a></h3>
<p class="post-count animated fadeInDown">
<span>
<b class="iconfont icon-text2"></b> <i>文章字数</i>
6k
</span>
<span>
<b class="iconfont icon-timer__s"></b> <i>阅读约需</i>
5 mins.
</span>
<span id="/posts/c6f5fe28/" class="leancloud_visitors" data-flag-title="">
<b class="iconfont icon-read"></b> <i>阅读次数</i>
<span class="leancloud-visitors-count">1000000</span>
</span>
</p>
<ul class="animated fadeInDown post-tags-list"><li class="animated fadeInDown post-tags-list-item"><a class="animated fadeInDown post-tags-list-link" href="/tags/Python/">Python</a></li></ul>
<div class="md-content animated fadeIn">
<p>当我们执行语句块前需要一些准备动作,在执行完成之后又需要执行一些收尾动作。比如:文件读写后需要关闭,数据库读写完毕后需要关闭连接,资源加锁解锁等情况。对于这种情况 python 提供了上下文管理的概念,可以通过上下文管理器处理代码块执行前的准备动作,以及执行后的收尾动作。</p>
<p>先来看看不使用上下文管理器的情况</p>
<pre><code class="python">f = open("log.txt", "w")
try:
f.write("hello")
finally:
f.close()
...</code></pre>
<span class="read-more"><a href="/posts/c6f5fe28/" title="查看全文" class="posttitle">查看全文</a> <b class="iconfont icon-arrow-right- gradient-text"></b></span>
</div>
</div>
</div>
<div class="post" id="post">
<div class="post-cover animated fadeIn" style="
background-image:
radial-gradient(ellipse closest-side, rgba(0, 0, 0, 0.65), #100e17),
url(/img/welcome-cover.jpg);">
</div>
<div class="else">
<p class="animated fadeInDown">
<a href="/categories/机器学习笔记">
<b>「 </b>机器学习笔记<b> 」</b>
</a>
九月 22, 2020
</p>
<h3 class="post-title animated fadeInDown"><a href="/posts/1b5a6244/" title="Spark vs Dask Python生态下的计算引擎" class="posttitle">Spark vs Dask Python生态下的计算引擎</a></h3>
<p class="post-count animated fadeInDown">
<span>
<b class="iconfont icon-text2"></b> <i>文章字数</i>
3.7k
</span>
<span>
<b class="iconfont icon-timer__s"></b> <i>阅读约需</i>
3 mins.
</span>
<span id="/posts/1b5a6244/" class="leancloud_visitors" data-flag-title="">
<b class="iconfont icon-read"></b> <i>阅读次数</i>
<span class="leancloud-visitors-count">1000000</span>
</span>
</p>
<ul class="animated fadeInDown post-tags-list"><li class="animated fadeInDown post-tags-list-item"><a class="animated fadeInDown post-tags-list-link" href="/tags/Python/">Python</a></li><li class="animated fadeInDown post-tags-list-item"><a class="animated fadeInDown post-tags-list-link" href="/tags/dask/">dask</a></li><li class="animated fadeInDown post-tags-list-item"><a class="animated fadeInDown post-tags-list-link" href="/tags/spark/">spark</a></li><li class="animated fadeInDown post-tags-list-item"><a class="animated fadeInDown post-tags-list-link" href="/tags/机器学习/">机器学习</a></li><li class="animated fadeInDown post-tags-list-item"><a class="animated fadeInDown post-tags-list-link" href="/tags/计算引擎/">计算引擎</a></li></ul>
<div class="md-content animated fadeIn">
<blockquote>
<p>本文基于<a href="https://databricks.com/speaker/gurpreet-singh" target="_blank" rel="noopener">Gurpreet Singh</a>大佬在 Spark+AI SUMMIT 2020 的<a href="https://databricks.com/session/dask-and-apache-spark" target="_blank" rel="noopener">公开课</a>编写</p>
</blockquote>
<p>对于 Python 环境下开发的数据科学团队,Dask 为分布式分析指出了非常明确的道路,但是事实上大家都选择了 Spark 来达成相同的目的。Dask 是一个纯 Python 框架,它允许在本地或集群上运行相同的 Pandas 或 Numpy 代码。而 Spark 即时使用了 Apache 的 pySpark 包装器,仍然带来了学习门槛,其中涉及新的 API 和执行模型。鉴于以上陈述,我们下...</p>
<span class="read-more"><a href="/posts/1b5a6244/" title="查看全文" class="posttitle">查看全文</a> <b class="iconfont icon-arrow-right- gradient-text"></b></span>
</div>
</div>
</div>
<div class="post" id="post">
<div class="post-cover animated fadeIn" style="
background-image:
radial-gradient(ellipse closest-side, rgba(0, 0, 0, 0.65), #100e17),
url(/img/welcome-cover.jpg);">
</div>
<div class="else">
<p class="animated fadeInDown">
<a href="/categories/小项目">
<b>「 </b>小项目<b> 」</b>
</a>
九月 05, 2020
</p>
<h3 class="post-title animated fadeInDown"><a href="/posts/cdf378fe/" title="在线、离线激活鉴权实战" class="posttitle">在线、离线激活鉴权实战</a></h3>
<p class="post-count animated fadeInDown">
<span>
<b class="iconfont icon-text2"></b> <i>文章字数</i>
4.9k
</span>
<span>
<b class="iconfont icon-timer__s"></b> <i>阅读约需</i>
4 mins.
</span>
<span id="/posts/cdf378fe/" class="leancloud_visitors" data-flag-title="">
<b class="iconfont icon-read"></b> <i>阅读次数</i>
<span class="leancloud-visitors-count">1000000</span>
</span>
</p>
<ul class="animated fadeInDown post-tags-list"><li class="animated fadeInDown post-tags-list-item"><a class="animated fadeInDown post-tags-list-link" href="/tags/python/">python</a></li><li class="animated fadeInDown post-tags-list-item"><a class="animated fadeInDown post-tags-list-link" href="/tags/业务设计/">业务设计</a></li><li class="animated fadeInDown post-tags-list-item"><a class="animated fadeInDown post-tags-list-link" href="/tags/小项目/">小项目</a></li></ul>
<div class="md-content animated fadeIn">
<p>实现一个客户端通过给与的指定激活码,激活仅限当前机器使用具体软件的功能。客户端可能处于<strong>能连接互联网</strong>和<strong>无法连接互联网</strong>两种情况。同时均要实现在指定时间使权限过期的功能,激活码在使用时才开始计时。</p>
<p>这个就非常简单了,使用最简单的哈希加盐就可以实现了,与正常 REST 接口的哈希加盐验证只有,验证服务器端需要预先存好设置的激活码这一步。</p>
<p>激活码有效期就通过一个取巧的方法,将有效期的秒数转换成16进制,埋藏在序列号的指定段上。<br>在将当前时间和过期时间一起加盐,实现用户无法通过修改或锁定系统时间破解我们的系统...</p>
<span class="read-more"><a href="/posts/cdf378fe/" title="查看全文" class="posttitle">查看全文</a> <b class="iconfont icon-arrow-right- gradient-text"></b></span>
</div>
</div>
</div>
<div class="post" id="post">
<div class="post-cover animated fadeIn" style="
background-image:
radial-gradient(ellipse closest-side, rgba(0, 0, 0, 0.65), #100e17),
url(/img/welcome-cover.jpg);">
</div>
<div class="else">
<p class="animated fadeInDown">
<a href="/categories/知识储备">
<b>「 </b>知识储备<b> 」</b>
</a>
八月 31, 2020
</p>
<h3 class="post-title animated fadeInDown"><a href="/posts/65161822/" title="Redis 主从复制 哨兵模式实战" class="posttitle">Redis 主从复制 哨兵模式实战</a></h3>
<p class="post-count animated fadeInDown">
<span>
<b class="iconfont icon-text2"></b> <i>文章字数</i>
3.8k
</span>
<span>
<b class="iconfont icon-timer__s"></b> <i>阅读约需</i>
3 mins.
</span>
<span id="/posts/65161822/" class="leancloud_visitors" data-flag-title="">
<b class="iconfont icon-read"></b> <i>阅读次数</i>
<span class="leancloud-visitors-count">1000000</span>
</span>
</p>
<ul class="animated fadeInDown post-tags-list"><li class="animated fadeInDown post-tags-list-item"><a class="animated fadeInDown post-tags-list-link" href="/tags/redis/">redis</a></li><li class="animated fadeInDown post-tags-list-item"><a class="animated fadeInDown post-tags-list-link" href="/tags/高可用/">高可用</a></li></ul>
<div class="md-content animated fadeIn">
<p>项目中因为并发不是很高一直偷懒用的单节点 Redis ,但是有很多大 key 写入的场景,这样会影响读性能,于是准备做主从复制,顺便做一下哨兵模式。</p>
<p>这里很简单,只需要配置<code>slaveof <masterip> <masterport></code>参数即可实现。</p>
<blockquote>
<p>注: Redis 5.0 版本后建议使用<code>replicaof</code>代替<code>slaveof</code>。 因为奇妙的<code>政治正确</code>原因,迫使作者修改了配置名,虽然<code>slaveof</code>仍能使用,但是只是暂时的兼容方案。</p>
</blockquote>
<p>修改后重启 Redis 查看配置显示, 表...</p>
<span class="read-more"><a href="/posts/65161822/" title="查看全文" class="posttitle">查看全文</a> <b class="iconfont icon-arrow-right- gradient-text"></b></span>
</div>
</div>
</div>
<div class="post" id="post">
<div class="post-cover animated fadeIn" style="
background-image:
radial-gradient(ellipse closest-side, rgba(0, 0, 0, 0.65), #100e17),
url(/img/welcome-cover.jpg);">
</div>
<div class="else">
<p class="animated fadeInDown">
<a href="/categories/LeetCode刷题总结">
<b>「 </b>LEETCODE刷题总结<b> 」</b>
</a>
八月 28, 2020
</p>
<h3 class="post-title animated fadeInDown"><a href="/posts/5cb682e4/" title="算法题基本框架 - Python实现" class="posttitle">算法题基本框架 - Python实现</a></h3>
<p class="post-count animated fadeInDown">
<span>
<b class="iconfont icon-text2"></b> <i>文章字数</i>
11k
</span>
<span>
<b class="iconfont icon-timer__s"></b> <i>阅读约需</i>
10 mins.
</span>
<span id="/posts/5cb682e4/" class="leancloud_visitors" data-flag-title="">
<b class="iconfont icon-read"></b> <i>阅读次数</i>
<span class="leancloud-visitors-count">1000000</span>
</span>
</p>
<ul class="animated fadeInDown post-tags-list"><li class="animated fadeInDown post-tags-list-item"><a class="animated fadeInDown post-tags-list-link" href="/tags/LeetCode/">LeetCode</a></li><li class="animated fadeInDown post-tags-list-item"><a class="animated fadeInDown post-tags-list-link" href="/tags/Python/">Python</a></li><li class="animated fadeInDown post-tags-list-item"><a class="animated fadeInDown post-tags-list-link" href="/tags/二叉树/">二叉树</a></li><li class="animated fadeInDown post-tags-list-item"><a class="animated fadeInDown post-tags-list-link" href="/tags/数据结构/">数据结构</a></li></ul>
<div class="md-content animated fadeIn">
<blockquote>
<p>二叉搜索树的中序遍历即为这棵树叶子节点值从小到大的排列</p>
</blockquote>
<pre><code class="python">def dfs(root: TreeNode):
if not root:
return
# 先序遍历
dfs(root.left)
# 中序遍历
dfs(root.right)
# 后续遍历
</code></pre>
<pre><code class="python"> from collections import deque
def bfs(root: TreeNode, target: TreeNode):
queue = deque()
# 记录访问的节点避免走回头路
vistied = []
# 起...</code></pre>
<span class="read-more"><a href="/posts/5cb682e4/" title="查看全文" class="posttitle">查看全文</a> <b class="iconfont icon-arrow-right- gradient-text"></b></span>
</div>
</div>
</div>
</div>
<div id="pager"><a href="/page/2/" class="more" data-loading="加载中..." data-load-more="加载更多">加载更多</a></div>
</div>
<div id="preview"></div>
<div id="back-to-top" class="animated fadeIn faster">
<div class="flow"></div>
<span class="percentage animated fadeIn faster">0%</span>
<span class="iconfont icon-top02 animated fadeIn faster"></span>
</div><!-- hexo-inject:begin --><!-- Begin: Injected MathJax -->
<script type="text/x-mathjax-config">
MathJax.Hub.Config("");
</script>
<script type="text/x-mathjax-config">
MathJax.Hub.Queue(function() {
var all = MathJax.Hub.getAllJax(), i;
for(i=0; i < all.length; i += 1) {
all[i].SourceElement().parentNode.className += ' has-jax';
}
});
</script>
<script type="text/javascript" src="">
</script>
<!-- End: Injected MathJax -->
<!-- hexo-inject:end -->
</body>
<footer>
<p class="copyright" id="copyright">
© 2021
<span class="gradient-text">
EwdAger
</span>.
Powered by <a href="http://hexo.io/" title="Hexo" target="_blank" rel="noopener">Hexo</a>
Theme
<span class="gradient-text">
<a href="https://github.com/TriDiamond/hexo-theme-obsidian" title="Obsidian" target="_blank" rel="noopener">Obsidian</a>
</span>
<small><a href="https://github.com/TriDiamond/hexo-theme-obsidian/blob/master/CHANGELOG.md" title="v1.4.3" target="_blank" rel="noopener">v1.4.3</a></small>
</p>
</footer>
<script type="text/javascript" src="https://cdn.bootcss.com/mathjax/2.7.6/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
</script>
<script>
MathJax.Hub.Config({
"HTML-CSS": {
preferredFont: "TeX",
availableFonts: ["STIX", "TeX"],
linebreaks: {
automatic: true
},
EqnChunk: (MathJax.Hub.Browser.isMobile ? 10 : 50)
},
tex2jax: {
inlineMath: [
["$", "$"],
["\\(", "\\)"]
],
processEscapes: true,
ignoreClass: "tex2jax_ignore|dno",
skipTags: ['script', 'noscript', 'style', 'textarea', 'pre', 'code']
},
TeX: {
noUndefined: {
attributes: {
mathcolor: "red",
mathbackground: "#FFEEEE",
mathsize: "90%"
}
},
Macros: {
href: "{}"
}
},
messageStyle: "none"
});
</script>
<script>
function initialMathJax() {
MathJax.Hub.Queue(function () {
var all = MathJax.Hub.getAllJax(),
i;
// console.log(all);
for (i = 0; i < all.length; i += 1) {
console.log(all[i].SourceElement().parentNode)
all[i].SourceElement().parentNode.className += ' has-jax';
}
});
}
function reprocessMathJax() {
if (typeof MathJax !== 'undefined') {
MathJax.Hub.Queue(["Typeset", MathJax.Hub]);
}
}
</script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="/js/plugin.js"></script>
<script src="/js/obsidian.js"></script>
<script src="/js/jquery.truncate.js"></script>
<script src="/js/search.js"></script> <script src="//cdn.bootcss.com/typed.js/2.0.10/typed.min.js"></script> <script src="//cdn.bootcss.com/blueimp-md5/2.12.0/js/md5.min.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/social-share.js/1.0.16/js/social-share.min.js"></script>
<script src="https://cdn.bootcss.com/codemirror/5.48.4/codemirror.min.js"></script>
<script src="//cdn.bootcss.com/codemirror/5.48.4/mode/javascript/javascript.min.js"></script> <script src="//cdn.bootcss.com/codemirror/5.48.4/mode/css/css.min.js"></script> <script src="//cdn.bootcss.com/codemirror/5.48.4/mode/xml/xml.min.js"></script> <script src="//cdn.bootcss.com/codemirror/5.48.4/mode/htmlmixed/htmlmixed.min.js"></script> <script src="//cdn.bootcss.com/codemirror/5.48.4/mode/clike/clike.min.js"></script> <script src="//cdn.bootcss.com/codemirror/5.48.4/mode/php/php.min.js"></script> <script src="//cdn.bootcss.com/codemirror/5.48.4/mode/shell/shell.min.js"></script> <script src="//cdn.bootcss.com/codemirror/5.48.4/mode/python/python.min.js"></script> <link rel="stylesheet" href="//cdn.bootcss.com/photoswipe/4.1.3/photoswipe.min.css">
<link rel="stylesheet" href="//cdn.bootcss.com/photoswipe/4.1.3/default-skin/default-skin.min.css">
<script src="//cdn.bootcss.com/photoswipe/4.1.3/photoswipe.min.js"></script>
<script src="//cdn.bootcss.com/photoswipe/4.1.3/photoswipe-ui-default.min.js"></script>
<!-- Root element of PhotoSwipe. Must have class pswp. -->
<div class="pswp" tabindex="-1" role="dialog" aria-hidden="true">
<!-- Background of PhotoSwipe.
It's a separate element as animating opacity is faster than rgba(). -->
<div class="pswp__bg"></div>
<!-- Slides wrapper with overflow:hidden. -->
<div class="pswp__scroll-wrap">
<!-- Container that holds slides.
PhotoSwipe keeps only 3 of them in the DOM to save memory.
Don't modify these 3 pswp__item elements, data is added later on. -->
<div class="pswp__container">
<div class="pswp__item"></div>
<div class="pswp__item"></div>
<div class="pswp__item"></div>
</div>
<!-- Default (PhotoSwipeUI_Default) interface on top of sliding area. Can be changed. -->
<div class="pswp__ui pswp__ui--hidden">
<div class="pswp__top-bar">
<!-- Controls are self-explanatory. Order can be changed. -->
<div class="pswp__counter"></div>
<button class="pswp__button pswp__button--close" title="Close (Esc)"></button>
<button class="pswp__button pswp__button--share" title="Share"></button>
<button class="pswp__button pswp__button--fs" title="Toggle fullscreen"></button>
<button class="pswp__button pswp__button--zoom" title="Zoom in/out"></button>
<!-- Preloader demo http://codepen.io/dimsemenov/pen/yyBWoR -->
<!-- element will get class pswp__preloader--active when preloader is running -->
<div class="pswp__preloader">
<div class="pswp__preloader__icn">
<div class="pswp__preloader__cut">
<div class="pswp__preloader__donut"></div>
</div>
</div>
</div>
</div>
<div class="pswp__share-modal pswp__share-modal--hidden pswp__single-tap">
<div class="pswp__share-tooltip"></div>
</div>
<button class="pswp__button pswp__button--arrow--left" title="Previous (arrow left)">
</button>
<button class="pswp__button pswp__button--arrow--right" title="Next (arrow right)">
</button>
<div class="pswp__caption">
<div class="pswp__caption__center"></div>
</div>
</div>
</div>
</div>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="//www.googletagmanager.com/gtag/js?id=UA-149874671-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() {
dataLayer.push(arguments);
}
gtag('js', new Date());
gtag('config', 'UA-149874671-1');
</script>
<script>
function initialTyped() {
var typedTextEl = $('.typed-text');
if (typedTextEl && typedTextEl.length > 0) {
var typed = new Typed('.typed-text', {
strings: ['Farewell,good hunter.May you find your worth in the waking world.', '再见,善良的猎人。愿你能在清醒的世界中找到自己的价值。'],
typeSpeed: 90,
loop: true,
loopCount: Infinity,
backSpeed: 20,
});
}
}
if ($('.article-header') && $('.article-header').length) {
$(document).ready(function () {
initialTyped();
});
}
</script>
<script src="//unpkg.com/valine/dist/Valine.min.js"></script>
<script>
var valine = new Valine();
function initValine(path) {
if (!path) path = window.location.pathname;
let language = 'zh-CN';
if (!language) {
language = 'en';
} else {
language = language.toLowerCase();
}
valine.init({
el: '#vcomments',
appId: 'ChQ4z1dCRpWqCOD43kU6cGmM-gzGzoHsz',
appKey: 'pFaAS3aumHDM572YbXkzc3fO',
notify: 'false',
verify: 'false',
avatar: 'retro',
placeholder: '留下你的评论~',
visitor: 'true',
path: path,
lang: language,
});
}
$(document).ready(function () {
initValine();
});
</script>
</html>