-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
683 lines (680 loc) · 40.8 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
<!DOCTYPE html>
<html lang="zh_Hans">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
<title>Saafo's Homepage</title>
<link href="https://cdn.bootcss.com/github-markdown-css/4.0.0/github-markdown.css" rel="stylesheet">
<link rel="stylesheet" href="css/index.css"/>
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon"/>
<script src="https://cdn.bootcss.com/jquery/3.5.1/jquery.min.js"></script>
<script src="js/index.js"></script>
</head>
<body>
<!-- Navigation -->
<nav class="random-bg-color">
<div class="nav-title">
<ul class="nav-title">
<li>
<a class="nav-title" href="https://saafo.cc">𝔐</a>
</li>
</ul>
</div>
<div class="nav-container">
<ul class="nav-container">
<li>
<a href="/rss.xml">RSS</a>
</li>
<li>
<a href="/about.html">About Me</a>
</li>
</ul>
</div>
</nav>
<!-- Body -->
<!-- Title -->
<div class="title-container random-bg-color shadow">
<h1 data-spotlight="Saafo's Homepage" class="random-color">Saafo's Homepage</h1>
</div>
<!-- Content -->
<div class="content-container">
<div class="main-content-container">
<div id="main-content">
<div class='post shadow'>
<header class='post-header'>
<h1 class='post-title'>
<a href='https://blog.saafo.cc/20210131_detect-apple-pencil' class='random-color'>
检测 Apple Pencil 连接 iPad
</a>
</h1>
<div class='post-meta'>
<span class='post-time'>2021·01·31</span>
</div>
</header>
<div class='post-body markdown-body'>
<p>本文简单介绍一下利用<code>CBCentralManager</code>检测 Apple Pencil 的连接,以及<code>CBCentralManager</code>的使用注意事项。</p> </div>
<div class='post-button random-bg-color'>
<a href='https://blog.saafo.cc/20210131_detect-apple-pencil'>
阅读全文
</a>
</div>
</div>
<div class='post shadow'>
<header class='post-header'>
<h1 class='post-title'>
<a href='https://blog.saafo.cc/20201109_hello-bytedance' class='random-color'>
《Hello Bytedance》
</a>
</h1>
<div class='post-meta'>
<span class='post-time'>2020·11·09</span>
</div>
</header>
<div class='post-body markdown-body'>
<p>不出太大的意外的话,应该下下周会入职字节了。</p>
<p>人生的第一份工作,虽然是实习,已经很满意啦。只是对不起猿辅导和有道的HR了🙏。</p>
<p>本文对前四个月我的所有实习准备和面试过程做一个回顾和记录吧,如果能给读者带来一点启发,不胜荣幸。</p> </div>
<div class='post-button random-bg-color'>
<a href='https://blog.saafo.cc/20201109_hello-bytedance'>
阅读全文
</a>
</div>
</div>
<div class='post shadow'>
<header class='post-header'>
<h1 class='post-title'>
<a href='https://blog.saafo.cc/20201011_cs-basics-review' class='random-color'>
计算机基础知识复习提纲
</a>
</h1>
<div class='post-meta'>
<span class='post-time'>2020·10·11</span>
</div>
</header>
<div class='post-body markdown-body'>
<p>核心专业课学完了,来面向面经整理一下计算机基础的知识点提纲。</p> </div>
<div class='post-button random-bg-color'>
<a href='https://blog.saafo.cc/20201011_cs-basics-review'>
阅读全文
</a>
</div>
</div>
<div class='post shadow'>
<header class='post-header'>
<h1 class='post-title'>
<a href='https://blog.saafo.cc/20200926_gitlab-workflow' class='random-color'>
GitLab工作流说明
</a>
</h1>
<div class='post-meta'>
<span class='post-time'>2020·09·26</span>
</div>
</header>
<div class='post-body markdown-body'>
<p>使用GitLab工作流可以让我们更充分地使用GitLab,提高团队协作效率。</p>
<p>本文会描述一个完整的GitLab + Xcode工作流。</p> </div>
<div class='post-button random-bg-color'>
<a href='https://blog.saafo.cc/20200926_gitlab-workflow'>
阅读全文
</a>
</div>
</div>
<div class='post shadow'>
<header class='post-header'>
<h1 class='post-title'>
<a href='https://blog.saafo.cc/20200905_ics-structure' class='random-color'>
ICS文件格式解析
</a>
</h1>
<div class='post-meta'>
<span class='post-time'>2020·09·05</span>
</div>
</header>
<div class='post-body markdown-body'>
<p>最近写了一个生成ics文件的js脚本,过程中大致了解到了ics文件的基本格式,总结在此。</p> </div>
<div class='post-button random-bg-color'>
<a href='https://blog.saafo.cc/20200905_ics-structure'>
阅读全文
</a>
</div>
</div>
<div class='post shadow'>
<header class='post-header'>
<h1 class='post-title'>
<a href='https://blog.saafo.cc/20200803_lc-at-swift-12-prune' class='random-color'>
LeetCode@Swift - Vol.12 剪枝
</a>
</h1>
<div class='post-meta'>
<span class='post-time'>2020·08·03</span>
</div>
</header>
<div class='post-body markdown-body'>
<p>剪枝的本质思想就是在递归/DFS的过程中,在进入分支之前加入判断,在遍历的过程中就先排除一些不可能的分支。</p>
<h2>括号生成</h2>
<p><a href="https://leetcode-cn.com/problems/generate-parentheses/">括号生成 - 力扣括号生成</a></p>
<blockquote>
<p>数字 n 代表生成括号的对数,请你设计一个函数,用于能够生成所有可能的并且 有效的 括号组合。</p>
</blockquote> </div>
<div class='post-button random-bg-color'>
<a href='https://blog.saafo.cc/20200803_lc-at-swift-12-prune'>
阅读全文
</a>
</div>
</div>
<div class='post shadow'>
<header class='post-header'>
<h1 class='post-title'>
<a href='https://blog.saafo.cc/20200731_lc-at-swift-11-bfs-and-dfs' class='random-color'>
LeetCode@Swift - Vol.11 深度优先和广度优先
</a>
</h1>
<div class='post-meta'>
<span class='post-time'>2020·07·31</span>
</div>
</header>
<div class='post-body markdown-body'>
<p>BFS和DFS是比先序中序后序更加常考也更加普遍运用的算法。</p>
<p>BFS一般只采用非递归实现。</p>
<p>DFS可采用递归和非递归实现。</p>
<p>但二者并不一定有严格的界限,有的BFS的题也可以用DFS实现。比如下面这道题:</p> </div>
<div class='post-button random-bg-color'>
<a href='https://blog.saafo.cc/20200731_lc-at-swift-11-bfs-and-dfs'>
阅读全文
</a>
</div>
</div>
<div class='post shadow'>
<header class='post-header'>
<h1 class='post-title'>
<a href='https://blog.saafo.cc/20200730_lc-at-swift-10-greedy-algorithm' class='random-color'>
LeetCode@Swift - Vol.10 贪心算法
</a>
</h1>
<div class='post-meta'>
<span class='post-time'>2020·07·30</span>
</div>
</header>
<div class='post-body markdown-body'>
<p>适用于贪心算法的场景:</p>
<ul>
<li>问题能够分解成子问题来解决</li>
<li>子问题的最优解能递推到全局问题的最优解(此时子问题的最优解为最优子结构)</li>
</ul>
<p>贪心算法与动态规划的不同在于,它对每个子问题的解决方案都做出选择,不能回退。
动态规划则会保存以前的运算结构,并根据以前的结构对当前进行选择,有回退功能。</p> </div>
<div class='post-button random-bg-color'>
<a href='https://blog.saafo.cc/20200730_lc-at-swift-10-greedy-algorithm'>
阅读全文
</a>
</div>
</div>
<div class='post shadow'>
<header class='post-header'>
<h1 class='post-title'>
<a href='https://blog.saafo.cc/20200729_lc-at-swift-09-divide-and-conquer' class='random-color'>
LeetCode@Swift - Vol.9 递归和分治
</a>
</h1>
<div class='post-meta'>
<span class='post-time'>2020·07·29</span>
</div>
</header>
<div class='post-body markdown-body'>
<p>递归的基本用法在之前的文章中已经有提到也有过不少的应用。对于分治,Divide & Conquer,很重要的一点在于<code>Divide</code>,比如接下来的这一题。</p>
<h2>Pow(x, n)</h2>
<p><a href="https://leetcode-cn.com/problems/powx-n/">Pow(x, n) - 力扣</a></p>
<blockquote>
<p>实现 pow(x, n) ,即计算 x 的 n 次幂函数。</p>
</blockquote> </div>
<div class='post-button random-bg-color'>
<a href='https://blog.saafo.cc/20200729_lc-at-swift-09-divide-and-conquer'>
阅读全文
</a>
</div>
</div>
<div class='post shadow'>
<header class='post-header'>
<h1 class='post-title'>
<a href='https://blog.saafo.cc/20200728_lc-at-swift-08-tree' class='random-color'>
LeetCode@Swift - Vol.8 树
</a>
</h1>
<div class='post-meta'>
<span class='post-time'>2020·07·28</span>
</div>
</header>
<div class='post-body markdown-body'>
<p>树是算法中很重要的一个结构,通常需要掌握先序/中序/后序的递归/非递归算法,以及BFS/HFS算法。常见的题目有二叉树、二叉搜索树相关的题型。</p> </div>
<div class='post-button random-bg-color'>
<a href='https://blog.saafo.cc/20200728_lc-at-swift-08-tree'>
阅读全文
</a>
</div>
</div>
<div class='post shadow'>
<header class='post-header'>
<h1 class='post-title'>
<a href='https://blog.saafo.cc/20200714_lc-at-swift-07-map-and-set' class='random-color'>
LeetCode@Swift - Vol.7 map和set
</a>
</h1>
<div class='post-meta'>
<span class='post-time'>2020·07·14</span>
</div>
</header>
<div class='post-body markdown-body'>
<p><code>map</code>和<code>set</code>的具体实现方式有<code>hashMap</code>、<code>treeMap</code>、<code>hashSet</code>和<code>treeSet</code>。具体的实现过程清楚原理即可,不在此赘述。</p>
<p>对应到语言中,map的一般实现方式,在Swift和Python中都是用<code>hashMap</code>来实现的,Java中可以指定hash/tree。set一般都有原生的类型。</p>
<h2>有效的字母异位词</h2>
<p><a href="https://leetcode-cn.com/problems/valid-anagram/">有效的字母异位词 - 力扣</a></p> </div>
<div class='post-button random-bg-color'>
<a href='https://blog.saafo.cc/20200714_lc-at-swift-07-map-and-set'>
阅读全文
</a>
</div>
</div>
<div class='post shadow'>
<header class='post-header'>
<h1 class='post-title'>
<a href='https://blog.saafo.cc/20200712_lc-at-swift-06-sliding-window' class='random-color'>
LeetCode@Swift - Vol.6 滑动窗口
</a>
</h1>
<div class='post-meta'>
<span class='post-time'>2020·07·12</span>
</div>
</header>
<div class='post-body markdown-body'>
<h2>滑动窗口题型总结</h2>
<p>滑动窗口算得上面试中的非常高频的题型。</p>
<p>滑动窗口主要用来处理连续问题。比如题目求解“连续子串...”、“连续子数组...”,这时就应该能想到滑动窗口。</p>
<p>从类型上,滑动窗口主要有以下三种题型:</p> </div>
<div class='post-button random-bg-color'>
<a href='https://blog.saafo.cc/20200712_lc-at-swift-06-sliding-window'>
阅读全文
</a>
</div>
</div>
<div class='post shadow'>
<header class='post-header'>
<h1 class='post-title'>
<a href='https://blog.saafo.cc/20200711_lc-at-swift-05-priority-queue' class='random-color'>
LeetCode@Swift - Vol.5 优先队列
</a>
</h1>
<div class='post-meta'>
<span class='post-time'>2020·07·11</span>
</div>
</header>
<div class='post-body markdown-body'>
<p>优先队列也不用太去关注底层实现,一般的语言都已经有了成熟的实现。对于优先队列来说,一般其实现机制有:堆(二叉堆、二项式堆、斐波那契堆)、二叉搜索树。</p>
<p>关于堆的各种具体实现的时间复杂度,可以参考<a href="https://en.wikipedia.org/wiki/Heap_(data_structure)#Comparison_of_theoretic_bounds_for_variants">维基百科</a>,需要熟记。</p>
<h2>数据流中的第K大元素</h2>
<p><a href="https://leetcode-cn.com/problems/kth-largest-element-in-a-stream/">数据流中的第K大元素 - 力扣</a></p> </div>
<div class='post-button random-bg-color'>
<a href='https://blog.saafo.cc/20200711_lc-at-swift-05-priority-queue'>
阅读全文
</a>
</div>
</div>
<div class='post shadow'>
<header class='post-header'>
<h1 class='post-title'>
<a href='https://blog.saafo.cc/20200710_lc-at-swift-04-stack-and-queue' class='random-color'>
LeetCode@Swift - Vol.4 栈和队列
</a>
</h1>
<div class='post-meta'>
<span class='post-time'>2020·07·10</span>
</div>
</header>
<div class='post-body markdown-body'>
<p>栈和队列在众多语言中已经有了成熟的实现,面试的时候也一般不会让手写一个栈或者队列。不用太关注底层实现,直接用就行了。</p>
<p>栈->数组/单链表</p>
<p>队列->数组/双链表</p>
<h2>比较含退格的字符串</h2> </div>
<div class='post-button random-bg-color'>
<a href='https://blog.saafo.cc/20200710_lc-at-swift-04-stack-and-queue'>
阅读全文
</a>
</div>
</div>
<div class='post shadow'>
<header class='post-header'>
<h1 class='post-title'>
<a href='https://blog.saafo.cc/20200708_lc-at-swift-03-linked-list' class='random-color'>
LeetCode@Swift - Vol.3 链表
</a>
</h1>
<div class='post-meta'>
<span class='post-time'>2020·07·08</span>
</div>
</header>
<div class='post-body markdown-body'>
<p>链表的题目,对于思维的难度(除开部分题的递归解法)要求不算高,主要考察的是代码的实现能力,尽量做到简洁。</p>
<h2>反转链表</h2>
<p><a href="https://leetcode-cn.com/problems/reverse-linked-list/">反转链表 - 力扣</a></p>
<blockquote>
<p>反转一个单链表。
</p>
</blockquote> </div>
<div class='post-button random-bg-color'>
<a href='https://blog.saafo.cc/20200708_lc-at-swift-03-linked-list'>
阅读全文
</a>
</div>
</div>
<div class='post shadow'>
<header class='post-header'>
<h1 class='post-title'>
<a href='https://blog.saafo.cc/20200701_lc-at-swift-02-sorting-algorithm' class='random-color'>
LeetCode@Swift - Vol.2 排序算法
</a>
</h1>
<div class='post-meta'>
<span class='post-time'>2020·07·01</span>
</div>
</header>
<div class='post-body markdown-body'>
<h2>寻找两个正序数组的中位数</h2>
<p><a href="https://leetcode-cn.com/problems/median-of-two-sorted-arrays/">寻找两个正序数组的中位数 - 力扣</a></p>
<blockquote>
<p>给定两个大小为 m 和 n 的正序(从小到大)数组 nums1 和 nums2。</p>
<p>请你找出这两个正序数组的中位数,并且要求算法的时间复杂度为 O(log(m + n))。
</p>
</blockquote> </div>
<div class='post-button random-bg-color'>
<a href='https://blog.saafo.cc/20200701_lc-at-swift-02-sorting-algorithm'>
阅读全文
</a>
</div>
</div>
<div class='post shadow'>
<header class='post-header'>
<h1 class='post-title'>
<a href='https://blog.saafo.cc/20200630_lc-at-swift-01-finding-in-arrays-and-dicts' class='random-color'>
LeetCode@Swift - Vol.1 数组和字典的查找
</a>
</h1>
<div class='post-meta'>
<span class='post-time'>2020·06·30</span>
</div>
</header>
<div class='post-body markdown-body'>
<p>最近开始接触Swift和LeetCode。这个系列的每一期主要是展示一道题的解法,然后逐步优化,顺便整理Swift相关语法。</p>
<h2>两数之和</h2>
<p><a href="https://leetcode-cn.com/problems/two-sum">两数之和 - 力扣</a></p>
<blockquote>
<p>给定一个整数数组 nums 和一个目标值 target,请你在该数组中找出和为目标值的那 两个 整数,并返回他们的数组下标。
</p>
</blockquote> </div>
<div class='post-button random-bg-color'>
<a href='https://blog.saafo.cc/20200630_lc-at-swift-01-finding-in-arrays-and-dicts'>
阅读全文
</a>
</div>
</div>
<div class='post shadow'>
<header class='post-header'>
<h1 class='post-title'>
<a href='https://blog.saafo.cc/20200528_configure-docker-tls' class='random-color'>
配置 Docker TLS 连接
</a>
</h1>
<div class='post-meta'>
<span class='post-time'>2020·05·28</span>
</div>
</header>
<div class='post-body markdown-body'>
<blockquote>
<p>在远程管理<code>Docker</code>的时候,例如用<code>Portainer</code>来连接远程<code>Docker</code>时,默认的方式是在<code>2375</code>端口上连接。但<code>2375</code>上没有任何的鉴权,所以我们需要用更安全的方式来连接远程<code>Docker</code>。</p>
<p>本文主要介绍的是通过<code>TLS CA certificate</code>, <code>TLS certificate</code>和<code>TLS key</code>来远程连接<code>Docker</code>。 </p>
</blockquote>
<h2>生成 TLS 证书和秘钥</h2>
<p>生成证书秘钥可以通过<code>openssl</code>,如果不熟悉<code>openssl</code>,在这里介绍一种新的工具:<code>cfssl</code></p> </div>
<div class='post-button random-bg-color'>
<a href='https://blog.saafo.cc/20200528_configure-docker-tls'>
阅读全文
</a>
</div>
</div>
<div class='post shadow'>
<header class='post-header'>
<h1 class='post-title'>
<a href='https://blog.saafo.cc/20200517_flask-startup' class='random-color'>
flask框架概念理解及部署方式
</a>
</h1>
<div class='post-meta'>
<span class='post-time'>2020·05·17</span>
</div>
</header>
<div class='post-body markdown-body'>
<blockquote>
<p>最近写了一个<code>flask</code>项目,在整个学习的过程中走了不少的弯路,但同时对<code>flask</code>也有了更深刻的理解。我将我的理解做个简单的记录,同时也是一个指路贴,大家可以对<code>flask</code>有一个大概的了解,结合自己的需求找到需要学习的知识点进行更进一步的学习。</p>
</blockquote>
<h2>基本概念</h2>
<h3>最简框架解析</h3>
<p>我们先来看一个最简单的例子:</p> </div>
<div class='post-button random-bg-color'>
<a href='https://blog.saafo.cc/20200517_flask-startup'>
阅读全文
</a>
</div>
</div>
<div class='post shadow'>
<header class='post-header'>
<h1 class='post-title'>
<a href='https://blog.saafo.cc/20200505_from-hello.go-to-lighterdock-3' class='random-color'>
从hello.go到lighterDOCK(三)知识准备和项目配置
</a>
</h1>
<div class='post-meta'>
<span class='post-time'>2020·05·05</span>
</div>
</header>
<div class='post-body markdown-body'>
<p>这篇文章会比较水,主要是教程链接和学习路线指引。</p>
<p>对<code>Docker</code>源码做出修改,我们需要一些基本的能力,以下给出一些资料和教程。</p>
<h2>Go 语法相关</h2>
<ul>
<li><a href="https://github.com/unknwon/the-way-to-go_ZH_CN">The Way to Go</a></li>
<li><a href="https://www.runoob.com/go/go-tutorial.html">Go 语言教程 - 菜鸟教程</a></li>
</ul> </div>
<div class='post-button random-bg-color'>
<a href='https://blog.saafo.cc/20200505_from-hello.go-to-lighterdock-3'>
阅读全文
</a>
</div>
</div>
<div class='post shadow'>
<header class='post-header'>
<h1 class='post-title'>
<a href='https://blog.saafo.cc/20200503_from-hello.go-to-lighterdock-2' class='random-color'>
从hello.go到lighterDOCK(二)在国内编译Docker-ce
</a>
</h1>
<div class='post-meta'>
<span class='post-time'>2020·05·03</span>
</div>
</header>
<div class='post-body markdown-body'>
<blockquote>
<p>众所周知,由于国内的网络环境,诸如docker.com, github.com, debian.org, golang.org等网站的连接速度并不理想。因为<code>Docker</code>的编译并不仅仅是本地编译,而是需要很多的网络依赖包,在编译的过程中需要频繁地从以上网站下载资源。这篇文章详细地讲述了怎样在国内的网络环境编译<code>Docker</code>。</p>
</blockquote>
<h2>教程环境</h2>
<ul>
<li>Ubuntu Server 20.04 (focal)(本文命令为focal的地方,其他版本的同学可以自行替换成对应的代号)</li>
<li>Docker v19.03.8</li>
<li>需要一个socks&http(s)代理,能够通过<code>export</code>命令导入运行环境即可。</li>
</ul> </div>
<div class='post-button random-bg-color'>
<a href='https://blog.saafo.cc/20200503_from-hello.go-to-lighterdock-2'>
阅读全文
</a>
</div>
</div>
<div class='post shadow'>
<header class='post-header'>
<h1 class='post-title'>
<a href='https://blog.saafo.cc/20200501_from-hello.go-to-lighterdock-1' class='random-color'>
从hello.go到lighterDOCK(一)在国内编译moby
</a>
</h1>
<div class='post-meta'>
<span class='post-time'>2020·05·01</span>
</div>
</header>
<div class='post-body markdown-body'>
<blockquote>
<p>众所周知,由于国内的网络环境,诸如docker.com, github.com, debian.org, golang.org等网站的连接速度并不理想。因为<code>moby</code>的编译并不仅仅是本地编译,而是需要很多的网络依赖包,在编译的过程中需要频繁地从以上网站下载资源。这篇文章详细地讲述了怎样在国内的网络环境编译<code>moby</code>。</p>
</blockquote>
<h2>教程环境</h2>
<ul>
<li>Ubuntu Server 20.04</li>
<li>Docker v19.03.8, build afacb8b7f0</li>
<li>Go v1.13.8 linux/amd64</li>
<li>Moby v19.03.8 <a href="https://github.com/moby/moby/tree/f6163d3f7a10c5d01a92bc8b86e204d784b2f6d6">commit f6163d3</a></li>
</ul> </div>
<div class='post-button random-bg-color'>
<a href='https://blog.saafo.cc/20200501_from-hello.go-to-lighterdock-1'>
阅读全文
</a>
</div>
</div>
<div class='post shadow'>
<header class='post-header'>
<h1 class='post-title'>
<a href='https://blog.saafo.cc/20200410_new-home' class='random-color'>
人类的本质是造轮子
</a>
</h1>
<div class='post-meta'>
<span class='post-time'>2020·04·10</span>
</div>
</header>
<div class='post-body markdown-body'>
<p>博客终于建好了。</p>
<p>这里,我用了“建”,没有用“搭”。</p>
<p>起因是,先前为了练手建了个主页,如果再用博客模板的话,就只有和原来的主页说再见了~~别啊~~</p>
<p>于是脑子一时抽风,干脆自己写个框架吧。</p> </div>
<div class='post-button random-bg-color'>
<a href='https://blog.saafo.cc/20200410_new-home'>
阅读全文
</a>
</div>
</div>
<div class='post shadow'>
<header class='post-header'>
<h1 class='post-title'>
<a href='https://blog.saafo.cc/20200307_docker-compose-postgres' class='random-color'>
用docker-compose部署postgresql和pgAdmin4
</a>
</h1>
<div class='post-meta'>
<span class='post-time'>2020·03·07</span>
</div>
</header>
<div class='post-body markdown-body'>
<blockquote>
<p>本来一直在用<code>docker</code>部署<code>postgresql</code>和<code>pgAdmin4</code>,但每次部署起来参数很多很麻烦,而且重启容器或者服务器都很麻烦,索性用<code>docker-compose</code>来部署。</p>
</blockquote>
<h2>准备步骤</h2>
<p>安装<code>docker-compose</code></p>
<p>```bash
apt install docker-compose</p> </div>
<div class='post-button random-bg-color'>
<a href='https://blog.saafo.cc/20200307_docker-compose-postgres'>
阅读全文
</a>
</div>
</div>
<div class='post shadow'>
<header class='post-header'>
<h1 class='post-title'>
<a href='https://blog.saafo.cc/20200229_configure-go-in-vscode' class='random-color'>
Golang 在 VSCode 中的调试配置
</a>
</h1>
<div class='post-meta'>
<span class='post-time'>2020·02·29</span>
</div>
</header>
<div class='post-body markdown-body'>
<p>(解决Golang在VSCode中调试时无法接收标准输入(stdin)的问题)</p>
<blockquote>
<p>最近开始接触Go语言,但在配置VSCode的调试文件的时候发现VSCode中的官方GO插件调试时用的是调试控制台(debug console)而非终端(terminal),找了很多设置也没有类似于<code>terminal</code>或者<code>internalTerminal</code>或者<code>externalTerminal</code>的配置项。最终在<code>vscode-go</code>仓库的<a href="https://github.com/microsoft/vscode-go/issues/219">issue</a>里找到了问题所在。鉴于目前还没有国内的博客帖子总结该问题,在这里总结一下问题原因及解决方案。</p>
</blockquote>
<h3>问题起因</h3>
<p>最开始以为是<code>vscode-go</code>插件的锅,但在相关问题的<a href="https://github.com/microsoft/vscode-go/issues/219">issue</a>里,<code>vscode-go</code>的开发团队给出的回复是,由于<code>delve</code>调试器本身在普通模式运行时就无法直接接受命令行标准输入(stdin),导致配套的相关插件也无法正常工作。本来<code>delve</code>自身加上支持接受命令行输入的功能即可彻底解决这个问题,但似乎<code>delve</code>开发团队的人员<a href="https://github.com/go-delve/delve/issues/1274/#issuecomment-406981956">并不对此感兴趣</a>,不少开发者也同样也对此表示<a href="https://github.com/microsoft/vscode-go/issues/219/#issuecomment-455968894">无奈</a>,只有用目前其他开发者给出的<a href="https://github.com/microsoft/vscode-go/issues/219/#issuecomment-530933960">折中的解决办法</a>。</p> </div>
<div class='post-button random-bg-color'>
<a href='https://blog.saafo.cc/20200229_configure-go-in-vscode'>
阅读全文
</a>
</div>
</div>
<div class='post shadow'>
<header class='post-header'>
<h1 class='post-title'>
<a href='https://blog.saafo.cc/20200218_ali-ecs' class='random-color'>
阿里云ECS初始化及常用操作
</a>
</h1>
<div class='post-meta'>
<span class='post-time'>2020·02·18</span>
</div>
</header>
<div class='post-body markdown-body'>
<h2>初始化</h2>
<ul>
<li>重置实例密码</li>
<li>控制台重启实例</li>
<li>apt update & upgrade</li>
<li>apt install git</li>
<li>apt install axel</li>
<li>apt install python3-pip</li>
</ul> </div>
<div class='post-button random-bg-color'>
<a href='https://blog.saafo.cc/20200218_ali-ecs'>
阅读全文
</a>
</div>
</div>
</div>
</div>
<aside class="sidebar-container">
<div class="sidebar-content shadow">
<p>快速导航</p>
<span class="random-bg-color">
<a href="https://rss.saafo.cc">RSSHub</a>
</span>
<span class="random-bg-color">
<a href="https://database.saafo.cc">PgAdmin4</a>
</span>
<span class="random-bg-color">
<a href="http://dxy.saafo.cc">丁香园</a>
</span>
<span class="random-bg-color">
<a href="https://portainer.saafo.cc/">Portainer</a>
</span>
<p>友链</p>
<span class="random-bg-color">
<a href="https://liuxunzhuo.tech" target="_blank">AI Brain</a>
</span>
<span class="random-bg-color">
<a href="https://constantine3.cn/" target="_blank">Constantine3</a>
</span>
<span class="random-bg-color">
<a href="https://www.350787.xyz/" target="_blank">JACK PURCELL</a>
</span>
</div>
</aside>
</div>
<!-- Footer -->
<footer class="footer-container">
<p>Copyright © 2020 Saafo All Rights Reserved</p>
<a href="https://beian.miit.gov.cn">蜀ICP备2021005337号-1</a>
</footer>
</body>
</html>