-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
973 lines (555 loc) · 35.7 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
<!DOCTYPE HTML>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<title>石头笔记</title>
<meta name="viewport" content="width=device-width, initial-scale=1,user-scalable=no">
<meta name="author" content="John Shi">
<meta name="description" content="学习,工作,生活">
<meta property="og:type" content="website">
<meta property="og:title" content="石头笔记">
<meta property="og:url" content="http://ideacaff.com/index.html">
<meta property="og:site_name" content="石头笔记">
<meta property="og:description" content="学习,工作,生活">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="石头笔记">
<meta name="twitter:description" content="学习,工作,生活">
<link rel="alternative" href="/atom.xml" title="石头笔记" type="application/atom+xml">
<link rel="icon" href="/img/favicon.ico">
<link rel="apple-touch-icon" href="/img/jacman.jpg">
<link rel="apple-touch-icon-precomposed" href="/img/jacman.jpg">
<link rel="stylesheet" href="/css/style.css">
</head>
<body>
<header>
<div>
<div id="imglogo">
<a href="/"><img src="/img/logo.png" alt="石头笔记" title="石头笔记"/></a>
</div>
<div id="textlogo">
<h1 class="site-name"><a href="/" title="石头笔记">石头笔记</a></h1>
<h2 class="blog-motto">学习,工作,生活</h2>
</div>
<div class="navbar"><a class="navbutton navmobile" href="#" title="菜单">
</a></div>
<nav class="animated">
<ul>
<ul>
<li><a href="/">Home</a></li>
<li><a href="/archives">Archives</a></li>
<li><a href="/about">About</a></li>
<li>
<form class="search" action="//google.com/search" method="get" accept-charset="utf-8">
<label>Search</label>
<input type="search" id="search" name="q" autocomplete="off" maxlength="20" placeholder="搜索" />
<input type="hidden" name="q" value="site:ideacaff.com">
</form>
</li>
</ul>
</nav>
</div>
</header>
<div id="container">
<div id="main">
<article class="post-expand post" itemprop="articleBody">
<header class="article-info clearfix">
<h1 itemprop="name">
<a href="/2016/09/05/todo-list/" title="todo list" itemprop="url">todo list</a>
</h1>
<p class="article-author">By
<a href="/about" title="John Shi" target="_blank" itemprop="author">John Shi</a>
<p class="article-time">
<time datetime="2016-09-05T15:15:58.000Z" itemprop="datePublished"> 发表于 2016-09-05</time>
</p>
</header>
<div class="article-content">
<p><img src="/img/technical_debt.png" alt=""></p>
<p class="article-more-link">
</p>
</div>
<footer class="article-footer clearfix">
<div class="article-catetags">
</div>
<div class="comments-count">
</div>
</footer>
</article>
<article class="post-expand post" itemprop="articleBody">
<header class="article-info clearfix">
<h1 itemprop="name">
<a href="/2016/09/04/myblog-hexo/" title="利用 hexo + github 搭建个人博客" itemprop="url">利用 hexo + github 搭建个人博客</a>
</h1>
<p class="article-author">By
<a href="/about" title="John Shi" target="_blank" itemprop="author">John Shi</a>
<p class="article-time">
<time datetime="2016-09-03T18:59:07.000Z" itemprop="datePublished"> 发表于 2016-09-04</time>
</p>
</header>
<div class="article-content">
<p>Hexo是一个开源的静态博客生成器, GitHub Pages免费的静态站点,利用两者可以方便搭建简单的个人博客。</p>
<h1 id="准备条件"><a href="#准备条件" class="headerlink" title="准备条件"></a>准备条件</h1><ol>
<li>hexo</li>
<li>git</li>
</ol>
<h2 id="安装-hexo"><a href="#安装-hexo" class="headerlink" title="安装 hexo"></a>安装 hexo</h2><ol>
<li>安装node.js</li>
<li>校验node.js </li>
</ol>
<figure class="highlight sh"><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">$ node -v</div><div class="line">$ npm -v</div></pre></td></tr></table></figure>
<ol>
<li>安装hexo</li>
</ol>
<figure class="highlight sh"><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">$ npm install hexo-cli -g</div><div class="line">$ npm install hexo --save</div><div class="line">$ hexo -v</div><div class="line">$ hexo init & npm install</div><div class="line">$ hexo g</div><div class="line">$ hexo s</div></pre></td></tr></table></figure>
<h2 id="安装-git"><a href="#安装-git" class="headerlink" title="安装 git"></a>安装 git</h2><h2 id="配置-config-yml"><a href="#配置-config-yml" class="headerlink" title="配置_config.yml"></a>配置_config.yml</h2><figure class="highlight javascript"><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></pre></td><td class="code"><pre><div class="line">deploy:</div><div class="line"> type: git</div><div class="line"> repo: git@github.com:yourname/yourname.github.io.git</div><div class="line"> branch: master</div></pre></td></tr></table></figure>
<h2 id="部署(上传)到github"><a href="#部署(上传)到github" class="headerlink" title="部署(上传)到github"></a>部署(上传)到github</h2><figure class="highlight sh"><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">$ npm install hexo-deployer-git --save</div><div class="line">$ hexo d</div></pre></td></tr></table></figure>
<p class="article-more-link">
</p>
</div>
<footer class="article-footer clearfix">
<div class="article-catetags">
<div class="article-categories">
<span></span>
<a class="article-category-link" href="/categories/其它/">其它</a>
</div>
<div class="article-tags">
<span></span> <a href="/tags/hexo/">hexo</a><a href="/tags/github/">github</a>
</div>
</div>
<div class="comments-count">
</div>
</footer>
</article>
<article class="post-expand post" itemprop="articleBody">
<header class="article-info clearfix">
<h1 itemprop="name">
<a href="/2016/04/16/dll-inject-virus/" title="DLL Inject Virus" itemprop="url">DLL Inject Virus</a>
</h1>
<p class="article-author">By
<a href="/about" title="John Shi" target="_blank" itemprop="author">John Shi</a>
<p class="article-time">
<time datetime="2016-04-16T06:33:11.000Z" itemprop="datePublished"> 发表于 2016-04-16</time>
</p>
</header>
<div class="article-content">
<p>DLL注入木马是目前网络上十分流行的木马形式,它就像是一个寄生虫,木马以DLL文件的形式,寄宿在某个重要的系统进程中,通过宿主来调用DLL文件,实现远程控制的功能。这样的木马嵌入到系统进程中可以穿越防火墙,更让人头疼的是,用杀毒软件进行查杀,杀软即使报警提示发现病毒,但是也无法杀掉木马病毒文件,因为木马DLL文件正被宿主调用而无法删除。下面我们把杀软放到一边,通过专用工具及其手工的方法来清除DLL木马。</p>
<h1 id="清除思路"><a href="#清除思路" class="headerlink" title="清除思路"></a>清除思路</h1><ul>
<li>通过系统工具及其第三方工具找到木马的宿主进程,然后定位到木马DLL文件。</li>
<li>结束被木马注入的进程。</li>
<li>删除木马文件。</li>
<li>注册表相关项的清除。</li>
</ul>
<h1 id="清除方法"><a href="#清除方法" class="headerlink" title="清除方法"></a>清除方法</h1><h2 id="第一步,清除DLL文件"><a href="#第一步,清除DLL文件" class="headerlink" title="第一步,清除DLL文件"></a>第一步,清除DLL文件</h2><h3 id="手工清除DLL"><a href="#手工清除DLL" class="headerlink" title="手工清除DLL"></a>手工清除DLL</h3><p>普通进程DLL注入木马的清除 有许多DLL木马是注入到“iexplore.exe”和“explorer.exe”这两个进程中的,对于注入这类普通进程的DLL木马是很好清除掉的。 如果DLL文件是注入到“iexplore.exe”进程中,此进程就是IE浏览进程,那么可以关掉所有IE窗口和相关程序,然后直接找到DLL文件进行删除就可以了。如果是注入到“explorer.exe”进程中,那么就略显麻烦一些,因为此进程是用于显示桌面和资源管理器的。当通过任务管理器结束掉“explorer.exe”进程时,桌面无法看破到,此时桌面上所有图标消失掉,“我的电脑”、“网上邻居”等所有图标都不见了,也无法打开资源管理器找到木马文件进行删除了。怎么办呢? 这时候可以在任务管理器中点击菜单“文件”→“新任务运行”,打开创建新任务对话框,点击“浏览”挖通过浏览对话框就可以打开DLL文件所在的路径。然后选择“文件类型”为“所有文件”,即可显示并删除DLL了 提示:如果你熟悉命令行(cmd.exe)的话,可以直接通过命令来清除,如:</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div></pre></td><td class="code"><pre><div class="line">$ taskkill /f /im explorer.exe del</div><div class="line">$ C:\\Windows\\System32\\test.dll</div><div class="line">$ start explorer.exe</div></pre></td></tr></table></figure>
<p>第一行是结束explorer.exe,第二行是删除木马文件test.dll,第三行是重启explorer.exe</p>
<h3 id="使用IceSword卸载DLL"><a href="#使用IceSword卸载DLL" class="headerlink" title="使用IceSword卸载DLL"></a>使用IceSword卸载DLL</h3><p>使用IceSword卸载DLL文件调用 如果木马是插入了“svchost.exe”之类的关键进程中,就不能指望进程管理器来结束进程了,可能需要一些附加的工具卸载掉某个DLL文件的调用。 IceSword的功能十分强大,可以利用它卸载掉已经插入到正在运行的系统进程中的DLL文件。在IceSword的进程列表显示窗口中,右键点击DLL木马宿主进程,选择弹出菜单中的“模块信息”命令打开DLL模块列表对话窗口。选择可疑的模块后,点击“卸载”按钮即可将DLL木马进程中删除掉了。 如果提示不能卸载的话,可以点击“强行解除”按钮,从进程中强行删除该DLL调用。这时候就可以从“模块文件名”栏中,得到DLL文件文件的路径,然后到文件夹中将DLL木马彻底删除掉。</p>
<h3 id="使用SSM工具阻止DLL加载"><a href="#使用SSM工具阻止DLL加载" class="headerlink" title="使用SSM工具阻止DLL加载"></a>使用SSM工具阻止DLL加载</h3><p>SSM终结所有DLL木马 许多木马都是注入到系统里关键进程中的,比如“svchost.exe”、“smss.exe”、“winlogon.exe”进程,这些进程使用普通方式无法结束,使用特殊工具结束掉进程或卸载掉进程中的DLL文件后,却又很可能造成系统崩溃无法正常运行等。例如一款著名的木马PCShare是注入“winlogon.exe”进程中的,该进程是掌握Windows登录的,在使用IceSword卸载时系统立刻异常重启,更本来不及清除dll文件,在重启后dll木马再次被加载。 对于这类dll木马,必须在进程运行之前阻止dll文件的加载。阻止dll文件加载要用到一个强大的安全工具“System Safety Monitor”(简称SSM)。SSM是由俄罗斯出品的一款系统监控软件,通过监视系统特定的文件和程序,达到保护系统安全的目的。这款软件功能非常强大,可以很好地配合防火墙和杀毒软件更好地保护系统的安全。 运行SSM,在程序界面中选择“规则”选项卡,右键点击中间规则列表空白处,选择“新增”命令。弹出文件浏览窗口,选择浏览文件类型为“库文件”,在其中选择指定文件路径“C:\Windows\system32\rejoice.dll”。确定后,即可将DLL木马文件添加到规则列表中,然后在界面下方的“规则”下拉列表中选择“阻止(F2) 添加规则设置完毕后,点击“应用设置”按钮,然后重启系统。在重启系统前要检查SSM的设置,保证SSM随系统启动而加载运行。当系统重启时,会自动阻止该进程调用rejoice.dll木马文件。由于木马文件没有任何进程调用,所以就可以直接删除了。 此外,我们还可以利用其它工具来清除DLL木马后门,例如Tiny Personnal Firewall 2005(TPF)防火墙的“balcklist”禁止运行功能等,清除的原理都是一样的,总之是在木马DLL文件被调用之前,阻止其被进程加载,从而达到结束木马进程并删除木马的目的。</p>
<h3 id="设置系统权限阻止DLL加载"><a href="#设置系统权限阻止DLL加载" class="headerlink" title="设置系统权限阻止DLL加载"></a>设置系统权限阻止DLL加载</h3><p>通过系统权限法来清除DLL木马 在Windows系统中,NTFS分区格式具有强大的文件限制设置功能,可以设置某个文件是否可以被程序调用访问等。通过这个功能,我们一样可以阻止木马调用相应的DLL文件,从而彻底地清除掉DLL木马文件。 双击打开“我的电脑”,点击菜单命令“工具”→“文件夹选项”→“查看”,在高级设置的选项卡下去掉“简单文件共享”的选择。 然后定位到无法删除的DLL文件上,右键点击该文件,在弹出菜单中选择“属性”命令,单击“高级”按钮,在弹出的窗口中去掉“从父项继承那些可以应用的到子对象的权限项目,包括那些在此明确定义的项目”不被选中(如图5)。再在弹出的窗口中单击“删除”,再依次单击“确定”。这样就没有任何用户可以访问和调用这个DLL木马文件了。重新启动系统就可以删除该DLL文件了。</p>
<h2 id="第二步,-清除注册表"><a href="#第二步,-清除注册表" class="headerlink" title="第二步, 清除注册表"></a>第二步, 清除注册表</h2><p>恢复系统 将DLL文件删除后,还要到注册表中找到所有与该DLL木马关联的项目,尤其是: HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunServices 等几个与自动启动有关的项目。 另外,DLL木马不仅仅局限存在于Run、Runonce这些众所周知的子键,而有可能存在于更多的地方。例如对于后门类的DLL来说“KnownDLLs”就是再好不过的藏身之处。在注册表的“HEKY_LOCALMACHINE\SYSTEM\ControlSet001\Control\Session Manager\KnownDLLs”子键下,存放着一些已知DLL的默认路径。假设DLL木马修改或者增加了某些键值,那么DLL木马就可以在系统启动的时候悄无声息地代替正常的DLL文件被加嵌入到相应的进程中。</p>
<h1 id="总结"><a href="#总结" class="headerlink" title="总结"></a>总结</h1><p>总的来说,DLL木马后门的种类极多,木马选择的注册表选项及其系统进程也不尽相同。清除DLL木马的总体思路是这样的: 在碰到DLL注入类木马时,我们可以首先考虑用procexp之类的工具,查找出DLL类木马的宿主进程。找到宿主进程后,如果是注入到普通可结束的进程中,可以直接将宿主进程结束后直接删除木马文件即可。 如果DLL木马是注入到系统关键进程中的话,可以考虑用IceSword卸载DLL文件;如若失败,那么直接用SSM建立规则或者通过阻止DLL文件的加载就可以了</p>
<p class="article-more-link">
</p>
</div>
<footer class="article-footer clearfix">
<div class="article-catetags">
<div class="article-categories">
<span></span>
<a class="article-category-link" href="/categories/其它/">其它</a>
</div>
<div class="article-tags">
<span></span> <a href="/tags/dll/">dll</a><a href="/tags/anti-virus/">anti-virus</a>
</div>
</div>
<div class="comments-count">
</div>
</footer>
</article>
<article class="post-expand post" itemprop="articleBody">
<header class="article-info clearfix">
<h1 itemprop="name">
<a href="/2016/04/06/how-to-install-cassandra-driver/" title="how to install cassandra-driver" itemprop="url">how to install cassandra-driver</a>
</h1>
<p class="article-author">By
<a href="/about" title="John Shi" target="_blank" itemprop="author">John Shi</a>
<p class="article-time">
<time datetime="2016-04-05T17:03:36.000Z" itemprop="datePublished"> 发表于 2016-04-06</time>
</p>
</header>
<div class="article-content">
<p><strong>Case:</strong></p>
<p>Istall cassandra-driver: pip install cassandra-driver</p>
<p>Environment:</p>
<p>python 3.4.4rc1, visual studio 2015 and VC++ common tools installed</p>
<p><strong>Issue:</strong></p>
<p>Microsoft Visual C++ 10.0 is required (Unable to find vcvarsall.bat)</p>
<p><strong>Fix:</strong></p>
<p>step 1, set VS100COMNTOOLS=%VS140COMNTOOLS%</p>
<p>step 2, copy vcvarsal.bat from /Microsoft Visual Studio 12.0/VC to /Microsoft Visual Studio 12.0/Common7/Tools/</p>
<p class="article-more-link">
</p>
</div>
<footer class="article-footer clearfix">
<div class="article-catetags">
<div class="article-categories">
<span></span>
<a class="article-category-link" href="/categories/Database/">Database</a>
</div>
<div class="article-tags">
<span></span> <a href="/tags/cassandra/">cassandra</a><a href="/tags/python/">python</a>
</div>
</div>
<div class="comments-count">
</div>
</footer>
</article>
<article class="post-expand post" itemprop="articleBody">
<header class="article-info clearfix">
<h1 itemprop="name">
<a href="/2016/03/01/how-to-make-pgadmin-connect-to-postgresql-database-on-vm/" title="How to make pgAdmin connected to postgresql database on VM?" itemprop="url">How to make pgAdmin connected to postgresql database on VM?</a>
</h1>
<p class="article-author">By
<a href="/about" title="John Shi" target="_blank" itemprop="author">John Shi</a>
<p class="article-time">
<time datetime="2016-03-01T08:59:42.000Z" itemprop="datePublished"> 发表于 2016-03-01</time>
</p>
</header>
<div class="article-content">
<ol>
<li><p>Install postgresql (e.g. centos: yum install postgresql-server).</p>
</li>
<li><p>Allow TCP/IP socket (suppose we’re using PostgreSQL versio8.x or newer)<br><code>vi /var/lib/pgsql/data/postgresql.conf</code><br>Find configuration line:<br><code>listen_addresses='localhost'</code><br>And change it to:<br><code>listen_addresses='*'</code><br>or<br><code>listen_addresses='x.x.x.x x.x.x.x'</code></p>
</li>
<li><p>Enable client authentication<br><code>vi /var/lib/pgsql/data/pg_hba.conf</code><br>and add the line”:<br><code>host all all 10.10.29.0/24 trust</code></p>
</li>
<li><p>restart PostgreSQL server<br><code>/etc/init.d/postgresql restart</code><br>or<br><code>service postgresql restart</code></p>
</li>
<li><p>Make port mapping. (e.g. 127.0.0.1:5432 -> 10.0.2.15:5432)</p>
</li>
</ol>
<p class="article-more-link">
</p>
</div>
<footer class="article-footer clearfix">
<div class="article-catetags">
<div class="article-categories">
<span></span>
<a class="article-category-link" href="/categories/Database/">Database</a>
</div>
<div class="article-tags">
<span></span> <a href="/tags/pgAdmin/">pgAdmin</a><a href="/tags/postgresql/">postgresql</a>
</div>
</div>
<div class="comments-count">
</div>
</footer>
</article>
<article class="post-expand post" itemprop="articleBody">
<header class="article-info clearfix">
<h1 itemprop="name">
<a href="/2016/02/17/how-to-enable-ssh-3/" title="Ubuntu: How To Enable SSH" itemprop="url">Ubuntu: How To Enable SSH</a>
</h1>
<p class="article-author">By
<a href="/about" title="John Shi" target="_blank" itemprop="author">John Shi</a>
<p class="article-time">
<time datetime="2016-02-16T16:18:44.000Z" itemprop="datePublished"> 发表于 2016-02-17</time>
</p>
</header>
<div class="article-content">
<ol>
<li>install openssh-server<br><code>sudo apt-get install openssh-server</code></li>
<li>edit the configuration file and look for the Port 22 line and uncomment it by removing the preceding hash sign<br><code>sudo vi /etc/ssh/ssh_config</code></li>
<li>restart the SSH service<br><code>sudo service ssh restart</code> or<br><code>sudo /etc/init.d/ssh restart</code></li>
</ol>
<p class="article-more-link">
</p>
</div>
<footer class="article-footer clearfix">
<div class="article-catetags">
<div class="article-categories">
<span></span>
<a class="article-category-link" href="/categories/Linux/">Linux</a>
</div>
<div class="article-tags">
<span></span> <a href="/tags/ubuntu/">ubuntu</a><a href="/tags/ssh/">ssh</a>
</div>
</div>
<div class="comments-count">
</div>
</footer>
</article>
<article class="post-expand post" itemprop="articleBody">
<header class="article-info clearfix">
<h1 itemprop="name">
<a href="/2016/01/07/the-step-of-setup-django-web/" title="The step of setup django web" itemprop="url">The step of setup django web</a>
</h1>
<p class="article-author">By
<a href="/about" title="John Shi" target="_blank" itemprop="author">John Shi</a>
<p class="article-time">
<time datetime="2016-01-06T16:34:24.000Z" itemprop="datePublished"> 发表于 2016-01-07</time>
</p>
</header>
<div class="article-content">
<h1 id="start-a-project"><a href="#start-a-project" class="headerlink" title="start a project"></a>start a project</h1><p>$ django-admin.py startproject mysite</p>
<p><img src="/img/onenote-568d41e22c3760.36676796.png" alt=""></p>
<h1 id="start-a-app"><a href="#start-a-app" class="headerlink" title="start a app"></a>start a app</h1><p>$ python manage.py startapp polls</p>
<p><img src="/img/onenote-568d41e35443d7.31308359.png" alt=""></p>
<h1 id="modify-ENGINE-NAME"><a href="#modify-ENGINE-NAME" class="headerlink" title="modify ENGINE, NAME"></a>modify ENGINE, NAME</h1><p><span style="font-family: Arial; font-size: 10pt; background-color: yellow;">from os import path</span></p>
<p><span style="font-family: Arial; font-size: 10pt; background-color: yellow;">PROJECT_ROOT = path.dirname(path.abspath(path.dirname(<strong>file</strong>)))</span></p>
<p><span style="font-family: Arial; font-size: 10pt;">DATABASES = {</span></p>
<p><span style="font-family: Arial; font-size: 10pt;"> ‘default’: {</span></p>
<p><span style="font-family: Arial; font-size: 10pt;"> ‘ENGINE’: ‘django.db.backends</span><span style="font-family: Arial; font-size: 10pt; background-color: yellow;">.sqlite3</span><span style="font-family: Arial; font-size: 10pt;">‘, # Add ‘postgresql_psycopg2’, ‘mysql’, ‘sqlite3’ or ‘oracle’.</span></p>
<p><span style="font-family: Arial; font-size: 10pt;"> ‘NAME’: </span><span style="font-family: Arial; font-size: 10pt; background-color: yellow;">path.join(PROJECT_ROOT, ‘db.sqlite3’)</span><span style="font-family: Arial; font-size: 10pt;">, # Or path to database file if using sqlite3.</span></p>
<p><span style="font-family: Arial; font-size: 10pt;"> ‘USER’: ‘’, # Not used with sqlite3.</span></p>
<p><span style="font-family: Arial; font-size: 10pt;"> ‘PASSWORD’: ‘’, # Not used with sqlite3.</span></p>
<p><span style="font-family: Arial; font-size: 10pt;"> ‘HOST’: ‘’, # Set to empty string for localhost. Not used with sqlite3.</span></p>
<p><span style="font-family: Arial; font-size: 10pt;"> ‘PORT’: ‘’, # Set to empty string for default. Not used with sqlite3.</span></p>
<p><span style="font-family: Arial; font-size: 10pt;"> }</span></p>
<p><span style="font-family: Arial; font-size: 10pt;">}</span></p>
<h1 id="Apply-the-DB"><a href="#Apply-the-DB" class="headerlink" title="Apply the DB"></a>Apply the DB</h1><p>$ python manage.py migrate</p>
<p><span style="font-family: 宋体;">如果</span><span lang="en-US"> app </span><span style="font-family: 宋体;">里面的</span><span lang="en-US"> model </span><span style="font-family: 宋体;">有变动</span><span lang="en-US">: </span><span style="font-family: 宋体;">需要</span> <span style="font-family: 宋体;">先执行</span><span lang="en-US"> makemigrations</span></p>
<!-- OutlineGroupNode is not supported -->
<h1 id="Enable-admin"><a href="#Enable-admin" class="headerlink" title="Enable admin"></a>Enable admin</h1><h1 id="重新定义-admin-对象的样式"><a href="#重新定义-admin-对象的样式" class="headerlink" title="重新定义 admin 对象的样式"></a>重新定义 admin 对象的样式</h1><p> create a model admin object, then pass it as the second argument to <span style="font-family: Fira Mono; font-size: 13pt; color: #0c4b33; background-color: white; font-weight: bold;">admin.site.register()</span> – any time you need to change the admin options for an object.</p>
<p><img src="/img/onenote-568d41e43c1c50.41249397.png" alt=""></p>
<p class="article-more-link">
</p>
</div>
<footer class="article-footer clearfix">
<div class="article-catetags">
<div class="article-categories">
<span></span>
<a class="article-category-link" href="/categories/web/">web</a>
</div>
<div class="article-tags">
<span></span> <a href="/tags/django/">django</a>
</div>
</div>
<div class="comments-count">
</div>
</footer>
</article>
<article class="post-expand post" itemprop="articleBody">
<header class="article-info clearfix">
<h1 itemprop="name">
<a href="/2016/01/04/how-to-setup-own-blog/" title="如何建立个人博客" itemprop="url">如何建立个人博客</a>
</h1>
<p class="article-author">By
<a href="/about" title="John Shi" target="_blank" itemprop="author">John Shi</a>
<p class="article-time">
<time datetime="2016-01-03T16:34:22.000Z" itemprop="datePublished"> 发表于 2016-01-04</time>
</p>
</header>
<div class="article-content">
<h1 id="Host-your-website-on-your-VPS"><a href="#Host-your-website-on-your-VPS" class="headerlink" title="Host your website on your VPS"></a>Host your website on your VPS</h1><p>Take an example:</p>
<ol>
<li>Get a vps from <a href="http://www.impactvps.com/" target="_blank" rel="external">impactvps</a>.</li>
<li><a href="http://172.110.31.37/wordpress/index.php/2016/01/03/how-to-install-wordpress/" target="_blank" rel="external">Install wordpress on the vps</a></li>
</ol>
<h1 id="Apply-a-domain-name"><a href="#Apply-a-domain-name" class="headerlink" title="Apply a domain name"></a>Apply a domain name</h1><p><a href="http://www.dot.tk/" target="_blank" rel="external">dot.tk</a> (<a href="https://my.freenom.com/clientarea.php" target="_blank" rel="external">freenom</a>)provides applying the free domain name.</p>
<h1 id="Use-own-DNS-to-bind-the-host-with-the-domain-name"><a href="#Use-own-DNS-to-bind-the-host-with-the-domain-name" class="headerlink" title="Use own DNS to bind the host with the domain name"></a>Use own DNS to bind the host with the domain name</h1><ol>
<li>You can get the free DNS servers from <a href="https://www.dnspod.cn/" target="_blank" rel="external">dnspod</a>.</li>
<li>Add a domain name and add a record to it.</li>
</ol>
<p class="article-more-link">
</p>
</div>
<footer class="article-footer clearfix">
<div class="article-catetags">
<div class="article-categories">
<span></span>
<a class="article-category-link" href="/categories/其它/">其它</a>
</div>
<div class="article-tags">
<span></span> <a href="/tags/wordpress/">wordpress</a><a href="/tags/vps/">vps</a><a href="/tags/DNS/">DNS</a>
</div>
</div>
<div class="comments-count">
</div>
</footer>
</article>
<article class="post-expand post" itemprop="articleBody">
<header class="article-info clearfix">
<h1 itemprop="name">
<a href="/2016/01/03/how-to-install-wordpress/" title="How to install wordpress" itemprop="url">How to install wordpress</a>
</h1>
<p class="article-author">By
<a href="/about" title="John Shi" target="_blank" itemprop="author">John Shi</a>
<p class="article-time">
<time datetime="2016-01-03T09:50:06.000Z" itemprop="datePublished"> 发表于 2016-01-03</time>
</p>
</header>
<div class="article-content">
<p><strong>Enverienment</strong>: ubuntu 14.04</p>
<ol>
<li>apt-get install apache2</li>
<li>apt-get install php5</li>
<li>apt-get install mysql-server mysql-client</li>
<li>download the code of wordpress from official site</li>
</ol>
<p class="article-more-link">
</p>
</div>
<footer class="article-footer clearfix">
<div class="article-catetags">
<div class="article-categories">
<span></span>
<a class="article-category-link" href="/categories/其它/">其它</a>
</div>
<div class="article-tags">
<span></span> <a href="/tags/ubuntu/">ubuntu</a><a href="/tags/wordpress/">wordpress</a>
</div>
</div>
<div class="comments-count">
</div>
</footer>
</article>
</div>
<div class="openaside"><a class="navbutton" href="#" title="显示侧边栏"></a></div>
<div id="asidepart">
<div class="closeaside"><a class="closebutton" href="#" title="隐藏侧边栏"></a></div>
<aside class="clearfix">
<div class="categorieslist">
<p class="asidetitle">分类</p>
<ul>
<li><a href="/categories/Database/" title="Database">Database<sup>2</sup></a></li>
<li><a href="/categories/Linux/" title="Linux">Linux<sup>1</sup></a></li>
<li><a href="/categories/web/" title="web">web<sup>1</sup></a></li>
<li><a href="/categories/其它/" title="其它">其它<sup>4</sup></a></li>
</ul>
</div>
<div class="tagslist">
<p class="asidetitle">标签</p>
<ul class="clearfix">
<li><a href="/tags/ubuntu/" title="ubuntu">ubuntu<sup>2</sup></a></li>
<li><a href="/tags/wordpress/" title="wordpress">wordpress<sup>2</sup></a></li>
<li><a href="/tags/django/" title="django">django<sup>1</sup></a></li>
<li><a href="/tags/cassandra/" title="cassandra">cassandra<sup>1</sup></a></li>
<li><a href="/tags/dll/" title="dll">dll<sup>1</sup></a></li>
<li><a href="/tags/anti-virus/" title="anti-virus">anti-virus<sup>1</sup></a></li>
<li><a href="/tags/ssh/" title="ssh">ssh<sup>1</sup></a></li>
<li><a href="/tags/python/" title="python">python<sup>1</sup></a></li>
<li><a href="/tags/pgAdmin/" title="pgAdmin">pgAdmin<sup>1</sup></a></li>
<li><a href="/tags/postgresql/" title="postgresql">postgresql<sup>1</sup></a></li>
<li><a href="/tags/vps/" title="vps">vps<sup>1</sup></a></li>
<li><a href="/tags/DNS/" title="DNS">DNS<sup>1</sup></a></li>
<li><a href="/tags/hexo/" title="hexo">hexo<sup>1</sup></a></li>
<li><a href="/tags/github/" title="github">github<sup>1</sup></a></li>
</ul>
</div>
<div class="linkslist">
<p class="asidetitle">友情链接</p>
<ul>
</ul>
</div>
<div class="rsspart">
<a href="/atom.xml" target="_blank" title="rss">RSS 订阅</a>
</div>
<div class="weiboshow">
<p class="asidetitle">新浪微博</p>
<iframe width="100%" height="119" class="share_self" frameborder="0" scrolling="no" src="http://widget.weibo.com/weiboshow/index.php?language=&width=0&height=119&fansRow=2&ptype=1&speed=0&skin=9&isTitle=1&noborder=1&isWeibo=0&isFans=0&uid=null&verifier=&dpc=1"></iframe>
</div>
</aside>
</div>
</div>
<footer><div id="footer" >
<section class="info">
<p> Hello ,I'm John Page in Google. <br/>
This is my blog,believe it or not.</p>
</section>
<div class="social-font" class="clearfix">
<a href="mailto:158227990@qq.com" target="_blank" class="icon-email" title="Email Me"></a>
</div>
<p class="copyright">
Powered by <a href="http://hexo.io" target="_blank" title="hexo">hexo</a> and Theme by <a href="https://github.com/wuchong/jacman" target="_blank" title="Jacman">Jacman</a> © 2016
<a href="/about" target="_blank" title="John Shi">John Shi</a>
</p>
</div>
</footer>
<script src="/js/jquery-2.0.3.min.js"></script>
<script src="/js/jquery.imagesloaded.min.js"></script>
<script src="/js/gallery.js"></script>
<script src="/js/jquery.qrcode-0.12.0.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$('.navbar').click(function(){
$('header nav').toggleClass('shownav');
});
var myWidth = 0;
function getSize(){
if( typeof( window.innerWidth ) == 'number' ) {
myWidth = window.innerWidth;
} else if( document.documentElement && document.documentElement.clientWidth) {
myWidth = document.documentElement.clientWidth;
};
};
var m = $('#main'),
a = $('#asidepart'),
c = $('.closeaside'),
o = $('.openaside');
c.click(function(){
a.addClass('fadeOut').css('display', 'none');
o.css('display', 'block').addClass('fadeIn');
m.addClass('moveMain');
});
o.click(function(){
o.css('display', 'none').removeClass('beforeFadeIn');
a.css('display', 'block').removeClass('fadeOut').addClass('fadeIn');
m.removeClass('moveMain');
});
$(window).scroll(function(){
o.css("top",Math.max(80,260-$(this).scrollTop()));
});
$(window).resize(function(){
getSize();
if (myWidth >= 1024) {
$('header nav').removeClass('shownav');
}else{
m.removeClass('moveMain');
a.css('display', 'block').removeClass('fadeOut');
o.css('display', 'none');
}
});
});
</script>
<link rel="stylesheet" href="/fancybox/jquery.fancybox.css" media="screen" type="text/css">
<script src="/fancybox/jquery.fancybox.pack.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$('.article-content').each(function(i){
$(this).find('img').each(function(){
if ($(this).parent().hasClass('fancybox')) return;
var alt = this.alt;
if (alt) $(this).after('<span class="caption">' + alt + '</span>');
$(this).wrap('<a href="' + this.src + '" title="' + alt + '" class="fancybox"></a>');
});
$(this).find('.fancybox').each(function(){
$(this).attr('rel', 'article' + i);
});
});
if($.fancybox){
$('.fancybox').fancybox();
}
});
</script>
<!-- Analytics Begin -->
<script>
var _hmt = _hmt || [];
(function() {
var hm = document.createElement("script");
hm.src = "//hm.baidu.com/hm.js?e6d1f421bbc9962127a50488f9ed37d1";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();
</script>
<!-- Analytics End -->
<!-- Totop Begin -->
<div id="totop">
<a title="返回顶部"><img src="/img/scrollup.png"/></a>
</div>
<script src="/js/totop.js"></script>
<!-- Totop End -->
<!-- MathJax Begin -->
<!-- mathjax config similar to math.stackexchange -->
<!-- MathJax End -->
<!-- Tiny_search Begin -->
<!-- Tiny_search End -->
</body>
</html>