-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
572 lines (437 loc) · 16.5 KB
/
index.html
File metadata and controls
572 lines (437 loc) · 16.5 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="google-site-verification" content="HUq9zIqmlLMHO-Ns9tEu6drasagknezrT2z0ispbmA8" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="精于心 简于形">
<meta name="keywords" content="">
<meta name="theme-color" content="#000000">
<title>Archfish | Blog</title>
<!-- Web App Manifest -->
<link rel="manifest" href="/pwa/manifest.json">
<!-- Favicon -->
<link rel="shortcut icon" href="/img/favicon.ico">
<!-- Canonical URL -->
<link rel="canonical" href="https://archfish.top/">
<!-- Bootstrap Core CSS -->
<link rel="stylesheet" href="/css/bootstrap.min.css">
<!-- Custom CSS -->
<link rel="stylesheet" href="/css/archfish.min.css">
<!-- Pygments Github CSS -->
<link rel="stylesheet" href="/css/syntax.css">
<!-- Custom Fonts -->
<!-- <link href="http://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css" rel="stylesheet" type="text/css"> -->
<!-- Change font-awesome CDN to qiniu -->
<link href="//cdnjs.cloudflare.com/ajax/libs/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet" type="text/css">
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
<!-- ga & ba script hoook -->
<!-- <script></script> -->
</head>
<!-- hack iOS CSS :active style -->
<body ontouchstart="">
<!-- Navigation -->
<nav class="navbar navbar-default navbar-custom navbar-fixed-top">
<div class="container-fluid">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header page-scroll">
<button type="button" class="navbar-toggle">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div id="blog_navbar">
<div class="navbar-collapse">
<ul class="nav navbar-nav navbar-right">
<li>
<a href="/">Home</a>
</li>
<li>
<a href="/about/">About</a>
</li>
<li>
<a href="/portfolio/">Portfolio</a>
</li>
<li>
<a href="/tags/">Tags</a>
</li>
</ul>
</div>
</div>
<!-- /.navbar-collapse -->
</div>
<!-- /.container -->
</nav>
<script>
// Drop Bootstarp low-performance Navbar
// Use customize navbar with high-quality material design animation
// in high-perf jank-free CSS3 implementation
var $body = document.body;
var $toggle = document.querySelector('.navbar-toggle');
var $navbar = document.querySelector('#blog_navbar');
var $collapse = document.querySelector('.navbar-collapse');
var __Nav__ = {
close: function(){
$navbar.className = " ";
// wait until animation end.
setTimeout(function(){
// prevent frequently toggle
if($navbar.className.indexOf('in') < 0) {
$collapse.style.height = "0px"
}
},400)
},
open: function(){
$collapse.style.height = "auto"
$navbar.className += " in";
}
}
// Bind Event
$toggle.addEventListener('click', function(e){
if ($navbar.className.indexOf('in') > 0) {
__Nav__.close()
}else{
__Nav__.open()
}
})
/**
* Since Fastclick is used to delegate 'touchstart' globally
* to hack 300ms delay in iOS by performing a fake 'click',
* Using 'e.stopPropagation' to stop 'touchstart' event from
* $toggle/$collapse will break global delegation.
*
* Instead, we use a 'e.target' filter to prevent handler
* added to document close Nav.
*
* Also, we use 'click' instead of 'touchstart' as compromise
*/
document.addEventListener('click', function(e){
if(e.target == $toggle) return;
if(e.target.className == 'icon-bar') return;
__Nav__.close();
})
</script>
<!-- Page Header -->
<header class="intro-header" style="background-image: url('/img/home-bg.jpg')">
<div class="container">
<div class="row">
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1 ">
<div class="site-heading">
<h1>韦初一的小窝</h1>
<!--<hr class="small">-->
<span class="subheading">精于心 简于形</span>
</div>
</div>
</div>
</div>
</header>
<!-- Main Content -->
<div class="container">
<div class="row">
<!-- USE SIDEBAR -->
<!-- PostList Container -->
<div class="
col-lg-8 col-lg-offset-1
col-md-8 col-md-offset-1
col-sm-12
col-xs-12
postlist-container
">
<div class="post-preview">
<a href="/2019/04/14/rails_postgresql_adapter_with_postgis/">
<h2 class="post-title">
Rails use postgresql-adapter to compute postgis
</h2>
<h3 class="post-subtitle">
老版本rails(4.1)项目的福音
</h3>
<div class="post-content-preview">
rails中每种数据库都有自己的adapter,这些adapter负责处理数据库的各种数据类型,但是设计上无法自行增加新数据类型。使用postgis功能通常使用的是active-record-postgis-adapter,由于Reocar使用的功能仅仅是计算坐标点间的距离,增加这样一层适配器会导致应用结构变得复杂,同时也可能会引入新的问题。在实现现有功能的情况下尝试移除active-rec...
</div>
</a>
<p class="post-meta">
Posted by Archfish on 2019-04-14
</p>
</div>
<hr>
<div class="post-preview">
<a href="/2019/04/13/macos_brew_manage_multiple_ruby_versions/">
<h2 class="post-title">
macOS使用brew安装用户级ruby
</h2>
<h3 class="post-subtitle">
通过简单的脚本即可实现多版本管理
</h3>
<div class="post-content-preview">
系统自带了一个ruby,但是这个ruby是保存在系统库中的,如果需要安装gem则会提示无权限You don't have write permissions for the /Library/Ruby/Gems/2.3 directory.。那么rvm呢,这货在安装ruby-2.3版本的时候总会出现openssl问题。
所以使用brew来安装一个user级的ruby,并通过简单脚本实现ru...
</div>
</a>
<p class="post-meta">
Posted by Archfish on 2019-04-13
</p>
</div>
<hr>
<div class="post-preview">
<a href="/2019/01/10/ruby-on-rails-containerization-03/">
<h2 class="post-title">
Ruby on Rails容器化实践(二点一)
</h2>
<h3 class="post-subtitle">
适用于编译时有大量依赖的情况,基于Debian
</h3>
<div class="post-content-preview">
这是Ruby on Rails容器化实践(二) - Archfish | Blog的简化版。
大致流程
确定程序运行依赖
从正常跑的环境找一个服务进程,获取其PID后,获取需要依赖的库,并记录下来。以下流程以MacOS环境来举例(懒癌晚期),在Linux环境中依赖为.so。
➜ ~ ps aux | grep rails
weihl 99276 0.0 ...
</div>
</a>
<p class="post-meta">
Posted by Archfish on 2019-01-10
</p>
</div>
<hr>
<div class="post-preview">
<a href="/2018/08/20/ruby-on-rails-containerization-02/">
<h2 class="post-title">
Ruby on Rails容器化实践(二)
</h2>
<h3 class="post-subtitle">
基于Alpine的最小Docker镜像打包脚本
</h3>
<div class="post-content-preview">
镜像的大小对容器运行资源占用并没有什么太大影响,多层次的镜像结构使得相同layout在每台docker主机上都是唯一一份,即Docker Images共享相同layout。选择alpine只是因为它易于使用且相关软件包都比较新。本文使用三个Dockerfile来分别处理Rails打包的三个阶段。
运行时镜像
即把Rails编译完成后的文件拷贝到该镜像上应当可以正常运行,无依赖问题。这里首...
</div>
</a>
<p class="post-meta">
Posted by Archfish on 2018-08-20
</p>
</div>
<hr>
<div class="post-preview">
<a href="/2018/08/16/vs-code-golang-dev/">
<h2 class="post-title">
Golang开发环境搭建(vs code)
</h2>
<h3 class="post-subtitle">
带梯子和不带梯子两个版本
</h3>
<div class="post-content-preview">
组织项目
许多从其它语言转到golang的可能都会有一个疑问:GOPATH是什么?官方的wiki是这样说的:
The GOPATH environment variable specifies the location of your workspace.
即GOPATH指向一个工作区,可类比到Linux的文件系统,系统只能访问根(/)下的文件,而根之上是什么就不是系统管理的范...
</div>
</a>
<p class="post-meta">
Posted by Archfish on 2018-08-16
</p>
</div>
<hr>
<div class="post-preview">
<a href="/2018/08/14/carrierwave-with-s3-api/">
<h2 class="post-title">
Ruby on Rails文件存储整合S3 API
</h2>
<h3 class="post-subtitle">
存储对应用透明,存储升级扩容更灵活
</h3>
<div class="post-content-preview">
在项目初期我们将一台服务器插满硬盘并提供NFS服务挂载到各业务服务器上。业务产生的文件分为两类,一类是涉及隐私的敏感文件,另一类是可公开访问的普通文件。普通文件需要对接CDN以降低服务器带宽压力。敏感文件只能在相应业务使用到时才能访问,通常是先加载到内存然后再嵌入页面或Base64编码后通过JSON返回给前端。
在业务系统中使用CarrierWave作为文件上传管理组件,部分图片相关业务需...
</div>
</a>
<p class="post-meta">
Posted by Archfish on 2018-08-14
</p>
</div>
<hr>
<div class="post-preview">
<a href="/2018/08/13/ruby-on-rails-containerization-01/">
<h2 class="post-title">
Ruby on Rails容器化实践(一)
</h2>
<h3 class="post-subtitle">
多环境服务架构设计
</h3>
<div class="post-content-preview">
为了方便新功能的开发和对接Reocar的Staging环境从1个变成了8个,其中7个是用于新需求测试和第三方渠道对接,还有一个是预发布环境。
初代测试环境使用了基于KVM技术的虚拟机技术,对外需要占用一个公网IP。随着团队扩张,测试环境也跟着扩展到两个,这时公网IP的80端口已经被占用了,只能另外开端口进行服务。于是开启了测试环境的混沌时代,每增加一个环境就新增一组域名和端口,当增加到第三...
</div>
</a>
<p class="post-meta">
Posted by Archfish on 2018-08-13
</p>
</div>
<hr>
<div class="post-preview">
<a href="/2018/08/12/rails-logger-wrap/">
<h2 class="post-title">
Rails日志组件封装
</h2>
<h3 class="post-subtitle">
基于Ruby logger二次封装
</h3>
<div class="post-content-preview">
在原始的单体应用中,日志通常直接输出到文件,然后由crontab中的定时任务做日志切分。再进一步,可能会有ELK系统收集分析。ELK只能对格式化的日志进行处理,对于无规则的日志只能作为字符串处理。Rails默认日志并不够简洁,对ELK来说处理难度略大。
结构
日志主要处理“谁在什么时间做了什么事情”的问题,下面就按这个思维来分析到底要怎么设计日志格式。
谁
服务组件可能会有很多...
</div>
</a>
<p class="post-meta">
Posted by Archfish on 2018-08-12
</p>
</div>
<hr>
<div class="post-preview">
<a href="/2018/08/12/caching-with-rails/">
<h2 class="post-title">
Rails(4.1)中的缓存管理
</h2>
<h3 class="post-subtitle">
复杂业务场景下的缓存淘汰方案
</h3>
<div class="post-content-preview">
在rails中我们常用的有Rails#cache和IdentityCache这两种cache方式。在长期实践中发现了不少问题,于是我们研发了一个新的缓存组件CacheWorker。下面对这些组件进行大致介绍:
IdentityCache
这是一种ActiveRecord Caching组件,提供了若干读方法,通过after_commit回调对缓存进行淘汰,我们业务系统中使用的是Redis...
</div>
</a>
<p class="post-meta">
Posted by Archfish on 2018-08-12
</p>
</div>
<hr>
<!-- Pager -->
</div>
<!-- Sidebar Container -->
<div class="
col-lg-3 col-lg-offset-0
col-md-3 col-md-offset-0
col-sm-12
col-xs-12
sidebar-container
">
<!-- Featured Tags -->
<!-- Short About -->
<section class="visible-md visible-lg">
<hr><h5><a href="/about/">ABOUT ME</a></h5>
<div class="short-about">
<img src="/img/avatar-small.jpg" />
<p>For the next quantum leap<br>离开世界之前,一切都是过程</p>
</div>
</section>
<!-- Friends Blog -->
<h5>LINKS</h5>
<ul class="list-inline">
<li>
<a target="_blank" href="https://github.com/archfish">
<span class="fa-stack fa-lg clear">
<i class="fa fa-circle fa-stack-2x"></i>
<i class="fa fa-github fa-stack-1x fa-inverse"></i>
</span>
</a>
</li>
</ul>
</div>
</div>
</div>
<!-- Footer -->
<footer>
<div class="container">
<div class="row">
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
<p class="copyright text-muted">
Copyright © 韦初一的小窝 2019
<iframe
style="margin-left: 2px; margin-bottom:-5px;"
frameborder="0" scrolling="0" width="100px" height="20px"
src="https://ghbtns.com/github-btn.html?user=archfish&repo=archfish&type=star&count=true" >
</iframe>
</p>
</div>
</div>
</div>
</footer>
<!-- jQuery -->
<script src="/js/jquery.min.js "></script>
<!-- Bootstrap Core JavaScript -->
<!-- Currently, only navbar scroll-down effect at desktop still depends on this -->
<script src="/js/bootstrap.min.js "></script>
<!-- Custom Theme JavaScript -->
<script src="/js/archfish.min.js "></script>
<!-- Service Worker -->
<script src="/js/snackbar.js "></script>
<script src="/js/sw-registration.js "></script>
<!-- async load function -->
<script>
function async(u, c) {
var d = document, t = 'script',
o = d.createElement(t),
s = d.getElementsByTagName(t)[0];
o.src = u;
if (c) { o.addEventListener('load', function (e) { c(null, e); }, false); }
s.parentNode.insertBefore(o, s);
}
</script>
<!--
Because of the native support for backtick-style fenced code blocks
right within the Markdown is landed in Github Pages,
There is no need for Highlight.js.
- https://github.com/blog/2100-github-pages-now-faster-and-simpler-with-jekyll-3-0
- https://help.github.com/articles/creating-and-highlighting-code-blocks/
- https://github.com/jneen/rouge/wiki/list-of-supported-languages-and-lexers
-->
<!--
<script>
async("http://cdn.bootcss.com/highlight.js/8.6/highlight.min.js", function(){
hljs.initHighlightingOnLoad();
})
</script>
<link href="http://cdn.bootcss.com/highlight.js/8.6/styles/github.min.css" rel="stylesheet">
-->
<!-- jquery.tagcloud.js -->
<script>
// only load tagcloud.js in tag.html
if($('#tag_cloud').length !== 0){
async('/js/jquery.tagcloud.js',function(){
$.fn.tagcloud.defaults = {
//size: {start: 1, end: 1, unit: 'em'},
color: {start: '#bbbbee', end: '#0085a1'},
};
$('#tag_cloud a').tagcloud();
})
}
</script>
<!--fastClick.js -->
<script>
async("//cdnjs.cloudflare.com/ajax/libs/fastclick/1.0.6/fastclick.min.js", function(){
var $nav = document.querySelector("nav");
if($nav) FastClick.attach($nav);
})
</script>
<!-- Google Analytics -->
<!-- Baidu Tongji -->
<!-- Side Catalog -->
<!-- Multi-Lingual -->
<!-- Image to hack wechat -->
<img src="/img/icon_wechat.png" width="0" height="0" />
<!-- Migrate from head to bottom, no longer block render and still work -->
</body>
</html>