-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
674 lines (439 loc) · 22.9 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
<!DOCTYPE html>
<html lang="en">
<head><meta name="generator" content="Hexo 3.9.0">
<meta charset="utf-8">
<title>Eden Tsai</title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="description" content="Eden Tsai's blog">
<meta property="og:type" content="website">
<meta property="og:title" content="Eden Tsai">
<meta property="og:url" content="https://blog.edentsai.net/index.html">
<meta property="og:site_name" content="Eden Tsai">
<meta property="og:description" content="Eden Tsai's blog">
<meta property="og:locale" content="en">
<meta property="og:image" content="https://blog.edentsai.net/images/og_image.png">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="Eden Tsai">
<meta name="twitter:description" content="Eden Tsai's blog">
<meta name="twitter:image" content="https://blog.edentsai.net/images/og_image.png">
<link rel="alternative" href="/atom.xml" title="Eden Tsai" type="application/atom+xml">
<link rel="icon" href="/images/favicon.svg">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/css/bulma.css">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.4.1/css/all.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Ubuntu:400,600|Source+Code+Pro">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/styles/monokai.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/lightgallery.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/justifiedGallery.min.css">
<link rel="stylesheet" href="/css/back-to-top.css">
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-60596122-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-60596122-1');
</script>
<link rel="stylesheet" href="/css/progressbar.css">
<script src="https://cdn.jsdelivr.net/npm/[email protected]/pace.min.js"></script>
<link rel="stylesheet" href="/css/style.css">
</head>
<body class="is-2-column">
<nav class="navbar navbar-main">
<div class="container">
<div class="navbar-brand is-flex-center">
<a class="navbar-item navbar-logo" href="/">
<img src="/images/logo-eden.png" alt="Eden Tsai" height="28">
</a>
</div>
<div class="navbar-menu">
<div class="navbar-start">
<a class="navbar-item is-active" href="/">Home</a>
<a class="navbar-item" href="/archives">Archives</a>
<a class="navbar-item" href="/categories">Categories</a>
<a class="navbar-item" href="/tags">Tags</a>
<a class="navbar-item" href="/about">About</a>
</div>
<div class="navbar-end">
<a class="navbar-item" target="_blank" title="GitHub" href="https://github.com/edentsai">
<i class="fab fa-github"></i>
</a>
<a class="navbar-item" target="_blank" title="RSS" href="/atom.xml">
<i class="fas fa-rss"></i>
</a>
<a class="navbar-item search" title="Search" href="javascript:;">
<i class="fas fa-search"></i>
</a>
</div>
</div>
</div>
</nav>
<section class="section">
<div class="container">
<div class="columns">
<div class="column is-8-tablet is-8-desktop is-8-widescreen has-order-2 column-main">
<div class="card">
<div class="card-content article ">
<div class="level article-meta is-size-7 is-uppercase is-mobile is-overflow-x-auto">
<div class="level-left">
<time class="level-item has-text-grey" datetime="2019-07-13T16:00:00.000Z">2019-07-14</time>
<div class="level-item">
<a class="has-link-grey -link" href="/categories/Shell/">Shell</a>
</div>
</div>
</div>
<h1 class="title is-size-3 is-size-4-mobile has-text-weight-normal">
<a class="has-link-black-ter" href="/20190714-shellcheck-rules/">Table of Shellcheck Rules</a>
</h1>
<div class="content">
<p><a href="https://github.com/koalaman/shellcheck" target="_blank" rel="noopener">Shellcheck</a> 是一套用來檢查與分析 Shell script 的自動化檢查工具,<br>除了檢查撰寫風格以外,它還能夠找出 Shell script 裡有哪些指令可能存在執行風險,<br>並且提供對應的修改方式協助改善 Shell script 的品質。</p>
<p>Shellcheck 的使用方法很簡單,直接參考它本身的文件就很清楚,<br>而且作者有提供方便的 <a href="https://hub.docker.com/r/koalaman/shellcheck/" target="_blank" rel="noopener">docker image</a> 可以直接使用。</p>
<p>當 Shellcheck 發現 shell script 有任何風險時,<br>它除了顯示是哪一段指令會造成風險以外,<br>同時也會提供對應的檢查規範與文件網址,<br>讓你能夠進一步瞭解風險原因與修改方法。</p>
<p>目前 Shellcheck 支援的檢查規範有 SC1000 ~ SC2253 ,<br>大約 340 個,簡單列舉幾個常見情境:</p>
<ul>
<li>偵測指令的相容性,像是 script 是用 /bin/sh 執行,但卻使用到 bash 專屬特性</li>
<li>偵測有風險的操作,例如使用 pipe 特性時是否會有不穩定性</li>
</ul>
</div>
<div class="level is-mobile">
<div class="level-start">
<div class="level-item">
<a class="button is-size-7 is-light" href="/20190714-shellcheck-rules/#more">Read More</a>
</div>
</div>
</div>
</div>
</div>
<div class="card">
<div class="card-image">
<a href="/20190501-how-to-install-tig-and-ncurses-without-root-permission/" class="image is-7by1">
<img class="thumbnail" src="/20190501-how-to-install-tig-and-ncurses-without-root-permission/tig-main-view-screenshot.png" alt="How to Install Tig and Ncurses without root permission">
</a>
</div>
<div class="card-content article ">
<div class="level article-meta is-size-7 is-uppercase is-mobile is-overflow-x-auto">
<div class="level-left">
<time class="level-item has-text-grey" datetime="2019-05-01T00:00:00.000Z">2019-05-01</time>
<div class="level-item">
<a class="has-link-grey -link" href="/categories/Git/">Git</a>
</div>
</div>
</div>
<h1 class="title is-size-3 is-size-4-mobile has-text-weight-normal">
<a class="has-link-black-ter" href="/20190501-how-to-install-tig-and-ncurses-without-root-permission/">How to Install Tig and Ncurses without root permission</a>
</h1>
<div class="content">
<p>本文主要用來記錄如何在不使用 root 權限的前提下,在自己的家目錄裡安裝 <a href="https://www.gnu.org/software/ncurses/" title="GNU Ncurses" target="_blank" rel="noopener">GNU Ncurses</a> 函式並編譯 <a href="https://github.com/jonas/tig" title="Text-mode interface for Git" target="_blank" rel="noopener">Tig</a> 指令工具,讓編譯好的 <a href="https://github.com/jonas/tig" title="Text-mode interface for Git" target="_blank" rel="noopener">Tig</a> 指令能夠正常顯示中文。</p>
<h3 id="Tig-Text-mode-interface-for-Git"><a href="#Tig-Text-mode-interface-for-Git" class="headerlink" title="Tig: Text-mode interface for Git"></a><a href="https://github.com/jonas/tig" title="Text-mode interface for Git" target="_blank" rel="noopener">Tig: Text-mode interface for Git</a></h3><p><a href="https://github.com/jonas/tig" title="Text-mode interface for Git" target="_blank" rel="noopener">Tig</a> 是個非常實用的 command line 工具,它提供一個 Text-mode Interface (TUI) 讓你能夠在 Terminal 裡透過類似 GUI 的介面進行操作與瀏覽 Git Repository,安裝方式在<a href="https://jonas.github.io/tig/INSTALL.html" title="Tig Installation" target="_blank" rel="noopener">官方文件</a>裡寫得很清楚也很簡單,但是當你沒有 root 權限去使用 apt 之類的套件管理工具時就變得相對麻煩,不僅需要下載 <a href="https://github.com/jonas/tig" title="Text-mode interface for Git" target="_blank" rel="noopener">Tig</a> 原始碼來重新編譯為指令,且編譯環境還必須事先安裝好 <a href="https://www.gnu.org/software/ncurses/" title="GNU Ncurses" target="_blank" rel="noopener">GNU Ncurses</a> 函式庫,才能讓編譯好的 <a href="https://github.com/jonas/tig" title="Text-mode interface for Git" target="_blank" rel="noopener">Tig</a> 指令支援正常顯示中文!</p>
</div>
<div class="level is-mobile">
<div class="level-start">
<div class="level-item">
<a class="button is-size-7 is-light" href="/20190501-how-to-install-tig-and-ncurses-without-root-permission/#more">Read More</a>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="column is-4-tablet is-4-desktop is-4-widescreen has-order-1 column-left ">
<div class="card widget">
<div class="card-content">
<nav class="level">
<div class="level-item has-text-centered">
<div>
<figure class="image is-128x128 has-mb-6">
<img class="is-rounded" src="https://www.gravatar.com/avatar/4e68890b4e9c7905b29023df131e5f51?s=128" alt="Eden Tsai">
</figure>
<p class="is-size-4 is-block">
Eden Tsai
</p>
<p class="is-size-6 is-block">
Backend Engineer
</p>
<p class="is-size-6 is-flex is-flex-center has-text-grey">
<i class="fas fa-map-marker-alt has-mr-7"></i>
<span>Taiwan</span>
</p>
</div>
</div>
</nav>
<nav class="level is-mobile">
<div class="level-item has-text-centered is-marginless">
<div>
<p class="heading">
Posts
</p>
<p class="title has-text-weight-normal">
2
</p>
</div>
</div>
<div class="level-item has-text-centered is-marginless">
<div>
<p class="heading">
Categories
</p>
<p class="title has-text-weight-normal">
2
</p>
</div>
</div>
<div class="level-item has-text-centered is-marginless">
<div>
<p class="heading">
Tags
</p>
<p class="title has-text-weight-normal">
4
</p>
</div>
</div>
</nav>
<div class="level">
<a class="level-item button is-link is-rounded" href="https://github.com/edentsai" target="_blank">
Follow</a>
</div>
<div class="level is-mobile">
<a class="level-item button is-white is-marginless" target="_blank" title="Github" href="https://github.com/edentsai">
<i class="fab fa-github"></i>
</a>
<a class="level-item button is-white is-marginless" target="_blank" title="Twitter" href="https://twitter.com/edentsai231">
<i class="fab fa-twitter"></i>
</a>
<a class="level-item button is-white is-marginless" target="_blank" title="Facebook" href="https://www.facebook.com/edentsai231">
<i class="fab fa-facebook"></i>
</a>
<a class="level-item button is-white is-marginless" target="_blank" title="RSS" href="/atom.xml">
<i class="fas fa-rss"></i>
</a>
</div>
</div>
</div>
<div class="card widget">
<div class="card-content">
<h3 class="menu-label">
Recent
</h3>
<article class="media">
<a href="/20190714-shellcheck-rules/" class="media-left">
<p class="image is-64x64">
<img class="thumbnail" src="/images/thumbnail.svg" alt="Table of Shellcheck Rules">
</p>
</a>
<div class="media-content">
<div class="content">
<div><time class="has-text-grey is-size-7 is-uppercase" datetime="2019-07-13T16:00:00.000Z">2019-07-14</time></div>
<a href="/20190714-shellcheck-rules/" class="has-link-black-ter is-size-6">Table of Shellcheck Rules</a>
<p class="is-size-7 is-uppercase">
<a class="has-link-grey -link" href="/categories/Shell/">Shell</a>
</p>
</div>
</div>
</article>
<article class="media">
<a href="/20190501-how-to-install-tig-and-ncurses-without-root-permission/" class="media-left">
<p class="image is-64x64">
<img class="thumbnail" src="/20190501-how-to-install-tig-and-ncurses-without-root-permission/tig-main-view-screenshot.png" alt="How to Install Tig and Ncurses without root permission">
</p>
</a>
<div class="media-content">
<div class="content">
<div><time class="has-text-grey is-size-7 is-uppercase" datetime="2019-05-01T00:00:00.000Z">2019-05-01</time></div>
<a href="/20190501-how-to-install-tig-and-ncurses-without-root-permission/" class="has-link-black-ter is-size-6">How to Install Tig and Ncurses without root permission</a>
<p class="is-size-7 is-uppercase">
<a class="has-link-grey -link" href="/categories/Git/">Git</a>
</p>
</div>
</div>
</article>
</div>
</div>
<div class="card widget">
<div class="card-content">
<div class="menu">
<h3 class="menu-label">
Tags
</h3>
<div class="field is-grouped is-grouped-multiline">
<div class="control">
<a class="tags has-addons" href="/tags/Git/">
<span class="tag">Git</span>
<span class="tag is-grey">1</span>
</a>
</div>
<div class="control">
<a class="tags has-addons" href="/tags/Linux/">
<span class="tag">Linux</span>
<span class="tag is-grey">2</span>
</a>
</div>
<div class="control">
<a class="tags has-addons" href="/tags/Shell/">
<span class="tag">Shell</span>
<span class="tag is-grey">1</span>
</a>
</div>
<div class="control">
<a class="tags has-addons" href="/tags/Terminal/">
<span class="tag">Terminal</span>
<span class="tag is-grey">2</span>
</a>
</div>
</div>
</div>
</div>
</div>
<div class="card widget">
<div class="card-content">
<div class="menu">
<h3 class="menu-label">
Categories
</h3>
<ul class="menu-list">
<li>
<a class="level is-marginless" href="/categories/Git/">
<span class="level-start">
<span class="level-item">Git</span>
</span>
<span class="level-end">
<span class="level-item tag">1</span>
</span>
</a></li><li>
<a class="level is-marginless" href="/categories/Shell/">
<span class="level-start">
<span class="level-item">Shell</span>
</span>
<span class="level-end">
<span class="level-item tag">1</span>
</span>
</a></li>
</ul>
</div>
</div>
</div>
<div class="card widget">
<div class="card-content">
<div class="menu">
<h3 class="menu-label">
Archives
</h3>
<ul class="menu-list">
<li>
<a class="level is-marginless" href="/archives/2019/07/">
<span class="level-start">
<span class="level-item">July 2019</span>
</span>
<span class="level-end">
<span class="level-item tag">1</span>
</span>
</a>
</li>
<li>
<a class="level is-marginless" href="/archives/2019/05/">
<span class="level-start">
<span class="level-item">May 2019</span>
</span>
<span class="level-end">
<span class="level-item tag">1</span>
</span>
</a>
</li>
</ul>
</div>
</div>
</div>
<div class="column-right-shadow is-hidden-widescreen ">
</div>
</div>
</div>
</div>
</section>
<footer class="footer">
<div class="container">
<div class="level">
<div class="level-start has-text-centered-mobile">
<a class="footer-logo is-block has-mb-6" href="/">
<img src="/images/logo-eden.png" alt="Eden Tsai" height="28">
</a>
<p class="is-size-7">
© 2019 Eden Tsai
Powered by <a href="https://hexo.io/" target="_blank">Hexo</a> & <a href="https://github.com/ppoffice/hexo-theme-icarus" target="_blank">Icarus</a>
</p>
</div>
<div class="level-end">
<div class="field has-addons is-flex-center-mobile has-mt-5-mobile is-flex-wrap is-flex-middle">
<p class="control">
<a class="button is-white is-large" target="_blank" title="GitHub" href="https://github.com/edentsai">
<i class="fab fa-github"></i>
</a>
</p>
</div>
</div>
</div>
</div>
</footer>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/min/moment-with-locales.min.js"></script>
<script>moment.locale("en");</script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/lightgallery.min.js" defer></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/jquery.justifiedGallery.min.js" defer></script>
<script src="/js/gallery.js" defer></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/unpacked/MathJax.js?config=TeX-MML-AM_CHTML" defer></script>
<script>
document.addEventListener('DOMContentLoaded', function () {
MathJax.Hub.Config({
'HTML-CSS': {
matchFontHeight: false
},
SVG: {
matchFontHeight: false
},
CommonHTML: {
matchFontHeight: false
},
tex2jax: {
inlineMath: [
['$','$'],
['\\(','\\)']
]
}
});
});
</script>
<a id="back-to-top" title="Back to Top" href="javascript:;">
<i class="fas fa-chevron-up"></i>
</a>
<script src="/js/back-to-top.js" defer></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/clipboard.min.js" defer></script>
<script src="/js/clipboard.js" defer></script>
<script src="/js/main.js" defer></script>
<div class="searchbox ins-search">
<div class="searchbox-container ins-search-container">
<div class="searchbox-input-wrapper">
<input type="text" class="searchbox-input ins-search-input" placeholder="Type something...">
<span class="searchbox-close ins-close ins-selectable"><i class="fa fa-times-circle"></i></span>
</div>
<div class="searchbox-result-wrapper ins-section-wrapper">
<div class="ins-section-container"></div>
</div>
</div>
</div>
<script>
(function (window) {
var INSIGHT_CONFIG = {
TRANSLATION: {
POSTS: 'Posts',
PAGES: 'Pages',
CATEGORIES: 'Categories',
TAGS: 'Tags',
UNTITLED: '(Untitled)',
},
CONTENT_URL: '/content.json',
};
window.INSIGHT_CONFIG = INSIGHT_CONFIG;
})(window);
</script>
<script src="/js/insight.js" defer></script>
<link rel="stylesheet" href="/css/search.css">
<link rel="stylesheet" href="/css/insight.css">
</body>
</html>