-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
837 lines (463 loc) · 45.5 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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<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="http://yunops.top/index.html">
<meta property="og:site_name" content="运维小站">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="运维小站">
<link rel="alternative" href="/atom.xml" title="运维小站" type="application/atom+xml">
<link rel="icon" href="/favicon.png">
<link rel="stylesheet" href="/css/style.css">
</head>
<body>
<div id="container">
<div class="left-col">
<div class="overlay"></div>
<div class="intrude-less">
<header id="header" class="inner">
<a href="/" class="profilepic">
<img lazy-src="http://tp4.sinaimg.cn/1305156863/180/1273894218/1" class="js-avatar">
</a>
<hgroup>
<h1 class="header-author"><a href="/">Amour</a></h1>
</hgroup>
<p class="header-subtitle">技术驱动运维自动化</p>
<div class="switch-btn">
<div class="icon">
<div class="icon-ctn">
<div class="icon-wrap icon-house" data-idx="0">
<div class="birdhouse"></div>
<div class="birdhouse_holes"></div>
</div>
<div class="icon-wrap icon-ribbon hide" data-idx="1">
<div class="ribbon"></div>
</div>
<div class="icon-wrap icon-me hide" data-idx="3">
<div class="user"></div>
<div class="shoulder"></div>
</div>
</div>
</div>
<div class="tips-box hide">
<div class="tips-arrow"></div>
<ul class="tips-inner">
<li>菜单</li>
<li>标签</li>
<li>关于我</li>
</ul>
</div>
</div>
<div class="switch-area">
<div class="switch-wrap">
<section class="switch-part switch-part1">
<nav class="header-menu">
<ul>
<li><a href="/">主页</a></li>
<li><a href="/tags/DB">数据库</a></li>
<li><a href="/tags/safe">网络安全</a></li>
<li><a href="/aboutme">关于我</a></li>
<li><a href="/tags/随笔">随笔</a></li>
</ul>
</nav>
<nav class="header-nav">
<div class="social">
<a class="github" target="_blank" href="https://github.com/qxking552" title="github">github</a>
<a class="weibo" target="_blank" href="http://weibo.com/yghack/" title="weibo">weibo</a>
<a class="mail" target="_blank" href="mailto:[email protected]" title="mail">mail</a>
</div>
</nav>
</section>
<section class="switch-part switch-part2">
<div class="widget tagcloud" id="js-tagcloud">
<a href="/tags/Crack/" style="font-size: 10px;">Crack</a> <a href="/tags/DB/" style="font-size: 10px;">DB</a> <a href="/tags/MAC/" style="font-size: 10px;">MAC</a> <a href="/tags/OPS/" style="font-size: 20px;">OPS</a> <a href="/tags/心情/" style="font-size: 10px;">心情</a>
</div>
</section>
<section class="switch-part switch-part3">
<div id="js-aboutme">一个对待技术热情的人…</div>
</section>
</div>
</div>
</header>
</div>
</div>
<div class="mid-col">
<nav id="mobile-nav">
<div class="overlay">
<div class="slider-trigger"></div>
<h1 class="header-author js-mobile-header hide">Amour</h1>
</div>
<div class="intrude-less">
<header id="header" class="inner">
<div class="profilepic">
<img lazy-src="http://tp4.sinaimg.cn/1305156863/180/1273894218/1" class="js-avatar">
</div>
<hgroup>
<h1 class="header-author">Amour</h1>
</hgroup>
<p class="header-subtitle">技术驱动运维自动化</p>
<nav class="header-menu">
<ul>
<li><a href="/">主页</a></li>
<li><a href="/tags/DB">数据库</a></li>
<li><a href="/tags/safe">网络安全</a></li>
<li><a href="/aboutme">关于我</a></li>
<li><a href="/tags/随笔">随笔</a></li>
<div class="clearfix"></div>
</ul>
</nav>
<nav class="header-nav">
<div class="social">
<a class="github" target="_blank" href="https://github.com/qxking552" title="github">github</a>
<a class="weibo" target="_blank" href="http://weibo.com/yghack/" title="weibo">weibo</a>
<a class="mail" target="_blank" href="mailto:[email protected]" title="mail">mail</a>
</div>
</nav>
</header>
</div>
</nav>
<div class="body-wrap">
<article id="post-php7.1.6-centos安装脚本" class="article article-type-post" itemscope itemprop="blogPost">
<div class="article-meta">
<a href="/2017/07/01/php7.1.6-centos安装脚本/" class="article-date">
<time datetime="2017-07-01T06:22:21.000Z" itemprop="datePublished">2017-07-01</time>
</a>
</div>
<div class="article-inner">
<input type="hidden" class="isFancy" />
<header class="article-header">
<h1 itemprop="name">
<a class="article-title" href="/2017/07/01/php7.1.6-centos安装脚本/">php7.1.6-centos安装脚本</a>
</h1>
</header>
<div class="article-entry" itemprop="articleBody">
<h5 id="操作系统">操作系统</h5><figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">system:centos 6.8</div></pre></td></tr></table></figure>
<h5 id="安装过程">安装过程</h5><figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div><div class="line">15</div><div class="line">16</div><div class="line">17</div><div class="line">18</div><div class="line">19</div><div class="line">20</div><div class="line">21</div><div class="line">22</div><div class="line">23</div><div class="line">24</div><div class="line">25</div><div class="line">26</div></pre></td><td class="code"><pre><div class="line">cat > /etc/yum.repos.d/epel.repo <<EOF</div><div class="line">[epel]</div><div class="line">name=Extra Packages for Enterprise Linux 6 - $basearch</div><div class="line">baseurl=http://centos.ustc.edu.cn/epel/6/$basearch</div><div class="line">#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=$basearch</div><div class="line">failovermethod=priority</div><div class="line">enabled=1</div><div class="line">gpgcheck=1</div><div class="line">gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6</div><div class="line">[epel-debuginfo]</div><div class="line">name=Extra Packages for Enterprise Linux 6 - $basearch - Debug</div><div class="line">baseurl=http://centos.ustc.edu.cn/epel/6/$basearch/debug</div><div class="line">#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-debug-6&arch=$basearch</div><div class="line">failovermethod=priority</div><div class="line">enabled=0</div><div class="line">gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6</div><div class="line">gpgcheck=1</div><div class="line">[epel-source]</div><div class="line">name=Extra Packages for Enterprise Linux 6 - $basearch - Source</div><div class="line">baseurl=http://centos.ustc.edu.cn/epel/6/SRPMS</div><div class="line">#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-source-6&arch=$basearch</div><div class="line">failovermethod=priority</div><div class="line">enabled=0</div><div class="line">gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6</div><div class="line">gpgcheck=1</div><div class="line">EOF</div></pre></td></tr></table></figure>
</div>
<div class="article-info article-info-index">
<div class="article-tag tagcloud">
<ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/OPS/">OPS</a></li></ul>
</div>
<div class="clearfix"></div>
</div>
</div>
</article>
<article id="post-mac ramdisk" class="article article-type-post" itemscope itemprop="blogPost">
<div class="article-meta">
<a href="/2017/06/18/mac ramdisk/" class="article-date">
<time datetime="2017-06-18T02:32:21.000Z" itemprop="datePublished">2017-06-18</time>
</a>
</div>
<div class="article-inner">
<input type="hidden" class="isFancy" />
<header class="article-header">
<h1 itemprop="name">
<a class="article-title" href="/2017/06/18/mac ramdisk/">mac ramdisk</a>
</h1>
</header>
<div class="article-entry" itemprop="articleBody">
<h5 id="操作系统">操作系统</h5><figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">MacOS Sierra 10.12.5</div></pre></td></tr></table></figure>
<h5 id="创建过程">创建过程</h5><figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div></pre></td><td class="code"><pre><div class="line">diskutil erasevolume HFS+ RamDisk `hdiutil attach -nomount ram://2097152`</div><div class="line">mkdir -p /Volumes/Ramdisk/Library/Developer/Xcode/DerivedData</div><div class="line">mkdir -p /Volumes/Ramdisk/Library/Caches/Google</div><div class="line">mkdir -p /Volumes/Ramdisk/Library/Caches/com.apple.Safari/fsCachedData</div><div class="line">rm -rf ~/Library/Caches/Google</div><div class="line">rm -rf ~/Library/Caches/com.apple.Safari</div><div class="line">rm -rf ~/Library/Developer/Xcode/DerivedData</div><div class="line">ln -s /Volumes/Ramdisk/Library/Caches/Google ~/Library/Caches/Google</div><div class="line">ln -s /Volumes/Ramdisk/Library/Caches/com.apple.Safari ~/Library/Caches/com.apple.Safari</div><div class="line">ln -s /Volumes/Ramdisk/Library/Developer/Xcode/ ~/Library/Developer/Xcode/DerivedData</div></pre></td></tr></table></figure>
<h5 id="备注">备注</h5><figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div></pre></td><td class="code"><pre><div class="line">ram://2097152 创建空间的大小,基本上做缓存的话1G足矣</div><div class="line">目录的问题,根据自己的需求去调整</div></pre></td></tr></table></figure>
</div>
<div class="article-info article-info-index">
<div class="article-tag tagcloud">
<ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/MAC/">MAC</a></li></ul>
</div>
<div class="clearfix"></div>
</div>
</div>
</article>
<article id="post-狗日的中年-姜文-转载" class="article article-type-post" itemscope itemprop="blogPost">
<div class="article-meta">
<a href="/2017/06/09/狗日的中年-姜文-转载/" class="article-date">
<time datetime="2017-06-09T14:34:24.000Z" itemprop="datePublished">2017-06-09</time>
</a>
</div>
<div class="article-inner">
<input type="hidden" class="isFancy" />
<header class="article-header">
<h1 itemprop="name">
<a class="article-title" href="/2017/06/09/狗日的中年-姜文-转载/">狗日的中年——姜文-转载</a>
</h1>
</header>
<div class="article-entry" itemprop="articleBody">
<p><img src="https://img3.yxlady.com/yl/UploadFiles_5361/20160129/20160129215641806.jpg" alt="jiangwen"></p>
<p>第一次进入社会工作,我19岁,在一个机械厂做体力活,每天像毛驴一样重复着围磨般的工作,那时候纠结我的最大人生困惑就是吃炒饭省钱还是吃炒面省钱。我的房东是个40岁左右的男人,每天四平八稳的睡到自然醒来,踱着方步把我们几个出租房检查一遍,接着就在大把富足的时间里打盹,喝茶,看天。更要命的,这狗日的居然早点就吃炖肉,香味像狗舌头一样撩涮着我的味觉。那时候,做梦都在盼望着我的40岁什么能到来,我也可以这样踱着方步在时光里浸润,那是一个多么向往年龄啊。</p>
<p>想不到一奔子就挖到中年,才发现中年碎了一地的烟火,中年是个卖笑的年龄,既要讨得老人的欢心,也要做好儿女的榜样,还要时刻关注老婆的脸色,不停迎合上司的心思。中年为了生计,脸面,房子车子票子不停周旋,后来就发现激情对中年人是一种浪费,梦想对于中年是一个牌坊,守得住忠烈,还要做得好婊子。 </p>
<p>中年是一场斗争,人斗不过命,命斗不过时间。多少当时觉得无法过去的坎儿,过上几年突然就风轻云淡了。我没见过一个人把另一个人恨一辈子的,更可怕的是忘记和不在乎,最后都败给了时间,再娇惯的贾宝玉也会遁入空门,再厉害的如来也敌不过妖精的不在乎,万能基督耶稣最后还是让十字架来安抚信徒,再威严的毛泽东还不是躺在那里让人排着队参观。 </p>
<p>禅宗讲,一花一世界,一叶一如来。什么年龄做什么事情,不能硬干,60岁的刘晓庆硬是要和30岁的范冰冰比美,不是找死,就是割肉。邓丽君之所以成为传说,就是和他同台的机会都不给你留过,才叫江湖。齐秦、罗大佑生生的把自己沦落成乡间交流会上的马戏团台柱子,得捯饬上一天才能唤醒曾经的故事,和时间死磕,败的只有传奇。与其逆流而上,不如随波逐流,这是对生命的敬畏。</p>
<p>中年是一道清茶。在觥筹之后,人散夜阑之时,一半妥协,一半坚守,两边都让一小步。妥协就成了从容,坚守就成了雅致。从容多了,就会豁达温存的体会一下怨恨之间的不舍以及市井里不精致却扎实亲切的活法。茶要慢品,多一些留白,多一些转身的空间,无声的流泪,抿嘴浅笑,都是一种风景。每段时光都是最好的经过,每个女人都有最美的时光。</p>
<p>中年可以深刻,但千万不要尖刻,看得开,千万别点破。那种咋咋呼呼的人,心中无比自卑才会如此丈八,我见过一种人,全世界没有他能上眼的人和事,语言的巨人,行动的矮子。丈量不见自己的人,他会用尖酸刻薄来过滤生活,终日郁郁寡欢,把日子过的跟太监似的,怎么能体会生活的跌宕起伏,潮涨潮落。一位医生朋友讲了一个笑话,说一日,有患者就诊,患者说,他半生讲究养身养生,没有一点不良爱好,百思不得其解,怎么老是百病缠身?后医生停顿了一会问:你抽烟不?不会。你喝酒不?不会。那你上嫖不?么有。后医生十分沉痛的说了一句:死个哇。看好有甚意义了?医生朋友说,这个世界,医生只能看病,绝对不能救命。这种把生活过的尖刻的人,除了送他奔死的节奏,再不知道如何安慰对待自己这么苛刻的人。</p>
<p>中年是一种满足。下雨有伞,炙热有阴凉,有二两小烧,一碟花生,接受寡妇暗送的秋波,指使光棍挑水,和讨吃子比富,跟一群闲人打五毛钱的麻将,是一种满足。打开微信朋友圈,一看王石邀你去爬山潘石屹请你喝茶,最近有点闲时间登登珠穆朗玛,租豪华游轮领着章子怡、巩俐去夏威夷晒太阳;喝上年份的红酒开始摇杯挂壁,开始收藏12个流失的兽头,有了自己的服装设计等等,也是一种满足。满足是快乐的密码,天天猴急猴急的攀比,除了让你失落失望失魂落魄别无他法。整天还沉浸在谁谁谁怎么就比我混得好?想当初他……这人充其量不是中年,是40岁以上而已。</p>
<p>中年是独处时候的沉默,是热闹时候的不正经,中年不是演讲中的”扬手是春,落手是秋”的轻描淡写,中年是生活场上的”扬手是打的,落手是掏钱”干净利索,在这一扬一落之间,把很多的细节都留给了自己。</p>
<p>中年是狗日的现实。当我们终于可以腰缠万贯时间的时候,才知道中年并不是我看到的表象,狗日的中年不仅消融掉我浓密的长发,也弄丢了我蓬勃的激情和梦想,有些时候,一觉醒来尽然忘记了很多重要的记忆。更要命的是孤独开始富得流油,忧伤也异常亢奋,唯一不变的是毛哥对我的冷若冰霜,也没有几间出租房让我每天检查。现在明白,人生的境界不是天天幸福,而是天天不烦。有一些思念和牵挂可以入梦,梦会绵长,有一些爱好可以入心,生活就会充实,有一两个人懂你的沉默黑夜就不会漫长,有一两个圈子可以分享,时间就会缓慢,没有爱好,时间就会无聊,没有兴趣,生活就会无味。人生不是竞走,用最快的速度到达终点,而忽略了一路的风景和喝彩,这不是中年。</p>
<p>中年不是摇滚,持续的愤怒和亢奋不会快乐,我见过一个斗士,每见一次,斗士都是一副忧国忧民的样子,这个社会仿佛没有一件让他可以称心的事情,鲁迅一般。人生活在极端,总会倾斜,特别是一个女人,忘记柔软等于慢性变态。中年也不是民谣,清新到忘记年龄,单纯到忽略世事,都是要不得的,不能跟生命较劲,弄好了就是刘晓庆,弄不好就成了刘胡兰。中年更不是学院派的民族唱法,千人一面,千人一声。登不上大雅的舞台,又不屑于乡野僻壤的原生态,活得活得就忘记了来路。中年更要懂得敬畏,敬畏生命,敬畏生活,敬畏阅历,敬畏年龄。中年应该有两种事应该尽量少干,一是用自己的嘴干扰别人的人生,二是靠别人的脑子思考自己的人生。</p>
</div>
<div class="article-info article-info-index">
<div class="article-tag tagcloud">
<ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/心情/">心情</a></li></ul>
</div>
<div class="clearfix"></div>
</div>
</div>
</article>
<article id="post-Nginx + Lua + Redis 实现灰度发布" class="article article-type-post" itemscope itemprop="blogPost">
<div class="article-meta">
<a href="/2017/03/01/Nginx + Lua + Redis 实现灰度发布/" class="article-date">
<time datetime="2017-03-01T10:50:00.000Z" itemprop="datePublished">2017-03-01</time>
</a>
</div>
<div class="article-inner">
<input type="hidden" class="isFancy" />
<header class="article-header">
<h1 itemprop="name">
<a class="article-title" href="/2017/03/01/Nginx + Lua + Redis 实现灰度发布/">Nginx + Lua + Redis 实现灰度发布</a>
</h1>
</header>
<div class="article-entry" itemprop="articleBody">
<h5 id="本方法可以实现根据用户id判断,是否分发到灰度环境">本方法可以实现根据用户id判断,是否分发到灰度环境</h5><h5 id="proxy_a,proxy_b根据实际需求调整">proxy_a,proxy_b根据实际需求调整</h5><h4 id="lua代码">lua代码</h4><figure class="highlight lua"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div><div class="line">15</div><div class="line">16</div><div class="line">17</div><div class="line">18</div><div class="line">19</div><div class="line">20</div><div class="line">21</div><div class="line">22</div><div class="line">23</div><div class="line">24</div><div class="line">25</div><div class="line">26</div><div class="line">27</div><div class="line">28</div><div class="line">29</div><div class="line">30</div><div class="line">31</div><div class="line">32</div><div class="line">33</div></pre></td><td class="code"><pre><div class="line"><span class="comment">--[[amour]]</span><span class="comment">--</span></div><div class="line"><span class="comment">--[[引入redis模块]]</span><span class="comment">--</span></div><div class="line"><span class="keyword">local</span> redis = <span class="built_in">require</span> <span class="string">"resty.redis"</span></div><div class="line"></div><div class="line"><span class="comment">--[[获取cookie为uid的浏览器数据]]</span><span class="comment">--</span></div><div class="line"><span class="keyword">local</span> uid, err = ngx.var.cookie_uid</div><div class="line"><span class="keyword">if</span> <span class="keyword">not</span> uid <span class="keyword">then</span></div><div class="line"> ngx.exec(<span class="string">"@proxy_b"</span>)</div><div class="line"> ngx.log(ngx.ERR, err)</div><div class="line"><span class="keyword">end</span></div><div class="line"></div><div class="line"><span class="comment">--[[链接redis获取数据]]</span><span class="comment">--</span></div><div class="line">redis:set_timeout(<span class="number">1000</span>)</div><div class="line"><span class="keyword">local</span> cache, err= redis.new()</div><div class="line">cache.connect(cache, <span class="string">'ip'</span>, <span class="string">'6379'</span>)</div><div class="line"><span class="keyword">if</span> <span class="keyword">not</span> cache <span class="keyword">then</span></div><div class="line"> ngx.exec(<span class="string">"@proxy_b"</span>)</div><div class="line"> ngx.log(ngx.ERR, err)</div><div class="line"><span class="keyword">end</span></div><div class="line"></div><div class="line"><span class="comment">--[[校对数据]]</span><span class="comment">--</span></div><div class="line"><span class="keyword">local</span> res, err = cache:get(<span class="string">"uid"</span>)</div><div class="line"><span class="keyword">if</span> <span class="keyword">not</span> res <span class="keyword">then</span></div><div class="line"> ngx.exec(<span class="string">"@proxy_b"</span>)</div><div class="line"> ngx.log(ngx.ERR, err)</div><div class="line"><span class="keyword">end</span></div><div class="line"></div><div class="line"><span class="keyword">local</span> regex = uid</div><div class="line"><span class="keyword">local</span> m = ngx.re.match(res, regex)</div><div class="line"><span class="keyword">if</span> m <span class="keyword">then</span></div><div class="line"> ngx.exec(<span class="string">"@proxy_a"</span>)</div><div class="line"> <span class="keyword">else</span> ngx.exec(<span class="string">"@proxy_b"</span>)</div><div class="line"><span class="keyword">end</span></div></pre></td></tr></table></figure>
<h4 id="nginx_配置">nginx 配置</h4><h5 id="配置分发信息">配置分发信息</h5><figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div></pre></td><td class="code"><pre><div class="line">upstream proxy_a {</div><div class="line"> server xxx.xxx.xxx.xxx:port;</div><div class="line">}</div><div class="line"></div><div class="line">upstream proxy_b {</div><div class="line"> server xxx.xxx.xxx.xxx:port;</div><div class="line">}</div></pre></td></tr></table></figure>
<h5 id="网站配置">网站配置</h5><figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div></pre></td><td class="code"><pre><div class="line">location @proxy_a {</div><div class="line"> proxy_pass http://proxy_a;</div><div class="line">}</div><div class="line"></div><div class="line">location @proxy_b {</div><div class="line"> proxy_pass http://proxy_b;</div><div class="line">}</div></pre></td></tr></table></figure>
</div>
<div class="article-info article-info-index">
<div class="article-tag tagcloud">
<ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/OPS/">OPS</a></li></ul>
</div>
<div class="clearfix"></div>
</div>
</div>
</article>
<article id="post-nginx-http2-安装脚本" class="article article-type-post" itemscope itemprop="blogPost">
<div class="article-meta">
<a href="/2017/02/04/nginx-http2-安装脚本/" class="article-date">
<time datetime="2017-02-04T02:22:21.000Z" itemprop="datePublished">2017-02-04</time>
</a>
</div>
<div class="article-inner">
<input type="hidden" class="isFancy" />
<header class="article-header">
<h1 itemprop="name">
<a class="article-title" href="/2017/02/04/nginx-http2-安装脚本/">nginx-http2-安装脚本</a>
</h1>
</header>
<div class="article-entry" itemprop="articleBody">
<h5 id="准备工作">准备工作</h5><figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div></pre></td><td class="code"><pre><div class="line">rpm -ivh http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm</div><div class="line">yum install nginx pecl pecl-devel -y</div></pre></td></tr></table></figure>
<h5 id="openssl-1-0-2k安装">openssl-1.0.2k安装</h5><figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div></pre></td><td class="code"><pre><div class="line">yum install zlib* gcc make</div><div class="line">wget https://www.openssl.org/source/openssl-1.0.2k.tar.gz</div><div class="line">tar zxf openssl-1.0.2k.tar.gz</div><div class="line">cd openssl-1.0.2k</div><div class="line">./config shared zlib</div><div class="line">make</div><div class="line">make install</div><div class="line">rm -rf /usr/bin/openssl</div><div class="line">rm -rf /usr/include/openssl</div><div class="line">ln -s /usr/local/ssl/bin/openssl /usr/bin/openssl</div><div class="line">ln -s /usr/local/ssl/include/openssl /usr/include/openssl</div><div class="line">echo “/usr/local/ssl/lib” >> /etc/ld.so.conf</div><div class="line">ldconfig -v</div></pre></td></tr></table></figure>
<h5 id="nginx编译安装">nginx编译安装</h5><figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div></pre></td><td class="code"><pre><div class="line">wget http://nginx.org/download/nginx-1.12.0.tar.gz</div><div class="line">tar zxvf nginx-1.12.0.tar.gz</div><div class="line">cd nginx-1.12.0</div><div class="line">./configure --prefix=/etc/nginx --sbin-path=/usr/sbin/nginx --modules-path=/usr/lib64/nginx/modules --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --pid-path=/var/run/nginx.pid --lock-path=/var/run/nginx.lock --http-client-body-temp-path=/var/cache/nginx/client_temp --http-proxy-temp-path=/var/cache/nginx/proxy_temp --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp --http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp --http-scgi-temp-path=/var/cache/nginx/scgi_temp --user=nginx --group=nginx --with-compat --with-file-aio --with-threads --with-http_addition_module --with-http_auth_request_module --with-http_dav_module --with-http_flv_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_mp4_module --with-http_random_index_module --with-http_realip_module --with-http_secure_link_module --with-http_slice_module --with-http_ssl_module --with-http_stub_status_module --with-http_sub_module --with-http_v2_module --with-mail --with-mail_ssl_module --with-stream --with-stream_realip_module --with-stream_ssl_module --with-stream_ssl_preread_module --with-cc-opt='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fPIC' --with-ld-opt='-Wl,-z,relro -Wl,-z,now -pie' --with-openssl=/opt/down/openssl-1.0.2h/ --with-cc-opt=-m64 --with-ld-opt=-m64</div><div class="line">make</div><div class="line">make install</div></pre></td></tr></table></figure>
</div>
<div class="article-info article-info-index">
<div class="article-tag tagcloud">
<ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/OPS/">OPS</a></li></ul>
</div>
<div class="clearfix"></div>
</div>
</div>
</article>
<article id="post-MySQL数据字典生成" class="article article-type-post" itemscope itemprop="blogPost">
<div class="article-meta">
<a href="/2016/12/22/MySQL数据字典生成/" class="article-date">
<time datetime="2016-12-22T14:20:21.000Z" itemprop="datePublished">2016-12-22</time>
</a>
</div>
<div class="article-inner">
<input type="hidden" class="isFancy" />
<header class="article-header">
<h1 itemprop="name">
<a class="article-title" href="/2016/12/22/MySQL数据字典生成/">MySQL数据字典生成</a>
</h1>
</header>
<div class="article-entry" itemprop="articleBody">
<h5 id="操作系统">操作系统</h5><figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div></pre></td><td class="code"><pre><div class="line">system:centos 6.8</div><div class="line">mysql:mysql 5.7.11</div></pre></td></tr></table></figure>
<h5 id="实现过程">实现过程</h5><figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div><div class="line">15</div><div class="line">16</div><div class="line">17</div><div class="line">18</div><div class="line">19</div><div class="line">20</div><div class="line">21</div><div class="line">22</div><div class="line">23</div></pre></td><td class="code"><pre><div class="line">select distinct a.TABLE_SCHEMA as '数据库' ,</div><div class="line">a.TABLE_NAME as '表名',</div><div class="line">a.COLUMN_NAME as '字段名',</div><div class="line">a.COLUMN_TYPE as '类型长度',</div><div class="line">case when a.IS_NULLABLE='yes' then '√'else '' end as '允许空值',</div><div class="line">case when a.COLUMN_DEFAULT='' then '""' else a.COLUMN_DEFAULT end as '默认值',</div><div class="line">a.CHARACTER_SET_NAME as '字符集',</div><div class="line">a.COLLATION_NAME as '整理',</div><div class="line">a.EXTRA as '自动递增',</div><div class="line">case when b.CONSTRAINT_NAME='PRIMARY' then 'PRIMARY' else '' end as '主键',</div><div class="line">c.CONSTRAINT_NAME as '外键名',</div><div class="line">c.REFERENCED_TABLE_NAME as '关联父表',</div><div class="line">c.REFERENCED_COLUMN_NAME as '父表字段',</div><div class="line">d. CONSTRAINT_NAME as '索引名称'</div><div class="line">from INFORMATION_SCHEMA.COLUMNS as a</div><div class="line">left join (select CONSTRAINT_NAME,TABLE_NAME table_name2,COLUMN_NAME col_name2 from INFORMATION_SCHEMA .KEY_COLUMN_USAGE where CONSTRAINT_NAME='PRIMARY' and table_name like 'idsm%') as b</div><div class="line">on a.TABLE_NAME=b.table_name2 and a.COLUMN_NAME=b.col_name2</div><div class="line">left join (select CONSTRAINT_NAME,REFERENCED_TABLE_NAME,REFERENCED_COLUMN_NAME,TABLE_NAME table_name3,COLUMN_NAME col_name3 from INFORMATION_SCHEMA .KEY_COLUMN_USAGE where REFERENCED_COLUMN_NAME!='' and table_name like 'idsm%') as c</div><div class="line">on a.TABLE_NAME=c.table_name3 and a.COLUMN_NAME=c.col_name3</div><div class="line">left join (select CONSTRAINT_NAME,REFERENCED_TABLE_NAME,REFERENCED_COLUMN_NAME,TABLE_NAME table_name4,COLUMN_NAME col_name4 from INFORMATION_SCHEMA .KEY_COLUMN_USAGE where REFERENCED_COLUMN_NAME is null and CONSTRAINT_NAME!='PRIMARY' and table_name like 'idsm%')</div><div class="line">as d</div><div class="line">on a.TABLE_NAME=d.table_name4 and a.COLUMN_NAME=d.col_name4</div><div class="line">where table_name like 'idsm%'</div></pre></td></tr></table></figure>
<h5 id="备注">备注</h5><figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">运行的时候请注意where条件</div></pre></td></tr></table></figure>
</div>
<div class="article-info article-info-index">
<div class="article-tag tagcloud">
<ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/DB/">DB</a></li></ul>
</div>
<div class="clearfix"></div>
</div>
</div>
</article>
<article id="post-beanstalkd性能监控脚本" class="article article-type-post" itemscope itemprop="blogPost">
<div class="article-meta">
<a href="/2016/07/04/beanstalkd性能监控脚本/" class="article-date">
<time datetime="2016-07-04T14:27:24.000Z" itemprop="datePublished">2016-07-04</time>
</a>
</div>
<div class="article-inner">
<input type="hidden" class="isFancy" />
<header class="article-header">
<h1 itemprop="name">
<a class="article-title" href="/2016/07/04/beanstalkd性能监控脚本/">beanstalkd性能监控脚本</a>
</h1>
</header>
<div class="article-entry" itemprop="articleBody">
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div><div class="line">15</div><div class="line">16</div><div class="line">17</div><div class="line">18</div><div class="line">19</div></pre></td><td class="code"><pre><div class="line">#!/bin/bash</div><div class="line">HOST=ip</div><div class="line">PORT=11300</div><div class="line">function urgent {</div><div class="line">echo -e "stats\r" | nc $HOST $PORT | grep 'current-jobs-urgent' | grep -E -o "[0-9]+"</div><div class="line">}</div><div class="line">function ready {</div><div class="line">echo -e "stats\r" | nc $HOST $PORT | grep 'current-jobs-ready' | grep -E -o "[0-9]+"</div><div class="line">}</div><div class="line">function reserved {</div><div class="line">echo -e "stats\r" | nc $HOST $PORT | grep 'current-jobs-reserved' | grep -E -o "[0-9]+"</div><div class="line">}</div><div class="line">function delayed {</div><div class="line">echo -e "stats\r" | nc $HOST $PORT | grep 'current-jobs-delayed' | grep -E -o "[0-9]+"</div><div class="line">}</div><div class="line">function buried {</div><div class="line">echo -e "stats\r" | nc $HOST $PORT | grep 'current-jobs-buried' | grep -E -o "[0-9]+"</div><div class="line">}</div><div class="line">$1</div></pre></td></tr></table></figure>
</div>
<div class="article-info article-info-index">
<div class="article-tag tagcloud">
<ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/OPS/">OPS</a></li></ul>
</div>
<div class="clearfix"></div>
</div>
</div>
</article>
<article id="post-phantomjs安装教程" class="article article-type-post" itemscope itemprop="blogPost">
<div class="article-meta">
<a href="/2016/05/01/phantomjs安装教程/" class="article-date">
<time datetime="2016-05-01T06:22:21.000Z" itemprop="datePublished">2016-05-01</time>
</a>
</div>
<div class="article-inner">
<input type="hidden" class="isFancy" />
<header class="article-header">
<h1 itemprop="name">
<a class="article-title" href="/2016/05/01/phantomjs安装教程/">phantomjs安装</a>
</h1>
</header>
<div class="article-entry" itemprop="articleBody">
<h5 id="操作系统">操作系统</h5><figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">system:centos 6.8</div></pre></td></tr></table></figure>
<h5 id="安装过程">安装过程</h5><figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div></pre></td><td class="code"><pre><div class="line">wget https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2</div><div class="line">tar jxvf phantomjs-2.1.1-linux-x86_64.tar.bz2</div><div class="line">mv phantomjs-2.1.1-linux-x86_64 /usr/local/src/phantomjs</div><div class="line">ln -sf /usr/local/src/phantomjs/bin/phantomjs /usr/bin/</div><div class="line">phantomjs -v</div></pre></td></tr></table></figure>
</div>
<div class="article-info article-info-index">
<div class="article-tag tagcloud">
<ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/OPS/">OPS</a></li></ul>
</div>
<div class="clearfix"></div>
</div>
</div>
</article>
<article id="post-linux下virtualbox命令" class="article article-type-post" itemscope itemprop="blogPost">
<div class="article-meta">
<a href="/2015/07/26/linux下virtualbox命令/" class="article-date">
<time datetime="2015-07-26T14:27:24.000Z" itemprop="datePublished">2015-07-26</time>
</a>
</div>
<div class="article-inner">
<input type="hidden" class="isFancy" />
<header class="article-header">
<h1 itemprop="name">
<a class="article-title" href="/2015/07/26/linux下virtualbox命令/">linux下virtualbox命令</a>
</h1>
</header>
<div class="article-entry" itemprop="articleBody">
<h4 id="查看当前虚拟机">查看当前虚拟机</h4><pre><code>VBxoManage <span class="type">list</span> vms
</code></pre><h4 id="查看当前正在运行的虚拟机">查看当前正在运行的虚拟机</h4><pre><code>VBoxManage <span class="type">list</span> runningvms
</code></pre><h4 id="启动虚拟机">启动虚拟机</h4><pre><code><span class="title">VBoxManage</span> startvm win2
</code></pre><h4 id="无前端图形界面方式启动虚拟机">无前端图形界面方式启动虚拟机</h4><pre><code>VBoxManage startvm win2 --<span class="class"><span class="keyword">type</span> <span class="title">headless</span></span>
</code></pre><h4 id="使用_VRDP_方式通过命令行启动虚拟机:_(3389)">使用 VRDP 方式通过命令行启动虚拟机: (3389)</h4><pre><code>VBoxManage startvm win2 --<span class="class"><span class="keyword">type</span> <span class="title">vrdp</span></span>
</code></pre>
</div>
<div class="article-info article-info-index">
<div class="article-tag tagcloud">
<ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/OPS/">OPS</a></li></ul>
</div>
<p class="article-more-link">
<a href="/2015/07/26/linux下virtualbox命令/#more">more >></a>
</p>
<div class="clearfix"></div>
</div>
</div>
</article>
<article id="post-nginx配置SSL双向认证" class="article article-type-post" itemscope itemprop="blogPost">
<div class="article-meta">
<a href="/2015/07/10/nginx配置SSL双向认证/" class="article-date">
<time datetime="2015-07-10T10:13:40.000Z" itemprop="datePublished">2015-07-10</time>
</a>
</div>
<div class="article-inner">
<input type="hidden" class="isFancy" />
<header class="article-header">
<h1 itemprop="name">
<a class="article-title" href="/2015/07/10/nginx配置SSL双向认证/">nginx配置SSL双向认证</a>
</h1>
</header>
<div class="article-entry" itemprop="articleBody">
<h4 id="1-安装nginx">1.安装nginx</h4><pre><code>rpm -ivh <span class="symbol">http:</span>/<span class="regexp">/nginx.org/packages</span><span class="regexp">/centos/</span><span class="number">6</span>/noarch/<span class="constant">RPMS/</span>nginx-release-centos-<span class="number">6</span>-<span class="number">0</span>.el6.ngx.noarch.rpm
yum install nginx
</code></pre><h4 id="2-配置openssl">2.配置openssl</h4><pre><code>vim /etc/pki/tls/openssl.cnf
[ req_distinguished_name ]
<span class="variable">countryName =</span> Country Name(<span class="number">2</span> letter code)
<span class="variable">countryName_default =</span> CN
<span class="variable">countryName_min =</span> <span class="number">2</span>
<span class="variable">countryName_max =</span> <span class="number">2</span>
<span class="variable">stateOrProvinceName =</span> State <span class="constant">or</span> Province Name (full name)
<span class="variable">stateOrProvinceName_default =</span> ZJ
<span class="variable">localityName =</span> Locality Name (eg, city)
<span class="variable">localityName_default =</span> HZ
<span class="number">0</span>.<span class="variable">organizationName =</span> Organization Name (eg, company)
<span class="number">0</span>.<span class="variable">organizationName_default =</span> Tech
<span class="variable">organizationalUnitName =</span> Organizational Unit Name (eg, section)
<span class="variable">organizationalUnitName_default =</span> Org
</code></pre><p>确保以上字段在证书,服务端证书,客户端证书一致。<br>
</div>
<div class="article-info article-info-index">
<div class="article-tag tagcloud">
<ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/OPS/">OPS</a></li></ul>
</div>
<p class="article-more-link">
<a href="/2015/07/10/nginx配置SSL双向认证/#more">more >></a>
</p>
<div class="clearfix"></div>
</div>
</div>
</article>
<nav id="page-nav">
<span class="page-number current">1</span><a class="page-number" href="/page/2/">2</a><a class="extend next" rel="next" href="/page/2/">Next »</a>
</nav>
</div>
<footer id="footer">
<div class="outer">
<div id="footer-info">
<div class="footer-left">
© 2017 Amour
</div>
<div class="footer-right">
<a href="http://hexo.io/" target="_blank">Hexo</a> Theme <a href="https://github.com/litten/hexo-theme-yilia" target="_blank">Yilia</a> by Litten
</div>
</div>
</div>
</footer>
</div>
<link rel="stylesheet" href="/fancybox/jquery.fancybox.css">
<script>
var yiliaConfig = {
fancybox: true,
mathjax: true,
animate: true,
isHome: true,
isPost: false,
isArchive: false,
isTag: false,
isCategory: false,
open_in_new: false
}
</script>
<script src="http://7.url.cn/edu/jslib/comb/require-2.1.6,jquery-1.9.1.min.js"></script>
<script src="/js/main.js"></script>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
tex2jax: {
inlineMath: [ ['$','$'], ["\\(","\\)"] ],
processEscapes: true,
skipTags: ['script', 'noscript', 'style', 'textarea', 'pre', 'code']
}
});
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="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
</script>
</div>
</body>
</html>